1 | SRC_DIR = src |
---|
2 | BUILD_DIR = build |
---|
3 | |
---|
4 | JS_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 | |
---|
10 | WE = ${BUILD_DIR}/build/jquery.wymeditor.js |
---|
11 | WE_PACK = ${BUILD_DIR}/build/jquery.wymeditor.pack.js |
---|
12 | WE_MIN = ${BUILD_DIR}/build/jquery.wymeditor.min.js |
---|
13 | WE_ARCH = ${BUILD_DIR}/build/wymeditor.tar.gz |
---|
14 | |
---|
15 | FE = ${BUILD_DIR}/build/fireeditor.xpi |
---|
16 | |
---|
17 | MERGE = cat ${JS_FILES} | perl -pe 's/^\xEF\xBB\xBF//g' > ${WE} |
---|
18 | WE_PACKER = perl -I${BUILD_DIR}/packer ${BUILD_DIR}/packer/jsPacker.pl -i ${WE} -o ${WE_PACK} -e62 -f |
---|
19 | WE_MINIFIER = java -jar ${BUILD_DIR}/minifier/yuicompressor-2.4.2.jar ${WE} > ${WE_MIN} |
---|
20 | |
---|
21 | all: archive |
---|
22 | |
---|
23 | wymeditor: |
---|
24 | @@echo "Building" ${WE} |
---|
25 | |
---|
26 | @@echo " - Merging files" |
---|
27 | @@${MERGE} |
---|
28 | |
---|
29 | @@echo ${WE} "Built" |
---|
30 | @@echo |
---|
31 | |
---|
32 | pack: wymeditor |
---|
33 | @@echo "Building" ${WE_PACK} |
---|
34 | |
---|
35 | @@echo " - Compressing using Packer" |
---|
36 | @@${WE_PACKER} |
---|
37 | |
---|
38 | @@echo ${WE_PACK} "Built" |
---|
39 | @@echo |
---|
40 | |
---|
41 | min: wymeditor |
---|
42 | @@echo "Building" ${WE_MIN} |
---|
43 | |
---|
44 | @@echo " - Compressing using Minifier" |
---|
45 | @@${WE_MINIFIER} |
---|
46 | |
---|
47 | @@echo ${WE_MIN} "Built" |
---|
48 | @@echo |
---|
49 | |
---|
50 | archive: 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 | |
---|
69 | fireeditor: 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 |
---|