Skip to content

Commit

Permalink
Add smoosh dependencies to Makefile
Browse files Browse the repository at this point in the history
Setting the SMOOSH variable to the path of the binary allows us a
shorthand reference for use in a rule, listing as a dependency, and even
defining a target.

I've added a target so that if smoosh isn't there, make will actually
trigger NPM.

Then every target that used smoosh was changed over to use the $(SMOOSH)
variable (No more $PATH problem!) and given smoosh as a dependency.
  • Loading branch information
fresham committed Apr 3, 2014
1 parent 5a8e2f7 commit 588e129
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Makefile
@@ -1,36 +1,41 @@
SMOOSH = ./node_modules/.bin/smoosh

all: test flotr2

$(SMOOSH):
npm install

test:
cd spec; jasmine-headless-webkit -j jasmine.yml -c

libraries:
smoosh make/lib.json
libraries: $(SMOOSH)
$(SMOOSH) make/lib.json
cat ./build/bean.js > build/lib.js
cat ./build/underscore.js >> build/lib.js
cat ./build/bean.min.js > build/lib.min.js
echo ";" >> build/lib.min.js
cat ./build/underscore.min.js >> build/lib.min.js
echo ";" >> build/lib.min.js

ie:
smoosh make/ie.json
ie: $(SMOOSH)
$(SMOOSH) make/ie.json

flotr2: libraries ie
smoosh make/flotr2.json
flotr2: libraries ie $(SMOOSH)
$(SMOOSH) make/flotr2.json
cat build/lib.js build/flotr2.js > flotr2.js
cat build/lib.min.js > flotr2.min.js
cat build/flotr2.min.js >> flotr2.min.js
echo ';' >> flotr2.min.js
cp build/ie.min.js flotr2.ie.min.js
cat build/flotr2.js > flotr2.nolibs.js

flotr2-basic: libraries ie
smoosh make/basic.json
flotr2-basic: libraries ie $(SMOOSH)
$(SMOOSH) make/basic.json
cat build/lib.min.js > flotr2-basic.min.js
cat build/flotr2-basic.min.js >> flotr2-basic.min.js

flotr-examples:
smoosh make/examples.json
flotr-examples: $(SMOOSH)
$(SMOOSH) make/examples.json
cp build/examples.min.js flotr2.examples.min.js
cp build/examples-types.js flotr2.examples.types.js

Expand Down

0 comments on commit 588e129

Please sign in to comment.