DATE=$(shell git log -1 --pretty=format:%ad)
-all: init jquery min lint
+all: jquery min lint
@@echo "jQuery build complete."
${DIST_DIR}:
endef
-init:
+${QUNIT_DIR}:
$(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)
+
+${SIZZLE_DIR}:
$(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)
-jquery: ${JQ}
-jq: ${JQ}
+init: ${QUNIT_DIR} ${SIZZLE_DIR}
+
+jquery: init ${JQ}
+jq: init ${JQ}
${JQ}: ${MODULES} | ${DIST_DIR}
@@echo "Building" ${JQ}
@@echo "Building selector code from Sizzle"
@@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
-lint: ${JQ}
- @@echo "Checking jQuery against JSLint..."
- @@${JS_ENGINE} build/jslint-check.js
+lint: jquery
+ @@if test ! -z ${JS_ENGINE}; then \
+ echo "Checking jQuery against JSLint..."; \
+ ${JS_ENGINE} build/jslint-check.js; \
+ else \
+ echo "You must have NodeJS installed in order to test jQuery against JSLint."; \
+ fi
min: ${JQ_MIN}
-${JQ_MIN}: ${JQ}
- @@echo "Building" ${JQ_MIN}
- @@${COMPILER} ${JQ} > ${JQ_MIN}.tmp
- @@echo ";" >> ${JQ_MIN}.tmp
- @@sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN}
- @@rm -rf ${JQ_MIN}.tmp
+${JQ_MIN}: jquery
+ @@if test ! -z ${JS_ENGINE}; then \
+ echo "Minifying jQuery" ${JQ_MIN}; \
+ ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
+ echo ";" >> ${JQ_MIN}.tmp; \
+ sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN}; \
+ rm -rf ${JQ_MIN}.tmp; \
+ else \
+ echo "You must have NodeJS installed in order to minify jQuery."; \
+ fi
+
clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}