NAME = ekdosis SHELL = bash CMP = lualatex-dev PWD = $(shell pwd) VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) UTREE = $(shell kpsewhich --var-value TEXMFHOME) HOMEDIR := $$HOME exts := ins dtx el findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") all: sty $(NAME).pdf test -e README.txt && mv README.txt README || exit 0 sty: clean $(CMP) $(NAME).ins $(NAME).pdf: $(NAME).dtx $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME)-ex.tex >/dev/null $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null clean: rm -f $(NAME).bib $(PWD)/TMP/*.bib rm -rf .backup find -iname "*~" -or -iname "*.pdf" | xargs rm -rf find ./* -type f -iname "Makefile" $(findopts) > ls-R # find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R rsync -avPr --files-from=ls-R . .backup rm -rf * cp -p -r .backup/* . rm -rf .backup # pandoc -s README.md -o about.html auctex: if [ ! -d "$(HOMEDIR)/.emacs.d/auctex/auto" ]; then \ mkdir -p $(HOMEDIR)/.emacs.d/auctex/auto; \ fi cp $(NAME)*.el $(HOMEDIR)/.emacs.d/auctex/auto distclean: clean uninst uninst: rm -rf $(UTREE)/{tex,source,doc}/lualatex/$(NAME) rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/$(NAME).{el,elc} inst: uninst auctex all mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) cp $(NAME).dtx $(UTREE)/source/lualatex/$(NAME) cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME) local: uninst auctex $(CMP) $(NAME).ins mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) #install: all # sudo mkdir -p $(LOCAL)/{tex,source,doc}/lualatex/$(NAME) # sudo cp $(NAME).dtx $(LOCAL)/source/lualatex/$(NAME) # sudo cp $(NAME).sty $(LOCAL)/tex/lualatex/$(NAME) # sudo cp $(NAME).pdf $(LOCAL)/doc/lualatex/$(NAME) zip: all ln -sf . $(NAME) zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README,$(NAME).{pdf,sty,lua,el}} rm $(NAME) package: distclean all mkdir $(NAME)/ cp README *.dtx *.pdf $(NAME)/ mkdir -p tex/lualatex/$(NAME)/ cp *.lua *.sty tex/lualatex/$(NAME)/ mkdir -p doc/lualatex/$(NAME)/ cp *.el *.pdf doc/lualatex/$(NAME)/ mkdir -p source/lualatex/$(NAME)/ cp Makefile *.dtx source/lualatex/$(NAME)/ zip -r $(NAME).tds.zip tex doc source rm -rf tex/ source/ doc/ tar czf $(NAME)-$(VERS).tar.gz $(NAME).tds.zip $(NAME)/ rm -rf $(NAME)/ .PHONY: all clean distclean inst local uninst install uninstall zip package samples