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) $(PDF) # Generate package using makedtx and pdflatex $(DTX): %.dtx: tex/%.sty doc/%.tex makedtx -author "$(AUTHOR)" -license $(LICENSE) \ -dir $(dir $<) -src "(.*)\.sty=>\1.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 *.pdf rm -f *~ tex/*~ doc/*~