Make sure that init is run before jquery is built (avoiding weird warnings 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').
This commit is contained in:
parent
294df4fdcb
commit
2c290709d8
39
Makefile
39
Makefile
|
@ -43,7 +43,7 @@ VER = sed "s/@VERSION/${JQ_VER}/"
|
||||||
|
|
||||||
DATE=$(shell git log -1 --pretty=format:%ad)
|
DATE=$(shell git log -1 --pretty=format:%ad)
|
||||||
|
|
||||||
all: init jquery min lint
|
all: jquery min lint
|
||||||
@@echo "jQuery build complete."
|
@@echo "jQuery build complete."
|
||||||
|
|
||||||
${DIST_DIR}:
|
${DIST_DIR}:
|
||||||
|
@ -68,12 +68,16 @@ define clone_or_pull
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
init:
|
${QUNIT_DIR}:
|
||||||
$(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)
|
$(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)
|
$(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)
|
||||||
|
|
||||||
jquery: ${JQ}
|
init: ${QUNIT_DIR} ${SIZZLE_DIR}
|
||||||
jq: ${JQ}
|
|
||||||
|
jquery: init ${JQ}
|
||||||
|
jq: init ${JQ}
|
||||||
|
|
||||||
${JQ}: ${MODULES} | ${DIST_DIR}
|
${JQ}: ${MODULES} | ${DIST_DIR}
|
||||||
@@echo "Building" ${JQ}
|
@@echo "Building" ${JQ}
|
||||||
|
@ -88,18 +92,27 @@ ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
|
||||||
@@echo "Building selector code from Sizzle"
|
@@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
|
@@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
|
||||||
|
|
||||||
lint: ${JQ}
|
lint: jquery
|
||||||
@@echo "Checking jQuery against JSLint..."
|
@@if test ! -z ${JS_ENGINE}; then \
|
||||||
@@${JS_ENGINE} build/jslint-check.js
|
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}
|
min: ${JQ_MIN}
|
||||||
|
|
||||||
${JQ_MIN}: ${JQ}
|
${JQ_MIN}: jquery
|
||||||
@@echo "Building" ${JQ_MIN}
|
@@if test ! -z ${JS_ENGINE}; then \
|
||||||
@@${COMPILER} ${JQ} > ${JQ_MIN}.tmp
|
echo "Minifying jQuery" ${JQ_MIN}; \
|
||||||
@@echo ";" >> ${JQ_MIN}.tmp
|
${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
|
||||||
@@sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN}
|
echo ";" >> ${JQ_MIN}.tmp; \
|
||||||
@@rm -rf ${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:
|
clean:
|
||||||
@@echo "Removing Distribution directory:" ${DIST_DIR}
|
@@echo "Removing Distribution directory:" ${DIST_DIR}
|
||||||
|
|
Loading…
Reference in a new issue