6 DIST_DIR
= ${PREFIX}/dist
8 JS_ENGINE ?
= `which node nodejs 2>/dev/null`
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}/callbacks.js\
14 ${SRC_DIR}/deferred.js\
15 ${SRC_DIR}/support.js\
18 ${SRC_DIR}/attributes.js\
20 ${SRC_DIR}/selector.js\
21 ${SRC_DIR}/traversing.js\
22 ${SRC_DIR}/manipulation.js\
25 ${SRC_DIR}/ajax
/jsonp.js\
26 ${SRC_DIR}/ajax
/script.js\
27 ${SRC_DIR}/ajax
/xhr.js\
28 ${SRC_DIR}/effects.js\
30 ${SRC_DIR}/dimensions.js
32 MODULES
= ${SRC_DIR}/intro.js\
36 JQ
= ${DIST_DIR}/jquery.js
37 JQ_MIN
= ${DIST_DIR}/jquery.min.js
39 SIZZLE_DIR
= ${SRC_DIR}/sizzle
41 JQ_VER
= $(shell cat version.txt
)
42 VER
= sed
"s/@VERSION/${JQ_VER}/"
44 DATE
=$(shell git log
-1 --pretty
=format
:%ad
)
46 all: update_submodules core
48 core
: jquery min lint size
49 @@echo
"jQuery build complete."
52 @@mkdir
-p
${DIST_DIR}
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."; \
78 @@if
test ! -z
${JS_ENGINE}; then \
79 gzip
-c
${JQ_MIN} > ${JQ_MIN}.gz
; \
80 wc
-c
${JQ} ${JQ_MIN} ${JQ_MIN}.gz |
${JS_ENGINE} ${BUILD_DIR}/sizer.js
; \
83 echo
"You must have NodeJS installed in order to size jQuery."; \
87 @@if
test ! -z
${JS_ENGINE}; then \
88 ${JS_ENGINE} ${BUILD_DIR}/freq.js
; \
90 echo
"You must have NodeJS installed to report the character frequency of minified jQuery."; \
96 @@if
test ! -z
${JS_ENGINE}; then \
97 echo
"Minifying jQuery" ${JQ_MIN}; \
98 ${COMPILER} ${JQ} > ${JQ_MIN}.tmp
; \
99 ${POST_COMPILER} ${JQ_MIN}.tmp
> ${JQ_MIN}; \
100 rm -f
${JQ_MIN}.tmp
; \
102 echo
"You must have NodeJS installed in order to minify jQuery."; \
106 @@echo
"Removing Distribution directory:" ${DIST_DIR}
109 @@echo
"Removing built copy of Sizzle"
110 @@
rm -f src
/selector.js
113 @@echo
"Removing submodules"
114 @@
rm -rf
test/qunit src
/sizzle
116 # change pointers for submodules and update them to what is specified in jQuery
117 # --merge doesn't work when doing an initial clone, thus test if we have non-existing
118 # submodules, then do an real update
120 @@if
[ -d .git
]; then \
121 if git submodule status | grep
-q
-E
'^-'; then \
122 git submodule update
--init
--recursive
; \
124 git submodule update
--init
--recursive
--merge
; \
128 # update the submodules to the latest at the most logical branch
130 @@git submodule
foreach "git pull \$$(git config remote.origin.url)"
131 @@git submodule summary
133 pull
: pull_submodules
134 @@git pull
${REMOTE} ${BRANCH}
136 .PHONY
: all jquery lint min
clean distclean update_submodules pull_submodules pull core