sarabander / sicp-pdf

SICP PDF with Texinfo and LaTeX source
http://sicpebook.wordpress.com/
4.26k stars 537 forks source link

Makefile #6

Closed holomorph closed 10 years ago

holomorph commented 10 years ago

Ideally there wouldn't be any generated pdfs in the repo, but TeX/inkscape are quite a bundle of dependencies so having the pdfs makes some sense.

In any case, having a build system would be convenient. I wrote a src/Makefile to build the book:

FIG := $(patsubst %.svg,%.pdf,$(wildcard *.svg fig/*/*.svg))

all: sicp.pdf

sicp.pdf: sicp.tex ${FIG}
    latexmk -xelatex $<

sicp.tex: sicp.texi
    ./texi-to-latex.pl $<

%.pdf: %.svg
    inkscape -f $< -D -A $@

clean:
    latexmk -CA

clean-all: clean
    ${RM} ${FIG}

.PHONY: all clean clean-all
sarabander commented 10 years ago

Sweet, thanks! I'm not very comfortable keeping binary files in the repo, too. But it has made life easier for people who can't/don't want to recompile. Your contribution makes things much better. If there will be frequent updates to the text and images, I would consider removing the pdfs and just linking to sicp.pdf. Otherwise, there's no harm keeping them in the repo for now.

sarabander commented 10 years ago

I brought your file in and made some additions. My latexmk is too old to recognize -xetex flag. Check if it still works in your system.

holomorph commented 10 years ago

Works nicely. Thanks for adding, I'm glad I could help.

sarabander commented 10 years ago

Great, thanks.