-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathMakefile
38 lines (29 loc) · 991 Bytes
/
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
WORKDIR=$()
SRC=index.Rmd install.Rmd before.Rmd material.Rmd after.Rmd teacher.Rmd individual-tracking.Rmd teacher-tracking.Rmd account-sync.Rmd
define md2html
cat chunks/header.md > $(1).tmp
cat $(1) >> $(1).tmp
cat chunks/footer.md >> $(1).tmp
mv $(1).tmp $(1)
endef
all : $(SRC:.Rmd=.html) thanks.html
$(MAKE) -C slide
rsync -avx node_modules/markdown2bootstrap/bootstrap .
.check_wiki :
cd wiki && git pull origin master
thanks.md : wiki/感謝清單.md .check_wiki
cat chunks/header.md > [email protected]
cat $< >> [email protected]
cat chunks/footer.md >> [email protected]
mv [email protected] $@
individual-tracking.md : individual-tracking.Rmd chunks/header.md chunks/footer.md chunks/login.md
Rscript -e "knitr::knit('$<', '$@')"
$(call md2html,$@)
%.md : %.Rmd chunks/header.md chunks/footer.md
Rscript -e "knitr::knit('$<', '$@')"
$(call md2html,$@)
%.html : %.md nav.js
node_modules/.bin/markdown2bootstrap -h --nav=$(CURDIR)/nav.js $<
.PHONY : clean .check_wiki
clean :
-rm $(SRC:.Rmd=.html)