forked from zedz/lcthw-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
JUNK_FILES=$(FINAL).* *.aux *.log styles/*.aux
SOURCE=book
WEBSITE=learncodethehardway.org:/var/www/learncodethehardway.org/c/
FINAL=learn-c-the-hard-way
book:
dexy
cp Makefile output/
${MAKE} -C output clean $(FINAL).pdf
rm -rf output/*.dvi output/*.pdf
${MAKE} -C output $(FINAL).pdf
draft: $(FINAL).dvi
$(FINAL).pdf:
cp $(SOURCE).tex $(FINAL).tex
pdflatex -halt-on-error $(FINAL).tex
html:
cp -r site/js site/css output/
cd output && cp $(SOURCE)-html.tex $(FINAL).tex
cd output && htlatex $(FINAL).tex "book,index=1,2,next,fn-in"
gsed -i -f output/clean.sed output/*.html
view: $(FINAL).pdf
evince $(FINAL).pdf
clean:
rm -rf $(JUNK_FILES)
find . -name "*.aux" -exec rm {} \;
rm -rf output
release: clean $(FINAL).pdf draft $(FINAL).pdf sync
syncpdf: book
rsync -vz output/$(FINAL).pdf $(WEBSITE)/$(FINAL).pdf
sync: syncpdf html
rsync -avz output/$(FINAL).html $(WEBSITE)/book/index.html
rsync -avz output/*.html output/*.css output/css output/js $(WEBSITE)/book/
python scripts/s3push.py lcthw output/site/css/*.css output/*.css output/site/js/*.js