-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (29 loc) · 1.11 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
mkdir := mkdir -p
rm := rm -rf
m4 := m4 --prefix-builtins
closure := closure
sed := sed
preprocessor_comment := \/\/:
SRC := src/nabtext.core.js src/binaryfile.js src/parsers/*.js
SRC_LIB := $(SRC) src/nabtext.js
SRC_JQUERY := $(SRC) src/jquery.nabtext.js
LIB := dist/nabtext.js dist/nabtext.mo.js dist/nabtext.po.js
LIB_MINIFIED := dist/nabtext.min.js dist/nabtext.mo.min.js dist/nabtext.po.min.js
JQUERY_LIB := dist/jquery.nabtext.js dist/jquery.nabtext.mo.js dist/jquery.nabtext.po.js
JQUERY_LIB_MINIFIED := dist/jquery.nabtext.min.js dist/jquery.nabtext.mo.min.js dist/jquery.nabtext.po.min.js
.PHONY: default
default: $(LIB)
.PHONY: minified
minified: $(LIB_MINIFIED)
dist:
$(mkdir) $@
dist/nabtext.js: PARSE_INCLUDE := -D MO_PARSER -D PO_PARSER
dist/nabtext.mo.js: PARSE_INCLUDE := -D MO_PARSER
dist/nabtext.po.js: PARSE_INCLUDE := -D PO_PARSER
$(LIB): dist $(SRC_LIB)
$(m4) $(PARSE_INCLUDE) -I src src/nabtext.js | $(sed) -e 's/$(preprocessor_comment)//g' > $@
$(LIB_MINIFIED): %.min.js: %.js
$(closure) --js $< --js_output_file $@
.PHONY: clean
clean:
$(rm) dist