-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
81 lines (56 loc) · 2 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Makefile for www structure of PLT
# Files which contribute to index.html
deps=style.css gh-fork-ribbon.css enhance_page.js Makefile
.PHONY : all ship lab% mini ipl-book notes labs-www www
all : exams mini lab1 lab2 lab3 lab4 ipl-book notes labs-www www # www last for linkchecker
# ship :
# ssh [email protected] -t 'bash -l -c up-plt.sh'
# #/chalmers/users/abela/bin/up-plt.sh
# ship : index.html
# # scp $< [email protected]:/chalmers/groups/edu2009/www/www.cse.chalmers.se/year/2015/course/DAT151-lp2/
# scp $< [email protected]:/chalmers/groups/edu2009/www/www.cse.chalmers.se/year/2019/course/DAT151/
labs-www :
make -C labs index.html
lab% :
make -C labs/$@
mini :
make -C labs/mini
ipl-book :
make -C plt-book/ipl-book
notes :
make -C notes
make -C live
www : index.html
check : all
linkchecker --check-extern index.html
# pip install git+https://github.com/linkchecker/[email protected]
# # Note: this needs txt2tags version 2.6 (python2)
# # version 3.x produces different html (very different look)
# # and dumps a fixed CSS style into the generated html.
# index.html : %.html : %.txt $(deps)
# txt2tags --style=style.css --style=gh-fork-ribbon.css -t html $<
# # --toc;
# sed: Insert <br/> tags if line ends with punctuation.
# Do this via trailing spaces (markdown syntax for line break).
# (This then does no harm if inside code block.)
# Inside Makefile, need to use $$ for eol ($).
index.html : README.md Makefile pandoc.css
sed -e 's#\([.,;:!?]\)$$#\1 #' $< | pandoc --css pandoc.css -f gfm -t html -o $@ --standalone
# --metadata title="Programming Language Technology" ## This also adds a title to the rendering
## Exams
.PHONY: exams
exams : exams.tgz
make -C exams
exams.tgz : exams/*.pdf exams/*.txt exams/*.html exams/*.jpg
tar czf $@ $^
## Testing
.PHONY : test
test :
make -C labs test
## Cleaning
clean : clean_index clean_lab1 clean_lab2 clean_lab3 clean_lab4 clean_mini
clean_index :
rm -f index.html
clean_% :
make clean -C labs/$*
# EOF