forked from datacarpentry/R-ecology-lesson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (26 loc) · 1.02 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
# RMarkdown files
RMD_SRC = $(wildcard *.Rmd)
RMD_DST = $(patsubst %.Rmd,%.md,$(RMD_SRC))
all: pages code-handout.R
skeleton-%.R: %.Rmd _site.yml
Rscript -e "knitr::purl('$<', output='$@', documentation=0L)"
%.html: %.Rmd _site.yml
Rscript -e "rmarkdown::render_site(input='$<')"
%.html: %.md
Rscript -e "rmarkdown::render_site(input='$<')"
code-handout.R: skeleton-00-before-we-start.R skeleton-01-intro-to-r.R skeleton-02-starting-with-data.R skeleton-03-dplyr.R skeleton-04-visualization-ggplot2.R skeleton-05-r-and-databases.R
for f in $^; do cat $$f; echo "\n"; done > $@
make clean-skeleton
pages: 00-before-we-start.html 01-intro-to-r.html 02-starting-with-data.html 03-dplyr.html 04-visualization-ggplot2.html 05-r-and-databases.html index.html LICENSE.html CITATION.html
make clean-md
clean-skeleton:
-rm skeleton-*-*.R
clean-md:
@rm -rf ${RMD_DST}
clean-html:
-rm *-*.html
clean-img:
@find . -path './img/R-ecology-*.png' -exec rm {} \;
clean: clean-skeleton clean-html clean-md clean-img
clean-data:
-rm -rf data