-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
37 lines (30 loc) · 1.3 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
# -*- mode: makefile; -*-
EMACS=emacs
BATCH=$(EMACS) --batch --no-init-file \
--eval "(require 'org)" \
--eval "(org-babel-do-load-languages 'org-babel-load-languages \
'((sh . t)))" \
--eval "(setq org-babel-use-quick-and-dirty-noweb-expansion t)" \
--eval "(setq org-confirm-babel-evaluate nil)" \
--eval "(setq c-standard-font-lock-fontify-region-function 'font-lock-default-fontify-region)" \
--eval '(org-babel-load-file "./README.org")' \
--eval '(org-babel-tangle-file "./README.org")' \
SUBDIRS_ALL = lectures td slides
all: html
html:
@echo "NOTICE: Generating html documentation..."
@$(BATCH) --visit "README.org" --funcall org-publish-cpp > /dev/null 2>&1
@rm -f README.el *.sty
@find doc -name *.*~ | xargs rm -f
publish: html
@tar czvf /tmp/org-cpp-publish.tar.gz index.html doc
@git checkout gh-pages
@tar xzvf /tmp/org-cpp-publish.tar.gz
@if [ -n "`git status --porcelain`" ]; then git commit -am "update doc" && git push; fi
@git checkout master
pdf:
@for dir in $(SUBDIRS_ALL); do $(MAKE) -C $$dir || exit $$?; done
clean:
@rm -rf doc index.html
clean-all: clean
@for dir in $(SUBDIRS_ALL); do $(MAKE) -C $$dir clean || exit $$?; done