-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (55 loc) · 1.78 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
66
67
68
69
# Packing and minifying of our JavaScript codebase
#
# URL to a minifier:
# http://www.crockford.com/javascript/jsmin.html
#
# Author: Pontus Stenetorp <pontus stenetorp se>
# Version: 2011-07-01
# Path to a JavaScript-Minifier executable
JSMIN_BIN=~/jsmin
CLIENT_DIR=client
CLIENT_SRC_DIR=${CLIENT_DIR}/src
CLIENT_LIB_DIR=${CLIENT_DIR}/lib
# These ones are order dependent
LIB_FILES = ${CLIENT_LIB_DIR}/jquery.min.js \
${CLIENT_LIB_DIR}/jquery-ui.min.js \
${CLIENT_LIB_DIR}/jquery.svg.min.js \
${CLIENT_LIB_DIR}/jquery.svgdom.min.js \
${CLIENT_LIB_DIR}/jquery.ba-bbq.min.js \
${CLIENT_LIB_DIR}/jquery.sprintf.js \
${CLIENT_LIB_DIR}/jquery.json.min.js \
${CLIENT_LIB_DIR}/jquery-ui.min.js
PACKED_LIB=${CLIENT_LIB_DIR}/pack.js
PACKED_LIB_MIN=${CLIENT_LIB_DIR}/pack.min.js
# These ones are order dependent
SRC_FILES = ${CLIENT_SRC_DIR}/util.js \
${CLIENT_SRC_DIR}/dispatcher.js \
${CLIENT_SRC_DIR}/url_monitor.js \
${CLIENT_SRC_DIR}/ajax.js \
${CLIENT_SRC_DIR}/visualizer.js \
${CLIENT_SRC_DIR}/visualizer_ui.js \
${CLIENT_SRC_DIR}/annotator_ui.js \
${CLIENT_SRC_DIR}/spinner.js
PACKED_SRC=${CLIENT_SRC_DIR}/pack.js
PACKED_SRC_MIN=${CLIENT_SRC_DIR}/pack.min.js
.PHONY: all
all: lib src
.PHONY: lib
lib: ${PACKED_LIB} ${PACKED_LIB_MIN}
.PHONY: src
src: ${PACKED_SRC} ${PACKED_SRC_MIN}
${PACKED_LIB}: ${LIB_FILES}
rm -f ${PACKED_LIB}
cat ${LIB_FILES} > ${PACKED_LIB}
${PACKED_LIB_MIN}: ${PACKED_LIB}
rm -f ${PACKED_LIB_MIN}
cat ${PACKED_LIB} | ${JSMIN_BIN} > ${PACKED_LIB_MIN}
${PACKED_SRC}: ${SRC_FILES}
rm -f ${PACKED_SRC}
cat ${SRC_FILES} > ${PACKED_SRC}
${PACKED_SRC_MIN}: ${PACKED_SRC}
rm -f ${PACKED_SRC_MIN}
cat ${PACKED_SRC} | ${JSMIN_BIN} > ${PACKED_SRC_MIN}
.PHONY: clean
clean:
rm -f ${PACKED_LIB} ${PACKED_LIB_MIN} ${PACKED_SRC} ${PACKED_SRC_MIN}