X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjotex.git;a=blobdiff_plain;f=GNUmakefile;fp=GNUmakefile;h=dd8af234683c49057a0045aa3e3919f17835cb01;hp=3f941fbeab7dd637502a99481e73c497dad57aeb;hb=27f00374a2bf78ce1bf1e649f0881c31e92bd92b;hpb=6dfb93ac68463f1f47a009e2d1672c1c78f1e847 diff --git a/GNUmakefile b/GNUmakefile index 3f941fb..dd8af23 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -44,6 +44,16 @@ SAGE_LISTING_DSTS = $(patsubst %.listing,%.py,$(SAGE_LISTING_SRCS)) # INDICES = $(PN) +# We have to rebuild the index whenever the contents of the document +# change, because page numbers get moved around. But when no INDICES +# are defined, rebuilding them should be a no-op. This next definition +# ensures that. +ifdef INDICES +REMAKE_INDICES = makeindex $(INDEX_SRCS) +else +REMAKE_INDICES = true +endif + # 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. @@ -117,6 +127,7 @@ $(PN).pdf: $(SRCS) $(PN).bbl $(INDEX_DSTS) rm $@.previous; \ else \ mv $@ $@.previous; \ + $(REMAKE_INDICES); \ $(MAKE) $@; \ fi;