source: trunk/Makefile @ 580

Revision 580, 2.3 KB checked in by jf.hovinne, 3 years ago (diff)

Updated Makefile to output minified JS. See #143.

Line 
1SRC_DIR = src
2BUILD_DIR = build
3
4JS_FILES = ${SRC_DIR}/wymeditor/jquery.wymeditor.js\
5 ${SRC_DIR}/wymeditor/jquery.wymeditor.explorer.js\
6 ${SRC_DIR}/wymeditor/jquery.wymeditor.mozilla.js\
7 ${SRC_DIR}/wymeditor/jquery.wymeditor.opera.js\
8 ${SRC_DIR}/wymeditor/jquery.wymeditor.safari.js
9
10WE = ${BUILD_DIR}/build/jquery.wymeditor.js
11WE_PACK = ${BUILD_DIR}/build/jquery.wymeditor.pack.js
12WE_MIN = ${BUILD_DIR}/build/jquery.wymeditor.min.js
13WE_ARCH = ${BUILD_DIR}/build/wymeditor.tar.gz
14
15FE = ${BUILD_DIR}/build/fireeditor.xpi
16
17MERGE = cat ${JS_FILES} | perl -pe 's/^\xEF\xBB\xBF//g' > ${WE}
18WE_PACKER = perl -I${BUILD_DIR}/packer ${BUILD_DIR}/packer/jsPacker.pl -i ${WE} -o ${WE_PACK} -e62 -f
19WE_MINIFIER = java -jar ${BUILD_DIR}/minifier/yuicompressor-2.4.2.jar ${WE} > ${WE_MIN}
20
21all: archive
22
23wymeditor:
24        @@echo "Building" ${WE}
25
26        @@echo " - Merging files"
27        @@${MERGE}
28
29        @@echo ${WE} "Built"
30        @@echo
31
32pack: wymeditor
33        @@echo "Building" ${WE_PACK}
34
35        @@echo " - Compressing using Packer"
36        @@${WE_PACKER}
37       
38        @@echo ${WE_PACK} "Built"
39        @@echo
40
41min: wymeditor
42        @@echo "Building" ${WE_MIN}
43
44        @@echo " - Compressing using Minifier"
45        @@${WE_MINIFIER}
46       
47        @@echo ${WE_MIN} "Built"
48        @@echo
49
50archive: pack min
51        @@echo "Building" ${WE_ARCH}
52
53        @@echo " - Creating archive"
54        @@mkdir ${BUILD_DIR}/build/wymeditor/
55        @@cp -pR ${SRC_DIR}/wymeditor ${BUILD_DIR}/build/wymeditor/
56        @@rm ${BUILD_DIR}/build/wymeditor/wymeditor/*.js
57        @@cp ${WE} ${WE_PACK} ${WE_MIN} ${BUILD_DIR}/build/wymeditor/wymeditor/
58        @@cp -pR ${SRC_DIR}/*.txt ${SRC_DIR}/README ${BUILD_DIR}/build/wymeditor/
59        @@cp -pR ${SRC_DIR}/examples ${BUILD_DIR}/build/wymeditor/
60        @@cp -pR ${SRC_DIR}/jquery ${BUILD_DIR}/build/wymeditor/
61        @@tar -C ${BUILD_DIR}/build -czf ${WE_ARCH} --exclude '.svn' wymeditor
62        @@rm -rf ${BUILD_DIR}/build/wymeditor/
63        @@rm -rf ${BUILD_DIR}/build/examples/
64        @@rm -rf ${BUILD_DIR}/build/jquery/
65       
66        @@echo ${WE_ARCH} "Built"
67        @@echo
68
69fireeditor: archive
70        @@echo "Building " ${FE}
71       
72        @@cp ${WE_ARCH} ${SRC_DIR}/apps/fireeditor/content/
73        @@tar -C ${SRC_DIR}/apps/fireeditor/content -xzf ${SRC_DIR}/apps/fireeditor/content/wymeditor.tar.gz
74        @@rm ${SRC_DIR}/apps/fireeditor/content/wymeditor.tar.gz
75        @@cd ${SRC_DIR}/apps/fireeditor/; zip -r -q ../../../${FE} *
76        @@rm -rf ${SRC_DIR}/apps/fireeditor/content/wymeditor/
77        @@echo "Fire Editor built"
78        @@echo
Note: See TracBrowser for help on using the repository browser.