From 1596e91887b42816dae412c77e17d2979e2e4cd4 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 2 Mar 2014 18:14:56 -0500 Subject: bleh --- Makefile | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 696fb2f..fd708a2 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ WEBPMUX ?= webpmux CONVERT ?= convert APNGASM ?= apngasm NPM ?= npm -UGLIFYJS ?= node_modules/.bin/uglifyjs +UGLIFYJS := node_modules/.bin/uglifyjs ifndef MINIMAL ZOPFLIPNG ?= zopflipng DEFLOPT ?= wine DeflOpt @@ -150,35 +150,40 @@ JSDATA := www/js/play.js www/js/images.js JS := $(JSLIBS) $(MYJS) $(JSDATA) JSOUT := www/js/all.min.js -Modernizr/dist/modernizr-build.js: Modernizr - ln -fs ../../config-all.json Modernizr/lib/config-all.json - cd Modernizr && $(NPM) update && node_modules/.bin/grunt build +Modernizr/dist/modernizr-build.js: Modernizr config-all.json + ln -fs ../../config-all.json "$<"/lib/config-all.json + cd "$<" && $(NPM) update && node_modules/.bin/grunt build when/build/when.js: when export PYTHON=python2; cd when && $(NPM) update && $(NPM) run browserify-debug js: $(JSOUT) -$(JSOUT): $(JS) # note that packr doesn't actually work +ifndef PACKR +ifndef CLOSURE_COMPILER +$(JSOUT): $(JS) $(UGLIFYJS) +else +$(JSOUT): $(JS) +endif +endif ifdef PACKR $(PACKR) $^ -o "$@" else ifdef CLOSURE_COMPILER $(CLOSURE_COMPILER) --compilation_level SIMPLE_OPTIMIZATIONS --create_source_map "$@".map --js $(subst $(SPACE), --js ,$^) --js_output_file "$@" else - $(NPM) update $(UGLIFYJS) $^ -o "$@" --source-map "$@".map --source-map-url ./all.min.js.map --screw-ie8 -p 2 -m -c unsafe=true,drop_debugger=false endif endif -# === MISC === +$(UGLIFYJS): package.json + $(NPM) update -clean: - $(RM) $(CVIDEO) $(CAUDIO) $(CIMAGE) +# === MISC === jshint: $(MYJS) - jshint $^ + jshint --show-non-errors $^ space: $(RM) -r $(DUMP)/font -- cgit v1.2.3-70-g09d2