Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Makefile for latex (See related posts)

this is a sample makefile to build a latex report with pdflatex. all images are build from a makefile in the subdirectory images/ (see my other Makefile)

I found those websites useful when building the makefile

http://www.wlug.org.nz/MakefileHowto
http://www.gnu.org/software/make/manual/html_chapter/make.html

TEXFILE=report

all: $(TEXFILE).pdf

# .PHONY tells make that these rules don't create any file
# --> if there is a file called all it will still run
.PHONY: all clean images

%.pdf: %.tex images
	pdflatex $<
	pdflatex $<

# for subdirectories use the variable $(MAKE)
# -C path/to/directory to tell in which directory to run
#
#  --> note: use environment variables like this $(VARIABLE)
images:
	$(MAKE) -C images 

clean:
	$(MAKE) clean -C images
	rm -f *.aux *.log

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts