topsrc = @top_srcdir@ TEXDIR = $(topsrc)/doc/tex PKG = gig DOCDIR = $(topsrc)/addons/$(PKG)/doc SRCS = $(PKG).bib $(PKG).tex gretl.bst gretlhds.sty graphs $(PKG).pdf: $(SRCS) @pdflatex $(PKG) && bibtex $(PKG) && pdflatex $(PKG) && pdflatex $(PKG) @if grep 'Rerun to get' $(PKG).log ; then pdflatex $(PKG) ; fi $(SRCS): | symlinks .PHONY : symlinks clean symlinks: @for f in gretl.bst gretlhds.sty ; do \ if [ ! -f $$f ] || [ $(TEXDIR)/$$f -nt $$f ] ; then ln -sf $(TEXDIR)/$$f . ; fi ; done @if [ ! -d graphs ] || [ $(DOCDIR)/graphs -nt graphs ] ; then ln -sf $(DOCDIR)/graphs . ; fi @for f in $(PKG).bib $(PKG).tex ; do \ if [ ! -f $$f ] || [ $(DOCDIR)/$$f -nt $$f ] ; then ln -sf $(DOCDIR)/$$f . ; fi ; done clean: @rm -f *.log *.aux *.bbl *.blg *.toc $(PKG).pdf