Skip to content
Browse files
Make sure that init is run before jquery is built (avoiding weird war…
…nings when running 'make jquery' or 'make min'). Additionally only attempt to run JSLint or the minifier if NodeJS is installed (avoiding a weird warning when you first run 'make' or 'make all').
  • Loading branch information
jeresig committed Jan 26, 2011
1 parent 294df4f commit 2c29070
Showing 1 changed file with 26 additions and 13 deletions.
@@ -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."

@@ -68,12 +68,16 @@ define clone_or_pull


$(call clone_or_pull, ${QUNIT_DIR}, git://

$(call clone_or_pull, ${SIZZLE_DIR}, git://

jquery: ${JQ}
jq: ${JQ}

jquery: init ${JQ}
jq: init ${JQ}

@@echo "Building" ${JQ}
@@ -88,18 +92,27 @@ ${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."; \

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."; \

@@echo "Removing Distribution directory:" ${DIST_DIR}

0 comments on commit 2c29070

Please sign in to comment.