forked from pandastream/panda_uploader
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·62 lines (49 loc) · 1.8 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
PANDA_UPLOADER_VERSION = 0.8.3
PACKAGE_NAME = panda_uploader
SRC_ROOT = src
SRC_DIR = ${SRC_ROOT}/src
BUILD_DIR = ${SRC_ROOT}/build
TEST_DIR = ${SRC_ROOT}/test
PREFIX = .
DIST_DIR = ${PREFIX}
PANDA_DIST_DIR = ${DIST_DIR}/${PACKAGE_NAME}
PU_TAR = ${DIST_DIR}/${PACKAGE_NAME}.tar.gz
PU_CAT = ${DIST_DIR}/jquery.panda-uploader-${PANDA_UPLOADER_VERSION}.cat.js
PU_MIN = ${PANDA_DIST_DIR}/jquery.panda-uploader-${PANDA_UPLOADER_VERSION}.min.js
PU_SIMPLE = ${SRC_DIR}/jquery.panda-uploader.js
TMP_PU_VERSION = ${SRC_DIR}/jquery.panda-uploader-${PANDA_UPLOADER_VERSION}.js
GENERATED = ${PU_MIN} ${PU_CAT} ${PU_TAR} ${TMP_PU_VERSION}
MINJAR = java -jar ${BUILD_DIR}/google-compiler-20100226.jar
MODULES = ${SRC_DIR}/swfobject.js\
${SRC_DIR}/swfupload.js\
${SRC_DIR}/jquery.swfupload.js\
${SRC_DIR}/jquery.panda-uploader-${PANDA_UPLOADER_VERSION}.js
all: versionize min tar copy_to_test
@@rm -f ${TMP_PU_VERSION}
@@echo "Panda uploader build complete."
debug: ${PU_CAT}
tar: ${PU_TAR}
min: ${PU_MIN}
copy_to_test:
@@rm -rf ${TEST_DIR}/app/public/panda_uploader
@@cp -pr ${PANDA_DIST_DIR} ${TEST_DIR}/app/public/panda_uploader
versionize:
@@echo "Generate version" ${PANDA_UPLOADER_VERSION}
@@echo "// version: ${PANDA_UPLOADER_VERSION}" > ${TMP_PU_VERSION}
@@echo "// name: ${PACKAGE_NAME}" >> ${TMP_PU_VERSION}
@@echo "" >> ${TMP_PU_VERSION}
@@cat ${PU_SIMPLE} >> ${TMP_PU_VERSION}
${PU_TAR}: ${PU_MIN}
@@echo "Packaging as " ${PU_TAR}
@@tar zcf ${PU_TAR} -C ${DIST_DIR} ${PACKAGE_NAME}
${PU_MIN}: ${PU_CAT}
@@echo "Minifying" ${PU_CAT}
@@${MINJAR} --js ${PU_CAT} --warning_level QUIET > ${PU_MIN}
@@echo "Copying minified file to " ${PU_MIN}
@@rm -f ${PU_CAT}
${PU_CAT}: ${PU_SIMPLE}
@@echo "Building" ${PU_CAT}
@@cat ${MODULES} > ${PU_CAT}
clean:
@@echo "Removing Minimized js:" ${GENERATED}
@@rm -f ${GENERATED}