Skip to content

Instantly share code, notes, and snippets.

@atelierbram
Forked from pwenzel/Makefile
Last active August 29, 2015 14:17
Show Gist options
  • Save atelierbram/b15ec843563ecb2bcdba to your computer and use it in GitHub Desktop.
Save atelierbram/b15ec843563ecb2bcdba to your computer and use it in GitHub Desktop.
# 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
@atelierbram
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment