[go: up one dir, main page]

Skip to content

Commit

Permalink
Merge pull request #526 from joequant/fix-makefile
Browse files Browse the repository at this point in the history
fix Makefile to deal with missing sass and uglify
  • Loading branch information
eddyparkinson committed Jun 29, 2017
2 parents 43dd7f5 + 1ea0e7a commit 9fa1663
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,35 @@ $(JS_FILES): %.js: src/%.ls
manifest ::
perl -pi -e 's/# [A-Z].*\n/# @{[`date`]}/m' manifest.appcache

./node_modules/streamline/bin/_node :
./node_modules/streamline/bin/_node \
./node_modules/uglify-js/bin/uglifyjs :
npm i --dev

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

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

static/ethercalc.js: $(ETHERCALC_FILES) ./node_modules/socialcalc/SocialCalc.js
@-mkdir .git
static/ethercalc.js: $(ETHERCALC_FILES) \
./node_modules/socialcalc/SocialCalc.js \
./node_modules/uglify-js/bin/uglifyjs
@-mkdir -p .git
@echo '// Auto-generated from "make depends"; ALL CHANGES HERE WILL BE LOST!' > $@
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 >> $@
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 >> $@
mv ethercalc.js.map static

COFFEE := $(shell command -v coffee 2> /dev/null)
.coffee.js:
ifndef COFFEE
$(error "coffee is not available please install sass")
endif
coffee -c $<

SASS := $(shell command -v sass 2> /dev/null)
.sass.css:
ifndef SASS
$(error "sass is not available please install sass")
endif
sass -t compressed $< > $@

clean ::
Expand Down

0 comments on commit 9fa1663

Please sign in to comment.