Skip to content

Instantly share code, notes, and snippets.

@simenbrekken
Created November 9, 2012 11:17
Show Gist options
  • Select an option

  • Save simenbrekken/4045202 to your computer and use it in GitHub Desktop.

Select an option

Save simenbrekken/4045202 to your computer and use it in GitHub Desktop.
Makefile extraordinaire
STYLUS = node_modules/.bin/stylus
COFFEE = node_modules/.bin/coffee
UGLIFY = node_modules/.bin/uglifyjs
SPRITER = node_modules/.bin/spriter
RETINA = node_modules/.bin/retina
SCRIPTS = $(shell find src/scripts -name "*.coffee")
STYLES = $(shell find src/styles -name "*.styl")
SPRITES = $(shell find css/images/generated/sprites -name "*.png")
all: css js
css: lib/app.css $(STYLES)
js: lib/vendor-head.js lib/vendor.js lib/app.js $(SCRIPTS)
dist: lib/vendor-head.min.js lib/vendor.min.js lib/app.min.js lib/app.min.css
lib/%.js: src/scripts/%.coffee
$(COFFEE) -bc $< > $@
lib/%.min.js: lib/%.js
$(UGLIFY) -nc $< > $@
lib/%.css: src/styles/%.styl
$(STYLUS) < $< > $@
lib/%.min.css: lib/%.css
$(STYLUS) -c < $< > $@
# $(RETINA) $< > $@
# $(SPRITER) $< > $@
optipng -o7 -quiet $(SPRITES)
advdef -z -4 -q $(SPRITES)
lib/vendor.js: \
vendor/jquery-1.8.2.js
cat $^ > $@
lib/vendor-head.js: \
vendor/modernizr-2.6.2.js \
cat $^ > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment