Preparing for June 2016 release
[rnaseq-cwl-training.git] / Makefile
1 ## ========================================
2 ## Commands for both workshop and lesson websites.
3
4 # Settings
5 MAKEFILES=Makefile $(wildcard *.mk)
6 JEKYLL=jekyll
7 DST=_site
8
9 # Controls
10 .PHONY : commands clean files
11 all : commands
12
13 ## commands       : show all commands.
14 commands :
15         @grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
16
17 ## serve          : run a local server.
18 serve :
19         ${JEKYLL} serve --config _config.yml,_config_dev.yml
20
21 ## site           : build files but do not run a server.
22 site :
23         ${JEKYLL} build --config _config.yml,_config_dev.yml
24
25 ## figures        : re-generate inclusion displaying all figures.
26 figures :
27         @bin/extract_figures.py -s _episodes -p bin/markdown-ast.rb > _includes/all_figures.html
28
29 ## clean          : clean up junk files.
30 clean :
31         @rm -rf ${DST}
32         @rm -rf .sass-cache
33         @rm -rf bin/__pycache__
34         @find . -name .DS_Store -exec rm {} \;
35         @find . -name '*~' -exec rm {} \;
36         @find . -name '*.pyc' -exec rm {} \;
37
38 ## ----------------------------------------
39 ## Commands specific to workshop websites.
40
41 .PHONY : workshop-check
42
43 ## workshop-check : check workshop homepage.
44 workshop-check :
45         @bin/workshop_check.py .
46
47 ## ----------------------------------------
48 ## Commands specific to lesson websites.
49
50 .PHONY : lesson-check lesson-files lesson-fixme lesson-single
51
52 # Lesson source files in the order they appear in the navigation menu.
53 SRC_FILES = \
54   index.md \
55   CONDUCT.md \
56   setup.md \
57   $(wildcard _episodes/*.md) \
58   reference.md \
59   $(wildcard _extras/*.md) \
60   LICENSE.md
61
62 # Generated lesson files in the order they appear in the navigation menu.
63 HTML_FILES = \
64   ${DST}/index.html \
65   ${DST}/conduct/index.html \
66   ${DST}/setup/index.html \
67   $(patsubst _episodes/%.md,${DST}/%/index.html,$(wildcard _episodes/*.md)) \
68   ${DST}/reference/index.html \
69   $(patsubst _extras/%.md,${DST}/%/index.html,$(wildcard _extras/*.md)) \
70   ${DST}/license/index.html
71
72 ## lesson-check   : validate lesson Markdown.
73 lesson-check :
74         @bin/lesson_check.py -s . -p bin/markdown-ast.rb
75
76 unittest :
77         python bin/test_lesson_check.py
78
79 ## lesson-files   : show expected names of generated files for debugging.
80 lesson-files :
81         @echo 'source:' ${SRC_FILES}
82         @echo 'generated:' ${HTML_FILES}
83
84 ## lesson-fixme   : show FIXME markers embedded in source files.
85 lesson-fixme :
86         @fgrep -i -n FIXME ${SRC_FILES} || true
87
88 #-------------------------------------------------------------------------------
89 # Include extra commands if available.
90 #-------------------------------------------------------------------------------
91
92 -include commands.mk