Skip to content

Commit 1ea0e7a

Browse files
committed
fix Makefile to deal with missing sass and uglify
This fixes the Makefile so that it does not create bad files if sass or uglify are missing.
1 parent 43dd7f5 commit 1ea0e7a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Makefile

+15-4
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,35 @@ $(JS_FILES): %.js: src/%.ls
3737
manifest ::
3838
perl -pi -e 's/# [A-Z].*\n/# @{[`date`]}/m' manifest.appcache
3939

40-
./node_modules/streamline/bin/_node :
40+
./node_modules/streamline/bin/_node \
41+
./node_modules/uglify-js/bin/uglifyjs :
4142
npm i --dev
4243

4344
static/multi.js :: multi/main.ls multi/styles.styl
4445
webpack --optimize-minimize
4546

4647
depends: app.js static/ethercalc.js static/start.css static/multi.js
4748

48-
static/ethercalc.js: $(ETHERCALC_FILES) ./node_modules/socialcalc/SocialCalc.js
49-
@-mkdir .git
49+
static/ethercalc.js: $(ETHERCALC_FILES) \
50+
./node_modules/socialcalc/SocialCalc.js \
51+
./node_modules/uglify-js/bin/uglifyjs
52+
@-mkdir -p .git
5053
@echo '// Auto-generated from "make depends"; ALL CHANGES HERE WILL BE LOST!' > $@
51-
node node_modules/zappajs/node_modules/.bin/uglifyjs node_modules/socialcalc/SocialCalc.js $(ETHERCALC_FILES) $(UGLIFYJS_ARGS) --source-map ethercalc.js.map --source-map-include-sources >> $@
54+
node node_modules/uglify-js/bin/uglifyjs node_modules/socialcalc/SocialCalc.js $(ETHERCALC_FILES) $(UGLIFYJS_ARGS) --source-map ethercalc.js.map --source-map-include-sources >> $@
5255
mv ethercalc.js.map static
5356

57+
COFFEE := $(shell command -v coffee 2> /dev/null)
5458
.coffee.js:
59+
ifndef COFFEE
60+
$(error "coffee is not available please install sass")
61+
endif
5562
coffee -c $<
5663

64+
SASS := $(shell command -v sass 2> /dev/null)
5765
.sass.css:
66+
ifndef SASS
67+
$(error "sass is not available please install sass")
68+
endif
5869
sass -t compressed $< > $@
5970

6071
clean ::

0 commit comments

Comments
 (0)