-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (72 loc) · 2.15 KB
/
Makefile
File metadata and controls
93 lines (72 loc) · 2.15 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SOURCE = CSV-SQLite3
ORG = $(SOURCE).org
TEXI = $(SOURCE).texi
INFO = $(SOURCE).info
PDF = $(SOURCE).pdf
DOCS = docs
SCRIPTS=scripts
.PHONY: clean clean-world clean-prod
.PHONY: tangle weave texi info pdf
.PHONY: install install-docs install-info install-pdf open-pdf docs-dir
.PHONY: update-dev update-prod checkout-dev checkout-prod
.PHONY: update-version tangle-update-version run-update-version
texi: $(TEXI)
$(TEXI): $(ORG)
emacs -Q --batch $(ORG) \
--eval '(setq org-export-use-babel nil)' \
--eval '(org-texinfo-export-to-texinfo)'
tangle: $(ORG)
emacs -Q --batch $(ORG) \
--eval '(org-babel-tangle-file "$(ORG)")'
info weave install-info: $(DOCS)/$(INFO)
$(DOCS)/$(INFO): $(TEXI) | docs-dir
makeinfo --output=$(DOCS)/ $(TEXI)
install: package.json
package.json: $(ORG) | docs-dir
emacs -Q --batch $(ORG) \
--eval '(require '\''ob-shell)' \
--eval '(require '\''ob-js)' \
--eval '(setq org-confirm-babel-evaluate nil)' \
--eval '(org-texinfo-export-to-info)'
mv $(INFO) $(DOCS)/
make install-pdf
install-docs: install-info install-pdf
pdf install-pdf: $(DOCS)/$(PDF)
$(DOCS)/$(PDF): $(TEXI) | docs-dir
pdftexi2dvi -q -c $(TEXI)
mv $(PDF) $(DOCS)/
open-pdf: $(DOCS)/$(PDF)
open $(DOCS)/$(PDF)
docs-dir: $(DOCS)
$(DOCS):
mkdir -vp docs
update-version: update-dev update-prod
checkout-dev:
git checkout dev
update-dev: checkout-dev run-update-version
git add -u
git commit --amend -C HEAD
git push origin +dev
checkout-prod: clean-world checkout-dev
git checkout -B prod
update-prod: checkout-prod install clean-prod
git add -A .
git commit -m "Branch:prod"
git push origin +prod
run-update-version: tangle-update-version
./$(SCRIPTS)/update-version.sh
mv -v $(ORG).bak $(WORKBAK)/$(ORG).$(shell date "+%s")
tangle-update-version: $(SCRIPTS)/update-version.sh
$(SCRIPTS)/update-version.sh: $(ORG)
emacs -Q --batch $(ORG) \
--eval '(search-forward ":tangle scripts/update-version.sh")' \
--eval '(org-babel-tangle '\''(4))'
clean:
-rm *~
clean-world: clean
-rm *.{texi,info,pdf,js,json,lock,log,bak}
-rm -rf LogReader
-rm -rf node_modules $(SCRIPTS) $(DOCS)
clean-prod: clean
-rm *.{texi,org} Makefile LogReader
-rm -rf node_modules