6 DIST_DIR = ${PREFIX}/dist
8 JS_ENGINE ?= `which node nodejs`
9 COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
10 POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
12 BASE_FILES = ${SRC_DIR}/core.js\
13 ${SRC_DIR}/deferred.js\
14 ${SRC_DIR}/support.js\
17 ${SRC_DIR}/attributes.js\
19 ${SRC_DIR}/selector.js\
20 ${SRC_DIR}/traversing.js\
21 ${SRC_DIR}/manipulation.js\
24 ${SRC_DIR}/ajax/jsonp.js\
25 ${SRC_DIR}/ajax/script.js\
26 ${SRC_DIR}/ajax/xhr.js\
27 ${SRC_DIR}/effects.js\
29 ${SRC_DIR}/dimensions.js
31 MODULES = ${SRC_DIR}/intro.js\
35 JQ = ${DIST_DIR}/jquery.js
36 JQ_MIN = ${DIST_DIR}/jquery.min.js
38 SIZZLE_DIR = ${SRC_DIR}/sizzle
40 JQ_VER = $(shell cat version.txt)
41 VER = sed "s/@VERSION/${JQ_VER}/"
43 DATE=$(shell git log -1 --pretty=format:%ad)
46 @@echo "jQuery build complete."
49 @@mkdir -p ${DIST_DIR}
52 @@if [ -d .git ]; then git submodule update --init --recursive --merge; fi
56 ${JQ}: ${MODULES} | ${DIST_DIR}
57 @@echo "Building" ${JQ}
60 sed 's/.function..jQuery...{//' | \
61 sed 's/}...jQuery..;//' | \
62 sed 's/@DATE/'"${DATE}"'/' | \
65 ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
66 @@echo "Building selector code from Sizzle"
67 @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
70 @@if test ! -z ${JS_ENGINE}; then \
71 echo "Checking jQuery against JSLint..."; \
72 ${JS_ENGINE} build/jslint-check.js; \
74 echo "You must have NodeJS installed in order to test jQuery against JSLint."; \
80 @@if test ! -z ${JS_ENGINE}; then \
81 echo "Minifying jQuery" ${JQ_MIN}; \
82 ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
83 ${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
84 rm -f ${JQ_MIN}.tmp; \
86 echo "You must have NodeJS installed in order to minify jQuery."; \
91 @@echo "Removing Distribution directory:" ${DIST_DIR}
94 @@echo "Removing built copy of Sizzle"
95 @@rm -f src/selector.js
98 @@echo "Removing submodules"
99 @@rm -rf test/qunit src/sizzle
101 # update the submodules to the latest at the most logical branch
103 @@git submodule foreach "git pull origin \$$(git branch --no-color --contains \$$(git rev-parse HEAD) | grep -v \( | head -1)"
104 @@git submodule summary
106 pull: pull_submodules
107 @@git pull ${REMOTE} ${BRANCH}
109 .PHONY: all jquery lint min init jq clean