]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Review fixes.
authorDavid Humphrey <david.humphrey@senecac.on.ca>
Sat, 19 Feb 2011 23:01:48 +0000 (18:01 -0500)
committerDavid Humphrey <david.humphrey@senecac.on.ca>
Sat, 19 Feb 2011 23:01:48 +0000 (18:01 -0500)
Makefile

index e63e97f043eae35b94aac1d8b71c596e3ee3263f..7420743d397af4ceb46c403216e653d23574dbeb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,9 @@ PLUGINS_DIR = ${PREFIX}/plugins
 RHINO ?= java -jar ${BUILD_DIR}/js.jar
 
 CLOSURE_COMPILER = ${BUILD_DIR}/google-compiler-20100917.jar
+compile = @@${MINJAR} $(1) \
+                           --compilation_level SIMPLE_OPTIMIZATIONS \
+                           --js_output_file $(2)
 
 # minify
 MINJAR ?= java -jar ${CLOSURE_COMPILER}
@@ -22,13 +25,14 @@ POPCORN_MIN = ${DIST_DIR}/popcorn.min.js
 PLUGINS_DIST = ${DIST_DIR}/popcorn.plugins.js
 PLUGINS_MIN = ${DIST_DIR}/popcorn.plugins.min.js
 
-# popcorn + plugins
-POPCORN_COMPLETE_DIST = ${DIST_DIR/popcorn-complete.js
-POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js
-
 # Grab all popcorn.<plugin-name>.js files from plugins dir
 PLUGINS_SRC := $(filter-out %unit.js, $(shell find ${PLUGINS_DIR} -name 'popcorn.*.js' -print))
 
+# popcorn + plugins
+POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done)
+POPCORN_COMPLETE_DIST = ${DIST_DIR}/popcorn-complete.js
+POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js
+
 
 all: lint popcorn plugins min complete
        @@echo "Popcorn build complete."
@@ -42,32 +46,29 @@ ${POPCORN_DIST}: ${POPCORN_SRC} | ${DIST_DIR}
        @@echo "Building" ${POPCORN_DIST}
        @@cp ${POPCORN_SRC} ${POPCORN_DIST}
 
-min: ${POPCORN_MIN} ${PLUGINS_MIN}
+min: ${POPCORN_MIN} ${PLUGINS_MIN} ${POPCORN_COMPLETE_MIN}
 
 ${POPCORN_MIN}: ${POPCORN_DIST}
        @@echo "Building" ${POPCORN_MIN}
-       @@${MINJAR} --js ${POPCORN_DIST} \
-                   --compilation_level SIMPLE_OPTIMIZATIONS \
-                   --js_output_file ${POPCORN_MIN}
+       $(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN})
+
+${POPCORN_COMPLETE_MIN}: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR}
+       @@echo "Building" ${POPCORN_COMPLETE_MIN}
+       @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN})
 
 plugins: ${PLUGINS_DIST}
 
 ${PLUGINS_MIN}: ${PLUGINS_DIST}
        @@echo "Building" ${PLUGINS_MIN}
-       @@${MINJAR} $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) \
-                   --compilation_level SIMPLE_OPTIMIZATIONS \
-                   --js_output_file ${PLUGINS_MIN}
+       $(call compile, $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done), ${PLUGINS_MIN})
 
 ${PLUGINS_DIST}: ${PLUGINS_SRC} ${DIST_DIR}
        @@echo "Building ${PLUGINS_DIST}"
        @@cat ${PLUGINS_SRC} > ${PLUGINS_DIST}
 
-complete: ${DIST_DIR}
+complete: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR}
        @@echo "Building popcorn + plugins"
-       @@${MINJAR} --js ${POPCORN_SRC} \
-                   $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) \
-                   --compilation_level SIMPLE_OPTIMIZATIONS \
-                   --js_output_file ${POPCORN_COMPLETE_MIN}
+       @@cat ${POPCORN_SRC} ${PLUGINS_SRC} > ${POPCORN_COMPLETE_DIST}
 
 lint: ${POPCORN_DIST}
        @@echo "Checking Popcorn against JSLint..."