/
Makefile
39 lines (29 loc) · 971 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
HTML_FILES := $(patsubst %.Rmd, %.html ,$(wildcard *.Rmd)) \
$(patsubst %.md, %.html ,$(wildcard *.md)) \
$(patsubst %.Rmd, %.html ,$(wildcard distance/*.Rmd)) \
$(patsubst %.md, %.html ,$(wildcard distance/*.md)) \
$(patsubst %.Rmd, %.html ,$(wildcard dsm/*.Rmd)) \
$(patsubst %.md, %.html ,$(wildcard dsm/*.md))
graphics_dirs := $(wildcard distance/*_files) \
$(wildcard dsm/*_files)
all: html graphics
# build the HTML files and move them into the site directory
html: $(HTML_FILES)
%.html: %.Rmd
R --vanilla --slave -e "rmarkdown::render('$<')"
# mv $@ site/
cp $@ site/
%.html: %.md
R --vanilla --slave -e "rmarkdown::render('$<')"
# mv $@ site/
cp $@ site/
## move the folders with graphics
graphics: $(graphics_dirs)
%_files: %.html
cp -R $@ site/
# need to do something with libs that has the css/styles
#libs: libs/*
# mv libs site/
.PHONY: clean
clean:
rm -rf site/*.html