tueda / makefile4latex

A GNU Makefile for typesetting LaTeX documents.
MIT License
26 stars 3 forks source link

Describing aux-file dependency #34

Open tueda opened 2 years ago

tueda commented 2 years ago

For the xr package etc., it would be nice if one could write a dependency on an auxiliary file of another file. Currently, one has to write something like:

doc2.pdf: $(BUILDDIR)/doc1.aux

$(BUILDDIR)/%.aux: %.tex
    @$(MAKE) --no-print-directory $*.pdf
    @if [ -f $(BUILDDIR)/$*.aux ]; then :; else \
        touch $*.tex; \
        $(MAKE) --no-print-directory $*.pdf; \
    fi

Note that the above rules should be defined after $(BUILDDIR) is set.