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

Revision 1538, 2.3 kB (checked in by gyuque, 6 years ago)

lang/javascript/javascript-xpath: generate functional test without XMLHttpRequest

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_NOXHR = ${FUNC_TEST_DIR}/index-no-xhr.html
51JSXPATH     = ${DIST_DIR}/javascript-xpath-${VER}.js
52JSXPATH_CMP = ${DIST_DIR}/javascript-xpath-${VER}-cmp.js
53
54all: jsxpath runtest
55        @@echo "JavaScript-XPath build complete"
56
57jsxpath: ${JSXPATH_CMP} ${TESTDATA_LOCALJS} ${FUNCTEST_NOXHR}
58
59${DIST_DIR}:
60        @@mkdir -p $@
61
62${TESTDATA_LOCALJS}:
63        @@sh ${TOOLS_DIR}/make-testdata-string.sh ${RAW_DATAS}
64        @@mv ${TOOLS_DIR}/dtmp.js ${TESTDATA_LOCALJS}
65
66${FUNCTEST_NOXHR}:
67        @@sed -e "s/<!--LOCAL_DATA_HERE-->/<script type=\"text\/javascript\" src=\"\.\/testdatas.js\"><\/script>/g" ${FUNCTEST_ORIGINAL} > ${FUNCTEST_NOXHR}
68
69${JSXPATH}: ${DIST_DIR} ${VERSION_FILE} ${SRC_FILES} Makefile
70        @@echo "Building" $@
71        @@cat ${SRC_FILES} | sed s/@VERSION/${VER}/ > $@
72        @@echo $@ "Built"
73        @@echo ""
74
75${JSXPATH_CMP}: ${JSXPATH}
76        @@echo "Building" $@
77        @@sh ${TOOLS_DIR}/compress.sh ${JSXPATH} $@
78
79runtest:
80        @@${TEST_CMD} ${TEST_FILE} 2> /dev/null || ${TEST_CMD_CYGWIN} ${TEST_FILE} 2> /dev/null || echo "Couldn't process to run '${TEST_CMD}'!"
81
82release: jsxpath
83        @@cp ${JSXPATH} ./release
84        @@cp ${JSXPATH} ./release/javascript-xpath-latest.js
85        @@cp ${JSXPATH_CMP} ./release
86        @@cp ${JSXPATH_CMP} ./release/javascript-xpath-latest-cmp.js
87        @@rm ${DIST_DIR}/*
88
89clean:
90        @@echo "Removing Distribution directory:" ${DIST_DIR}
91        @@rm ${DIST_DIR}/*
92
93
Note: See TracBrowser for help on using the browser.