I'm trying to construct a Makefile to handle the processing of machine-generated LaTeX documents. The Makefile will eventually be written by the same routine that creates the .tex file[s], so that each one can ship with its own custom Makefile.
Because of the two-stage nature of LaTeX processing of cross-references, tables of contents, bibliographic references, indexes, etc, a complete cycle is: latex fn; bibtex fn; latex fn; makeindex fn; latex fn (where the bibtex input [yes, the actual .bib file as well as the .aux file] is written during the first latex pass, and the makeindex input is written during the second latex pass). Is there a way for Make to know whether (for example) a particular file's *content* has changed since the last time LaTeX was run? as opposed to merely its timestamp. My (possibly flaky) understanding is that Make looks at the timestamps of the target and the dependencies to compute if a rule is to be executed; is there a technique to store and compare some other values such as the MD5 of the current and previous versions of a file, or the diff output? Or can this be done manually with shell calls and conditionals? ///Peter