]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
merge with annasob/0.4
authorDaniel Brooks <db48x@db48x.net>
Tue, 22 Feb 2011 23:13:21 +0000 (17:13 -0600)
committerDaniel Brooks <db48x@db48x.net>
Tue, 22 Feb 2011 23:13:21 +0000 (17:13 -0600)
1  2 
Makefile

diff --cc Makefile
index c1f9f49b5910abc97a6ad90bd5baa16634f2fb57,7420743d397af4ceb46c403216e653d23574dbeb..c820f1d4a51cad11ab36c9170c8c9eb0959a7064
mode 100755,100644..100644
+++ b/Makefile
@@@ -18,7 -21,20 +21,20 @@@ POPCORN_SRC = ${PREFIX}/popcorn.j
  POPCORN_DIST = ${DIST_DIR}/popcorn.js
  POPCORN_MIN = ${DIST_DIR}/popcorn.min.js
  
- all: popcorn min lint lint-plugins
+ # plugins
+ PLUGINS_DIST = ${DIST_DIR}/popcorn.plugins.js
+ PLUGINS_MIN = ${DIST_DIR}/popcorn.plugins.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
++all: lint lint-plugins popcorn plugins min complete
        @@echo "Popcorn build complete."
  
  ${DIST_DIR}:
@@@ -38,20 -50,29 +50,33 @@@ min: ${POPCORN_MIN} ${PLUGINS_MIN} ${PO
  
  ${POPCORN_MIN}: ${POPCORN_DIST}
        @@echo "Building" ${POPCORN_MIN}
+       $(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN})
  
-       @@head -0 ${POPCORN_DIST} > ${POPCORN_MIN}
-       @@${MINJAR} --js ${POPCORN_DIST} --warning_level QUIET --js_output_file ${POPCORN_MIN}.tmp
-       @@cat ${POPCORN_MIN}.tmp >> ${POPCORN_MIN}
-       @@rm -f ${POPCORN_MIN}.tmp      
-       
+ ${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}
+       $(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: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR}
+       @@echo "Building popcorn + plugins"
+       @@cat ${POPCORN_SRC} ${PLUGINS_SRC} > ${POPCORN_COMPLETE_DIST}
  
 -lint: ${POPCORN_DIST}
 +lint:
        @@echo "Checking Popcorn against JSLint..."
 -      @@${RHINO} build/jslint-check.js
 +      @@${RHINO} build/jslint-check.js popcorn.js
 +
 +lint-plugins:
 +      @@echo "Checking all plugins against JSLint..."
 +      @@${RHINO} build/jslint-check.js ${PLUGINS_SRC}
  
  clean:
        @@echo "Removing Distribution directory:" ${DIST_DIR}