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}:
${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}