Created
October 1, 2011 15:14
-
-
Save rc1/1256166 to your computer and use it in GitHub Desktop.
JavaScript Makefile with concatenation, minimiser
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
# description: build script for project libraries, external libraries including jslint | |
# used on The Big Art Mob web app | |
# | |
# usage: `make all` or `make lint` | |
#` | |
# requirements: node + npm for uglify-js, jslint. | |
# App.js | |
# | |
APP = ./js/build/app.js | |
APP-MIN = ./js/build/app.min.js | |
APP-SRC = ./js/app.js | |
# BOM Framework | |
# | |
BOM = ./js/build/BOM.js | |
BOM-MIN = ./js/build/BOM.min.js | |
BOM-SRC = ./js/BOM.js ./js/BOM.Models.js ./js/BOM.Collections.js ./js/BOM.Views.js ./js/BOM.Views.Cells.js ./js/BOM.Views.Panels.js ./js/BOM.Views.Modals.js ./js/BOM.Views.Lists.js ./js/BOM.Views.Maps.js ./js/BOM.factory.js | |
# Libraries | |
# | |
LIB = ./js/build/BOM.libs.js | |
LIB-MIN = ./js/build/BOM.libs.min.js | |
LIB-SRC = ./js/libs/ICanHaz.min.js ./js/libs/spin.min.js ./js/libs/jquery.effects.slide.js ./js/libs/jquery.iframe-post-form.js ./js/libs/jquery.form.js ./js/libs/jquery.cookie.js ./js/libs/jquery.scrollTo-1.4.2-min.js ./js/libs/jQuery-Validation-Engine/js/languages/jquery.validationEngine-en.js ./js/libs/jQuery-Validation-Engine/js/jquery.validationEngine.js ./js/libs/flowPlayer/flowplayer-3.0.6.min.js ./js/libs/underscore.js ./js/libs/backbone.js ./js/libs/nice_alert.js ./js/libs/json2.js ./js/libs/jquery-gmap3-3.3/gmap3.js ./js/libs/infobox.js ./js/libs/infobox_packed.js ./js/libs/markermanager_packed.js ./js/libs/markerclusterer_packed.js ./js/libs/StyledMarker.js | |
# | |
# all | |
# | |
all: clean build min | |
# | |
# Lint | |
# | |
lint: | |
./node_modules/.bin/jslint --white false --onevar false $(BOM-SRC) | |
# | |
# Clean | |
# | |
clean: | |
rm -f $(APP) | |
rm -f $(BOM) | |
rm -f $(LIB) | |
rm -f $(APP-MIN) | |
rm -f $(BOM-MIN) | |
rm -f $(LIB-MIN) | |
# | |
# Build | |
# | |
build: build-app build-bom build-lib | |
build-app: $(APP-SRC) | |
cat $^ > $(APP) | |
build-bom: $(BOM-SRC) | |
cat $^ > $(BOM) | |
build-lib: $(LIB-SRC) | |
cat $^ > $(LIB) | |
# | |
# Min | |
# | |
min: min-app min-src min-lib | |
min-app: | |
$(foreach var, $(APP-SRC), ./node_modules/.bin/uglifyjs --no-mangle $(var) >>$(APP-MIN);)) | |
min-src: | |
$(foreach var, $(BOM-SRC), ./node_modules/.bin/uglifyjs --no-mangle $(var) >>$(BOM-MIN);)) | |
min-lib: | |
$(foreach var, $(LIB-SRC), ./node_modules/.bin/uglifyjs --no-mangle $(var) >>$(LIB-MIN);)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment