X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=Makefile;h=48a885da28e05dbab58f390c862f2c5544c375c1;hp=7540a272311a6aef80f5e6f35df9ec9a07454c51;hb=8d8db3f2b3f8c3d41854726c8a0227f6deecc602;hpb=d503845d0cf45632c0d7c3542ffd1b19257a8e5e diff --git a/Makefile b/Makefile index 7540a27..48a885d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ BUILD_DIR = build PREFIX = . DIST_DIR = ${PREFIX}/dist -JS_ENGINE ?= node +JS_ENGINE ?= `which node nodejs` COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe BASE_FILES = ${SRC_DIR}/core.js\ @@ -43,7 +43,7 @@ VER = sed "s/@VERSION/${JQ_VER}/" DATE=$(shell git log -1 --pretty=format:%ad) -all: init jquery min lint +all: jquery min lint @@echo "jQuery build complete." ${DIST_DIR}: @@ -68,12 +68,16 @@ define clone_or_pull 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} @@ -88,15 +92,26 @@ ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js @@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} +${JQ_MIN}: jquery + @@if test ! -z ${JS_ENGINE}; then \ + echo "Minifying jQuery" ${JQ_MIN}; \ + ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \ + sed '$ s#^\( \*/\)\(.\+\)#\1\n\2;#' ${JQ_MIN}.tmp > ${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}