-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (37 loc) · 1.12 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
MDOCS=$(wildcard content/*.md)
DOCS=$(MDOCS:content/%=%)
HTML=$(DOCS:.md=.html)
PHTML=$(addprefix html/, $(HTML))
MENU=menu
FOOTER=footer
CSS=styles/styles.css
#DEPLOY=${EECS_LOGIN}
DEPLOY=${UT_LOGIN}
#RSYNC=rsync --rsync-path=/usr/sww/bin/rsync
RSYNC=rsync
docs : $(PHTML)
update : $(PHTML)
@echo 'Copying images and files to html/...'
rsync --progress -ua --delete styles html/
rsync --progress -ua --delete images html/
rsync --progress -ua --delete files html/
@echo ' done.'
deploy : update
@echo 'Copying to server...'
# insert code for copying to server here.
chmod -R a+r html/
$(RSYNC) --progress -ua --delete html/ $(DEPLOY)
@echo ' done.'
html/%.html : content/%.md html/$(MENU).html html/$(FOOTER).html $(CSS)
pandoc -V title:"" -s -c $(CSS) -B html/$(MENU).html -A html/$(FOOTER).html -o $@ $<
html/$(MENU).html : helper/$(MENU).md helper/$(MENU).template
pandoc -s --template helper/$(MENU).template --toc -o $@ $<
html/$(FOOTER).html : helper/$(FOOTER).md
pandoc -o $@ $<
clean :
rm -f $(PHTML)
rm -f html/$(MENU).html
rm -f html/$(FOOTER).html
rm -rf html/images
rm -rf html/files
rm -rf html/styles