Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created February 6, 2014 17:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pwenzel/8848476 to your computer and use it in GitHub Desktop.
Save pwenzel/8848476 to your computer and use it in GitHub Desktop.
This gist accompanies https://github.com/pwenzel/fswatch-makefile. It shows how one might build a tiny build system for a website using a Makefile.
# Example Makefile for compiling CSS and Javascript in watched folder
PHONY: optimize
css:
@cat assets/css/normalize.css assets/css/app.css > public/assets/all.css
@echo Built all.css
js:
@cat assets/js/jquery.js assets/js/jquery.cookie.js assets/js/app.js > public/assets/all.js
@echo Built all.js
watch:
@echo Watching for changes...
@fswatch assets/css:assets/js "echo changed && make css js"
optimize: css js
@yuicompressor assets/all.css -o assets/all.css
@yuicompressor assets/all.js -o assets/all.js
@echo Optimized all.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment