From 398b3476ba45f78b35b03b2d09d3152f458008b0 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Fri, 16 Sep 2022 09:33:08 +0200 Subject: Setup. Add a root make script --- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Makefile 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 *.~ -- cgit v1.2.3