X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjotex.git;a=blobdiff_plain;f=GNUmakefile;fp=GNUmakefile;h=1ce4ddc4b203e8500617dd725c587bdcb2be36c7;hp=622570769ac4829021450afb8065815e2d7516d8;hb=26f80f0b525b70b3f33eb8d4a5a6c94da7a20c9d;hpb=55b064149243566c61fe9d1374d85710fe7253c1 diff --git a/GNUmakefile b/GNUmakefile index 6225707..1ce4ddc 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -88,26 +88,21 @@ endif # in a makefile? # # At the start of this target, we call $(LATEX) to compile $(PN).tex. -# The first 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. +# Afterwards, we check for the existence of a "previous" file. If +# there isn't one, then this is the first time that we've built the +# PDF. In that case, we take the PDF that we've just built and make it +# the "previous" file before starting all over. If, on the other hand, +# there already *was* a "previous" file, then this is the second (or +# third...) time that we've built the PDF. We diff the newly-built PDF +# against the "previous" file; if they're the same, then we've +# succeeded and stop. Otherwise, we make the new PDF the "previous" +# one, and start all over. The end result is that we will loop until +# the newly-created PDF and the "previous" one are identical. # $(PN).pdf: $(SRCS) $(PN).bbl $(INDEX_DSTS) $(LATEX) $(PN).tex - if [ ! -f $@.previous ]; then \ - mv $@ $@.previous; \ - $(MAKE) $@; \ - fi; - - if cmp -s $@ $@.previous; then \ + if [ -f $@.previous ] && cmp -s $@ $@.previous; then \ rm $@.previous; \ else \ mv $@ $@.previous; \