PKG = fripost SRC = fripost acronyms attendants AUTHOR = Fripost LICENSE = gpl .PHONY: all test install DTX = $(addsuffix .dtx, $(PKG)) INS = $(addsuffix .ins, $(PKG)) PDF = $(addsuffix .pdf, $(PKG)) STY = $(addsuffix .sty, $(PKG)) all: $(DTX) $(INS) $(PDF) $(STY) # Generate package using makedtx and pdflatex $(DTX) $(INS): doc/$(PKG).tex tmp.sty makedtx -author "$(AUTHOR)" -license $(LICENSE) \ -src "tmp\.sty=>$(STY)" -doc $< $(PKG) tmp.sty: $(addprefix tex/, $(addsuffix .sty, $(SRC))) cat $^ > $@ # Testing test: make -C $@ clean make -C $@ make -C pandoc $@ # Compilation for installation %.sty: %.ins %.dtx pdflatex $< %.pdf: %.dtx %.ins pdflatex $< # Installation TEXMF ?= $(HOME)/texmf DST_STY := $(TEXMF)/tex/latex/$(PKG) DST_PDF := $(TEXMF)/doc install: \ $(addprefix $(DST_STY)/, $(STY)) \ $(addprefix $(DST_PDF)/, $(PDF)) make -C pandoc $@ $(DST_STY)/%.sty: %.sty mkdir -p $(dir $@) cp $< $@ texhash $(TEXMF) $(DST_PDF)/%.pdf: %.pdf mkdir -p $(dir $@) cp $< $@ texhash $(TEXMF) uninstall: make -C pandoc $@ rm -f $(DST_STY)/* $(DST_PDF)/$(PKG).pdf texhash $(TEXMF) rmdir --ignore-fail-on-non-empty -p $(DST_STY) $(DST_PDF) # Clean clean: make -C pandoc $@ make -C test $@ rm -f tmp.sty rm -f *.aux *.hd *.log *.out rm -f *.dtx *.ins *.pdf *.sty rm -f *~ tex/*~ doc/*~