forked from RickMoynihan/org-info-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 977 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
39
40
YUI=~/bin/yuicompressor-2.4.2.jar
MINIFY_OTPIONS= --preserve-semi --line-break 80
VERSION = `grep -e '\* Version: *[0-9.]' org-info-src.js | cut -sd ':' -f 2-`
TMPv = tmp-version.js
TMPs = tmp-min.js
TMPd = tmp-Doxyfile
all: minify
minify: version sed.txt
@if [ -f $(TMPv) ] && [ -f $(TMPs) ]; then \
sed -f sed.txt $(TMPv) > $(TMPs); \
java -jar $(YUI) $(MINIFY_OTPIONS) $(TMPs) > org-info.js; \
rm $(TMPv); \
rm $(TMPs); \
echo "org-info.js successfully built."; \
else \
echo "Failed to build. $(TMPv) and/or $(TMPs) are missing!"; \
fi
version:
@if [ -f $(TMPv) ] || [ -f $(TMPs) ]; then \
echo "$(TMPv) and/or $(TMPs) exist. Please remove them or adjust the Makefile!"; \
else \
sed -e "s/###VERSION###/$(VERSION)/g" org-info-src.js > $(TMPv); \
touch $(TMPs); \
fi
doc:
sed -e "s/###VERSION###/$(VERSION)/g" Doxyfile > $(TMPd); \
doxygen $(TMPd)
rm $(TMPd)
clean:
@rm -f $(TMPv) $(TMPs)
@echo "Temporary files removed."