aboutsummaryrefslogtreecommitdiff
path: root/template/GNUmakefile
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2024-10-15 16:08:16 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2024-10-15 16:08:16 +0200
commit385cc92bc91e1a6c3724085c060e76bf40c13ed3 (patch)
tree26d0a8f81f2caa472830fd40a51844bb202c1355 /template/GNUmakefile
Import PhD thesis
Diffstat (limited to 'template/GNUmakefile')
-rw-r--r--template/GNUmakefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/template/GNUmakefile b/template/GNUmakefile
new file mode 100644
index 0000000..1e6853b
--- /dev/null
+++ b/template/GNUmakefile
@@ -0,0 +1,45 @@
+
+
+SOURCE_FILES := $(wildcard *.dtx)
+DEST_FILES := $(shell grep '\\file' kauthesis.ins | sed 's/.*\\file{\([^}]*\)}.*/\1/')
+DOC_FILES := $(foreach f, $(SOURCE_FILES), $(basename $(f)).pdf) kauguide.pdf
+
+PACKAGE :=kau
+TEXMF :=$(shell kpsexpand -n latex '$$TEXMFHOME')
+LATEXDIR :=$(TEXMF)/tex/latex/$(PACKAGE)
+LATEXDOC :=$(TEXMF)/doc/latex/$(PACKAGE)
+EXTENSIONS := aux glo gls idx ilg ind log out toc
+
+all: $(DEST_FILES)
+doc: $(DOC_FILES)
+
+install: $(DEST_FILES)
+ install -d $(LATEXDIR)
+ install -m 0644 $(DEST_FILES) $(LATEXDIR)
+
+install_doc: $(DOC_FILES)
+ install -d $(LATEXDOC)
+ install -m 0644 $(DOC_FILES) $(LATEXDOC)
+
+clean:
+ rm -f $(DOC_FILES) $(DEST_FILES)
+
+$(DEST_FILES): kauthesis.ins $(SOURCE_FILES)
+ latex kauthesis.ins
+ rm -f kauthesis.log
+
+%.pdf: %.dtx
+ pdflatex $<
+ makeindex -s gglo.ist -o $(basename $<).gls $(basename $<).glo
+ makeindex -s gind.ist -o $(basename $<).ind $(basename $<).idx
+ pdflatex $<
+ $(foreach e, $(EXTENSIONS), rm -f $(basename $<).$(e))
+
+kauguide.pdf: kauguide.tex
+ pdflatex $<
+ makeindex -o $(basename $<).ind $(basename $<).idx
+ pdflatex $<
+ pdflatex $<
+ $(foreach e, $(EXTENSIONS), rm -f $(basename $<).$(e))
+
+