forked from mir3z/texthighlighter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (37 loc) · 1013 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
41
42
43
44
45
46
47
48
49
50
51
SRC_PATH = src
LIB_PATH = lib
EXT_DIR = ext
TEST_DIR = test
HL_SRC = $(SRC_PATH)/jquery.textHighlighter.js
RANGY_SRC = $(LIB_PATH)/rangy-core.js
HL_MIN = $(HL_SRC:.js=.min.js)
HL_PACK_MIN = $(HL_SRC:.js=.pack.min.js)
CLOSURE_COMPILER = compiler.jar
CC_PATH = $(EXT_DIR)/$(CLOSURE_COMPILER)
TARGETS = $(HL_MIN) $(HL_PACK_MIN)
BROWSER = firefox
JSHINT_CONFIG = jshint-config.json
JSHINT_BIN = jshint
all: $(TARGETS)
$(HL_MIN): $(HL_SRC)
java -jar $(CC_PATH) \
--js $^ \
--js_output_file $@
$(HL_PACK_MIN): $(HL_SRC) $(RANGY_SRC)
java -jar $(CC_PATH) \
--js $^ \
--js_output_file $@
clean:
rm $(TARGETS)
coverage:
@./coverage.sh
jshint: jshint_presence
@echo "Running JSHint...\n"
@${JSHINT_BIN} ${HL_SRC} --config ${JSHINT_CONFIG}
@echo "Congratulation!"
jshint_presence:
@type ${JSHINT_BIN} >/dev/null 2>&1 \
|| { echo >&2 "I require ${JSHINT_BIN} but it's not installed. Aborting."; exit 1; }
test:
${BROWSER} ${TEST_DIR}/*.html
.PHONY: test all clean coverage js_hint js_hint_presence