Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adds Makefile with buildprocess targets

  • Loading branch information...
commit c8a70a11b76f2427be258ec351705fe82570d480 1 parent 4fc890b
@rwaldron authored
Showing with 56 additions and 0 deletions.
  1. +56 −0 Makefile
View
56 Makefile
@@ -0,0 +1,56 @@
+BUILD_DIR = build
+
+PREFIX = .
+DIST_DIR = ${PREFIX}/dist
+
+JS_ENGINE ?= `which node nodejs`
+COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
+POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
+
+SRC=jquery.eventsource.js
+
+DIST = ${DIST_DIR}/jquery.eventsource.js
+DIST_MIN = ${DIST_DIR}/jquery.eventsource.min.js
+
+all: project min hint
+ @@echo "Project build complete."
+
+${DIST_DIR}:
+ @@mkdir -p ${DIST_DIR}
+
+
+project: ${DIST}
+
+${DIST}: ${SRC} | ${DIST_DIR}
+ @@echo "Building" ${DIST}
+ @@cat ${SRC} > ${DIST};
+
+
+min: project ${DIST_MIN}
+
+${DIST_MIN}: ${DIST}
+ @@if test ! -z ${JS_ENGINE}; then \
+ echo "Minifying Project" ${DIST_MIN}; \
+ ${COMPILER} ${DIST} > ${DIST_MIN}.tmp; \
+ ${POST_COMPILER} ${DIST_MIN}.tmp > ${DIST_MIN}; \
+ rm -f ${DIST_MIN}.tmp; \
+ else \
+ echo "You must have NodeJS installed in order to minify Project."; \
+ fi
+
+
+hint:
+ @@if test ! -z ${JS_ENGINE}; then \
+ echo "Hinting Project"; \
+ ${JS_ENGINE} build/jshint-check.js; \
+ else \
+ echo "Nodejs is missing"; \
+ fi
+
+
+clean:
+ @@echo "Removing Distribution directory:" ${DIST_DIR}
+ @@rm -rf ${DIST_DIR}
+
+
+.PHONY: all project hint min
Please sign in to comment.
Something went wrong with that request. Please try again.