From 0addb8eebce7017a0a9b990907f61bb5dff715c4 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 14 Jun 2020 11:26:35 +0200 Subject: Makefile: added .PHONY and improved clean rule --- Makefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 443969a..9666050 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ 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 @@ -22,11 +25,16 @@ $(NAME).pdf: $(NAME).dtx $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null clean: - rm -rf _minted-* - rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,log,out,toc,pyg} - rm -f *~ - rm -rf auto/ -# rm -f $(NAME)_*.{bib,lua} + 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 \ @@ -35,8 +43,6 @@ auctex: cp $(NAME)*.el $(HOMEDIR)/.emacs.d/auctex/auto distclean: clean uninst - rm -f $(NAME).{pdf,sty,lua,ekd} $(NAME)-ex*.* README* - rm -f *.zip *.tar.gz uninst: rm -rf $(UTREE)/{tex,source,doc}/lualatex/$(NAME) @@ -78,3 +84,5 @@ package: distclean all 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 -- cgit v1.2.3