-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
32 lines (24 loc) · 862 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
HTML_FILES := $(patsubst %.Rmd, %.html ,$(wildcard docs/*.Rmd))
HTML_FILES := $(filter-out docs/_sessionInfo.html, $(HTML_FILES))
R_FILES := $(patsubst %.R, docs/%.html, $(wildcard Part*.R))
.PHONY: all
all : cleanjunk html
.PHONY : html
html : docs/index.html docs/data.html $(HTML_FILES) $(R_FILES)
docs/index.Rmd : README.md
sed '1d;2d;6d' $< > $@ # remove first, second, and sixth lines
docs/data.Rmd : data/README.md
cat docs/data.txt $< > $@
docs/%.Rmd : %.R docs/knitopts.R
cat docs/knitopts.R $< | sed "s_^\# _\#\' _" > docs/$<
R --slave -e "knitr::spin('docs/$<', knit = FALSE)"
$(RM) docs/$<
%.html : %.Rmd docs/footer.html docs/_site.yml docs/styles.css
R --slave -e "rmarkdown::render_site('$<')"
.PHONY : clean
clean :
$(RM) $(R_FILES)
R --slave -e "rmarkdown::clean_site('docs')"
.PHONY : cleanjunk
cleanjunk :
$(RM) -r results/