root/lang/javascript/javascript-xpath/trunk/Makefile @ 1591

Revision 1591, 2.6 kB (checked in by gyuque, 6 years ago)

lang/javascript/javascript-xpath: generate non-XHR ver. of analyzing test

Line 
1PREFIX = .
2
3SRC_DIR = src
4
5TEST_DIR = ${PREFIX}/test
6FUNC_TEST_DIR = ${TEST_DIR}/functional
7FUNC_TEST_DATA_DIR = ${FUNC_TEST_DIR}/data
8RAW_DATAS = $(wildcard ${FUNC_TEST_DATA_DIR}/0*)
9
10DIST_DIR = ${PREFIX}/dist
11
12RELEASE_DIR = ${PREFIX}/release
13
14TOOLS_DIR = ${PREFIX}/tools
15
16TEST_CMD = open
17TEST_CMD_CYGWIN = sh ${TOOLS_DIR}/open.sh
18
19SRC_FILES = ${SRC_DIR}/head.js\
20        ${SRC_DIR}/config.js\
21        ${SRC_DIR}/global_decls.js\
22        ${SRC_DIR}/uai.js\
23        ${SRC_DIR}/lexer.js\
24        ${SRC_DIR}/ctx.js\
25        ${SRC_DIR}/baseExpr.js\
26        ${SRC_DIR}/binaryExpr.js\
27        ${SRC_DIR}/unaryExpr.js\
28        ${SRC_DIR}/unionExpr.js\
29        ${SRC_DIR}/pathExpr.js\
30        ${SRC_DIR}/filterExpr.js\
31        ${SRC_DIR}/stepExpr.js\
32        ${SRC_DIR}/nodeType.js\
33        ${SRC_DIR}/nameTest.js\
34        ${SRC_DIR}/variableReference.js\
35        ${SRC_DIR}/literal.js\
36        ${SRC_DIR}/number.js\
37        ${SRC_DIR}/functionCall.js\
38        ${SRC_DIR}/nodeSet.js\
39        ${SRC_DIR}/api.js\
40        ${SRC_DIR}/foot.js
41
42TEST_FILE = ${TEST_DIR}/index.html
43
44VERSION_FILE = version.txt
45
46VER = ${shell cat ${VERSION_FILE}}
47
48TESTDATA_LOCALJS = ${FUNC_TEST_DIR}/testdatas.js
49FUNCTEST_ORIGINAL = ${FUNC_TEST_DIR}/index.html
50FUNCTEST_ANALYZE = ${FUNC_TEST_DIR}/analyze-test.html
51
52FUNCTEST_NOXHR = ${FUNC_TEST_DIR}/index-no-xhr.html
53FUNCTEST_ANALYZE_NOXHR = ${FUNC_TEST_DIR}/analyze-test-no-xhr.html
54
55JSXPATH     = ${DIST_DIR}/javascript-xpath-${VER}.js
56JSXPATH_CMP = ${DIST_DIR}/javascript-xpath-${VER}-cmp.js
57
58all: jsxpath runtest
59        @@echo "JavaScript-XPath build complete"
60
61jsxpath: ${JSXPATH_CMP} ${TESTDATA_LOCALJS} ${FUNCTEST_NOXHR} ${FUNCTEST_ANALYZE_NOXHR}
62
63${DIST_DIR}:
64        @@mkdir -p $@
65
66${TESTDATA_LOCALJS}:
67        @@sh ${TOOLS_DIR}/make-testdata-string.sh ${RAW_DATAS}
68        @@mv ${TOOLS_DIR}/dtmp.js ${TESTDATA_LOCALJS}
69
70${FUNCTEST_NOXHR}:
71        @@sed -e "s/<!--LOCAL_DATA_HERE-->/<script type=\"text\/javascript\" src=\"\.\/testdatas.js\"><\/script>/g" ${FUNCTEST_ORIGINAL} > $@
72
73${FUNCTEST_ANALYZE_NOXHR}:
74        @@sed -e "s/<!--LOCAL_DATA_HERE-->/<script type=\"text\/javascript\" src=\"\.\/testdatas.js\"><\/script>/g" ${FUNCTEST_ANALYZE} > $@
75
76${JSXPATH}: ${DIST_DIR} ${VERSION_FILE} ${SRC_FILES} Makefile
77        @@echo "Building" $@
78        @@cat ${SRC_FILES} | sed s/@VERSION/${VER}/ > $@
79        @@echo $@ "Built"
80        @@echo ""
81
82${JSXPATH_CMP}: ${JSXPATH}
83        @@echo "Building" $@
84        @@sh ${TOOLS_DIR}/compress.sh ${JSXPATH} $@
85
86runtest:
87        @@${TEST_CMD} ${TEST_FILE} 2> /dev/null || ${TEST_CMD_CYGWIN} ${TEST_FILE} 2> /dev/null || echo "Couldn't process to run '${TEST_CMD}'!"
88
89release: jsxpath
90        @@cp ${JSXPATH} ./release
91        @@cp ${JSXPATH} ./release/javascript-xpath-latest.js
92        @@cp ${JSXPATH_CMP} ./release
93        @@cp ${JSXPATH_CMP} ./release/javascript-xpath-latest-cmp.js
94        @@rm ${DIST_DIR}/*
95
96clean:
97        @@echo "Removing Distribution directory:" ${DIST_DIR}
98        @@rm ${DIST_DIR}/*
99
100
Note: See TracBrowser for help on using the browser.