Created
December 8, 2011 17:22
-
-
Save wilsonpage/1447701 to your computer and use it in GitHub Desktop.
My first Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#======================================== | |
# Static Asset Build Makefile | |
# | |
# Author: Wilson Page | |
#======================================== | |
# Shortcuts | |
build-tools = build/tools/ | |
css-dir = static/css/ | |
css-target = $(css-dir)style-built.css | |
css-files = $(css-dir)*.less | |
js-dir = static/js/ | |
js-target = $(js-dir)script-built.js | |
js-files = $(js-dir)*.js | |
google-cc-jar = $(build-tools)google-cc.jar | |
# This is done when we type 'make' | |
all: clean $(css-target) $(js-target) | |
# CSS Compilation | |
$(css-target): $(css-files) | |
@rm -f $(css-target) | |
@echo "Merging LESS files..." | |
@cat $(css-files) > $(css-dir)style.tmp | |
@$(build-tools)/lessc.exe -m $(css-dir)style.tmp $(css-target) | |
@echo "[ Done ]" | |
@rm -f $(css-dir)style.tmp | |
# JS Compilation | |
$(js-target): $(js-files) | |
@rm -f $(js-target) | |
@echo "Merging JS files..." | |
@cat $(js-files) > $(js-dir)script.tmp | |
@java -jar $(google-cc-jar) --js $(js-dir)script.tmp --js_output_file $(js-target) | |
@echo "[ Done ]" | |
@rm -f $(js-dir)script.tmp | |
# This is done when we type 'clean' | |
clean: | |
@rm -f $(css-target) | |
@rm -f $(js-target) | |
@echo "Built files deleted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment