]> gitweb.michael.orlitzky.com - mjotex.git/blobdiff - makefile
Rename the makefile to "GNUmakefile".
[mjotex.git] / makefile
diff --git a/makefile b/makefile
deleted file mode 100644 (file)
index 331c65c..0000000
--- a/makefile
+++ /dev/null
@@ -1,141 +0,0 @@
-#
-# Example makefile using mjotex and a BibTeX references database.
-#
-
-# The latex compiler.
-LATEX = pdflatex -file-line-error -halt-on-error
-
-# The name of this document.
-PN = examples
-
-# A space-separated list of bib files. These must all belong to paths
-# contained in your $BIBINPUTS environment variable.
-#
-# Leave commented if you don't use a bibliography file.
-#
-#BIBS = references.bib
-
-# A space-separated list of the mjotex files that you use. The path to
-# mjotex must be contain in your $TEXINPUTS environment variable.
-MJOTEX  = mjo-algorithm.tex mjo-arrow.tex mjo-common.tex mjo-cone.tex
-MJOTEX += mjo-convex.tex mjo-font.tex mjo-linear_algebra.tex mjo-listing.tex
-MJOTEX += mjo-misc.tex mjo-proof_by_cases.tex mjo-theorem.tex
-MJOTEX += mjo-theorem-star.tex mjo-topology.tex
-
-# Use kpsewhich (from the kpathsea suite) to find the absolute paths
-# of the bibtex/mjotex files listed in in $(BIBS)/$(MJOTEX). The SRCS
-# variable should contain all (Bib)TeX source files for the document.
-SRCS = $(PN).tex
-ifdef BIBS
-BIBPATHS = $(shell kpsewhich $(BIBS))
-SRCS += $(BIBPATHS)
-endif
-ifdef MJOTEX
-MJOTEXPATHS = $(shell kpsewhich $(MJOTEX))
-SRCS += $(MJOTEXPATHS)
-endif
-
-
-# The first target is the default, so put the PDF document first.
-#
-# This voodoo is all designed to find a "fixed point" of calling
-# $(LATEX). When you build a LaTeX document, it requires an unknown
-# number of compilation passes. How do you know when to stop? Easy,
-# stop when the output file stops changing! But how to encode that
-# in a makefile?
-#
-# At the start of this target, we call $(LATEX) to compile $(PN).tex.
-# If you ignore the "sed" for now, then the next step is to check for
-# the existence of a "previous" file. If there isn't one, this is the
-# first time that we've tried to build the PDF. In that case, take the
-# PDF that we've just built and make *that* the previous file. Then
-# start all over. If there is a previous file, then this is the second
-# (or more) time that we've tried to build the PDF. We diff the PDF
-# file that we've just built against the previous file; if they're the
-# same, then we've succeeded and stop. Otherwise, we make the new PDF
-# the previous file, and start all over. The end result is that we
-# will loop until the newly-created PDF and the previous file are
-# identical.
-#
-# But what about the "sed" call? By default, pdflatex will compile the
-# creation date, modification date, and a unique ID into the output
-# PDF. That means that two otherwise-identical documents, created
-# seconds apart, will look different. We only need to know when the
-# *contents* of the document are the same -- we don't care about the
-# metadata -- so sed is used to remove those three nondeterministic
-# pieces of information.
-#
-# The creation and modification dates should become optional in pdftex
-# v1.40.17 thanks to Debian's SOURCE_DATE_EPOCH initiative. When that
-# version of pdflatex makes it into TeX Live 2016, we can replace
-# those two sed scripts with something smarter.
-#
-$(PN).pdf: $(SRCS) $(PN).bbl
-       $(LATEX) $(PN).tex
-
-       sed --in-place \
-           -e '/^\/ID \[<.*>\]/d' \
-            -e "s/^\/\(ModDate\) (.*)/\/\1 (D:19700101000000Z00'00')/" \
-            -e "s/^\/\(CreationDate\) (.*)/\/\\1 (D:19700101000000Z00'00')/" \
-            $@
-
-       if [ ! -f $@.previous ]; then \
-               mv $@ $@.previous; \
-               $(MAKE) $@; \
-       fi;
-
-       if cmp -s $@ $@.previous; then \
-               rm $@.previous; \
-       else \
-               mv $@ $@.previous; \
-               $(MAKE) $@; \
-       fi;
-
-
-$(PN).aux: $(SRCS)
-       $(LATEX) $(PN).tex
-
-
-# The pipe below indicates an "order-only dependency" on the aux file.
-# Without it, every compilation of $(PN).tex would produce a new
-# $(PN).aux, and thus $(PN).bbl would be rebuild. This in turn causes
-# $(PN).pdf to appear out-of-date, which leads to a recompilation of
-# $(PN).tex... and so on. The order-only dependency means we won't
-# rebuild $(PN).bbl if $(PN).aux changes.
-#
-# As a side effect, we now need to depend on $(SRCS) here, since we
-# won't pick it up transitively from $(PN).aux.
-#
-# If the $BIBS variable is undefined, we presume that there are no
-# references and create an empty bbl file. Otherwise, we risk trying
-# to run biblatex on an aux file containing no citations.
-#
-$(PN).bbl: $(SRCS) | $(PN).aux
-ifdef BIBS
-       bibtex $(PN).aux
-else
-       echo -n '' > $@
-endif
-
-# Run chktex to find silly mistakes. There is some exit code weirdness
-# (Savannah bug 45979), so we just look for empty output.
-.PHONY: check
-check:
-       @[ -z "$(shell chktex --quiet mjotex.sty)" ]
-
-# Clean up leftover junk.
-.PHONY: clean
-clean:
-       rm -f *.{aux,bbl,bcf,bib,blg,listing,lof,log}
-       rm -f *.{nav,out,pdf,snm,spl,toc,xml}
-       rm -rf dist/
-
-# If this document will be published, the publisher isn't going to
-# have your BibTeX database or your mjotex files. So, you need to
-# package them up along with the code for your document. This target
-# will create a "dist" directory and copy the necessary stuff there.
-#
-.PHONY: dist
-dist: $(PN).bbl
-       mkdir -p dist
-       cp $(SRCS) $(PN).bbl $(BIBPATHS) $(MJOTEXPATHS) dist/