diff options
Diffstat (limited to 'macros/latex/contrib/phfthm/pkg.mk')
-rw-r--r-- | macros/latex/contrib/phfthm/pkg.mk | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/macros/latex/contrib/phfthm/pkg.mk b/macros/latex/contrib/phfthm/pkg.mk index 3cc121ce5e..328b5fc36d 100644 --- a/macros/latex/contrib/phfthm/pkg.mk +++ b/macros/latex/contrib/phfthm/pkg.mk @@ -4,7 +4,9 @@ # LATEX = latex -PDFLATEX = TEXINPUTS="$$TEXINPUTS:../phfnote" pdflatex +PDFLATEXNAME = pdflatex + +PDFLATEX = TEXINPUTS="$$TEXINPUTS:../phfnote" $(PDFLATEXNAME) PDFLATEXOPTS = -interaction=batchmode PDFLATEXOPTSLAST = -interaction=batchmode --synctex=1 @@ -29,29 +31,38 @@ PKGREADME = README.md # DIST_ADDITIONAL_FILES ?= +# +# Additional files automatically generated by the .ins file, such as .def files +# (by default empty) +# +ADDITIONAL_GENERATED_FILES ?= + + +# By default, the generated style file is a '.sty' latex package. If it's a +# '.cls' class file instead, the local Makefile will redefine this to 'cls'. +PKGSTYEXT ?= sty PKGDTX = $(PKG).dtx +PKGSTY = $(PKG).$(PKGSTYEXT) PKGINS = $(PKG).ins -PKGSTY = $(PKG).sty PKGPDF = $(PKG).pdf PKGTDSZIP = $(PKG).tds.zip PKGZIP = $(PKG).zip - -.PHONY: help sty pdf install install_sty install_doc tdszip dist clean cleanall cleansty cleanaux cleanpdf cleantdszip cleandist +.PHONY: help sty cls pdf install install_sty install_cls install_doc tdszip dist clean cleanall cleansty cleancls cleanaux cleanpdf cleantdszip cleandist help: @echo "Targets for $(PKG):" - @echo "make sty -- generate LaTeX package file $(PKG).sty" + @echo "make $(PKGSTYEXT) -- generate LaTeX package file $(PKG).$(PKGSTYEXT)" @echo "make pdf -- generate pdf documentation" - @echo "make install -- install style and documentation files to TEXMF tree" - @echo "make install PREFIX=[specify texmf directory]" - @echo "make $(PKG).tds.zip -- create TDS.ZIP to include in CTAN upload" + @echo "make install -- install style and documentation files to $(DEFAULT_PREFIX)" + @echo "make install PREFIX=[specify texmf directory destination]" + @echo "make $(PKG).tds.zip -- create TDS.ZIP package for distribution" @echo "make dist -- create distribution ZIP, ready for upload to CTAN" @echo "make clean -- remove LaTeX auxiliary files" - @echo "make cleansty -- remove generated style file" + @echo "make clean$(PKGSTYEXT) -- remove generated style file" @echo "make cleanpdf -- remove generated pdf documentation" @echo "make cleanall -- remove all generated files, incl. distribution zip" @@ -66,11 +77,17 @@ cleanall: cleansty cleanaux cleanpdf cleantdszip cleandist sty: $(PKGSTY) +# synonym of `sty` in case of LaTeX classes, we use same commands etc. +cls: $(PKGSTY) + $(PKGSTY): $(PKGINS) $(PKGDTX) $(LATEX) $< cleansty: - @rm -f $(PKGSTY) + @rm -f $(PKGSTY) $(ADDITIONAL_GENERATED_FILES) + +cleancls: cleansty + # ------------------------------------------------ # make pdf @@ -121,7 +138,9 @@ cleanpdf: install_sty: $(PKGSTY) mkdir -p $(DESTDIR)$(PREFIX)/tex/latex/$(PKG) - cp $(PKGSTY) $(DESTDIR)$(PREFIX)/tex/latex/$(PKG) + cp $(PKGSTY) $(ADDITIONAL_GENERATED_FILES) $(DESTDIR)$(PREFIX)/tex/latex/$(PKG) + +install_cls: install_sty install_doc: $(PKGPDF) mkdir -p $(DESTDIR)$(PREFIX)/doc/latex/$(PKG) @@ -155,12 +174,14 @@ DISTTMPDIR = $(CURDIR)/_install_dist_zip.make.tmp dist: $(PKGZIP) -$(PKGZIP): $(PKGTDSZIP) +# feedback from CTAN upload manager: prefer not to provide tds.zip in CTAN upload +$(PKGZIP): #$(PKGTDSZIP) rm -rf $(DISTTMPDIR) mkdir -p $(DISTTMPDIR)/$(PKG) - cp $(PKGTDSZIP) $(DISTTMPDIR) +# cp $(PKGTDSZIP) $(DISTTMPDIR) cp $(PKGDTX) $(PKGINS) $(PKGPDF) $(PKGREADME) Makefile pkg.mk $(DIST_ADDITIONAL_FILES) $(DISTTMPDIR)/$(PKG) - cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKGTDSZIP) $(PKG) +# cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKG) $(PKGTDSZIP) + cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKG) rm -rf $(DISTTMPDIR) cleandist: |