-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
65 lines (51 loc) · 1.89 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
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
include Makefile.config
CPP=gcc -c -P -E -x c -I. \
-D"QQQ0(w)=\# w" -D"QQQ(w)=QQQ0(w)" \
-DNAME=${NAME} -DDESC=${DESC} \
-DCREATOR=${CREATOR} \
-DHOMEPAGE=${HOMEPAGE} -DVERSION=${VERSION}
export CPP
LIB=Makefile lib/cubehash.js lib/rndphrase.js
ROOT=$(shell pwd)
.PHONY: data/suffix-list.js clean all firefox_addon firefox_install \
conkeror_mode js_ext \
chrome_addon chrome_install www_html
all: firefox_addon chrome_addon conkeror_mode www_html js_ext
clean:
rm -rf work build
data/suffix-list.js:
@./scripts/update-suffixlist.py || true
${WORK}: $(wildcard lib/*)
@rm -rf ${WORK} && mkdir -p ${WORK}
# Build a work dir
${WORK}/%: % data/suffix-list.js ${WORK}
@ rm -rf ${BUILD}/$< && \
mkdir -p $@ && touch $@ && \
cp -r $< work/ && \
for fname in $(shell find $< -type f | grep -e ".*\.\(js\|xul\|rdf\|dtd\|html\|json\)"); do \
${CPP} "$$fname" -o "work/$$fname" 3>/dev/null 2>/dev/null; \
done
# Build an addon (using platform specific build.sh)
${BUILD}/%: %
@mkdir -p $@ && touch $@ && \
cd work/$< && ./build.sh >/dev/null && \
cp -r build/* ${ROOT}/$@
# Firefox
firefox_addon: $(shell find ${FIREFOX} -type f) ${WORK}/${FIREFOX} ${BUILD}/${FIREFOX}
@echo ">> Firefox addon build."
firefox_install: firefox_addon
${FIREFOX_BIN} ${BUILD}/${FIREFOX}/rndphrase.xpi
# Conkeror
conkeror_mode: $(shell find ${CONKEROR} -type f) ${WORK}/${CONKEROR} ${BUILD}/${CONKEROR}
@echo ">> Conkeror page-mode build."
# Generic JavaScript extension
js_ext: $(shell find ${JS_EXT} -type f) ${WORK}/${JS_EXT} ${BUILD}/${JS_EXT}
@echo ">> Generic JavaScript Extension build."
# Chrome
chrome_addon: $(shell find ${CHROME} -type f) ${WORK}/${CHROME} ${BUILD}/${CHROME}
@echo ">> Chrome addon build."
chrome_install: chrome_addon
${CHROME_BIN} ${BUILD}/${CHROME}/rndphrase.crx
# WWW
www_html: $(shell find ${WWW} -type f) ${WORK}/${WWW} ${BUILD}/${WWW}
@echo ">> HTML version build."