aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Eek <gustav.eek@fripost.org>2022-09-16 09:33:08 +0200
committerGustav Eek <gustav.eek@fripost.org>2023-05-30 11:47:11 +0200
commit398b3476ba45f78b35b03b2d09d3152f458008b0 (patch)
treeff8f4c5ab7e2c5483749f85a5556cc91d429893d
parentab9680caf4c9f0702825a213c8e482bef3fa0dfd (diff)
Setup. Add a root make script
-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 *.~