aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4564ec2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+PACKAGE = fripost
+AUTHOR = Fripost
+LICENSE = gpl
+
+.PHONY: all test install
+
+DTX = $(addsuffix .dtx, $(PACKAGE))
+INS = $(addsuffix .ins, $(PACKAGE))
+PDF = $(addsuffix .pdf, $(PACKAGE))
+
+all: $(DTX) $(INS)
+
+# Generate package using makedtx and pdflatex
+
+$(DTX): %.dtx: tex/%.sty doc/%.tex
+ makedtx -author "$(AUTHOR)" -license $(LICENSE) \
+ -dir $(dir $<) -src "$*\.sty=>$*.sty" -doc doc/$*.tex $*
+
+$(INS): %.ins: %.dtx
+
+# Testing
+
+test:
+ make -C $@ clean
+ make -C $@
+
+# Installation
+
+TEXMFHOME ?= $(HOME)/texmf
+DEST_STY := $(TEXMFHOME)/tex/latex/$(PACKAGE)
+DEST_PDF := $(TEXMFHOME)/doc
+
+install: $(PACKAGE).sty $(PACKAGE).pdf
+ mkdir -p $(DEST_STY) $(DEST_PDF)
+ cp $(PACKAGE).sty $(DEST_STY)
+ cp $(PACKAGE).pdf $(DEST_PDF)
+ texhash $(TEXMFHOME)
+
+uninstall:
+ rm -f $(DEST_STY)/* $(DEST_PDF)/$(PACKAGE).pdf
+ texhash $(TEXMFHOME)
+ rmdir --ignore-fail-on-non-empty -p $(DEST_STY) $(DEST_PDF)
+
+%.sty: %.ins %.dtx
+ pdflatex $<
+
+%.pdf: %.dtx
+ pdflatex $<
+
+# Clean
+
+clean:
+ make -C test clean
+ rm -f *.dtx *.ins
+ rm -f *.~