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\
33 MODULES
= ${SRC_DIR}/intro.js\
37 JQ
= ${DIST_DIR}/jquery.js
38 JQ_MIN
= ${DIST_DIR}/jquery.min.js
40 SIZZLE_DIR
= ${SRC_DIR}/sizzle
42 JQ_VER
= $(shell cat version.txt
)
43 VER
= sed
"s/@VERSION/${JQ_VER}/"
45 DATE
=$(shell git log
-1 --pretty
=format
:%ad
)
47 all: update_submodules core
49 core
: jquery min hint size
50 @@echo
"jQuery build complete."
53 @@mkdir
-p
${DIST_DIR}
57 ${JQ}: ${MODULES} |
${DIST_DIR}
58 @@echo
"Building" ${JQ}
61 sed
's/.function..jQuery...{//' | \
62 sed
's/}...jQuery..;//' | \
63 sed
's/@DATE/'"${DATE}"'/' | \
66 ${SRC_DIR}/selector.js
: ${SIZZLE_DIR}/sizzle.js
67 @@echo
"Building selector code from Sizzle"
68 @@sed
'/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep
-v window.Sizzle
> ${SRC_DIR}/selector.js
71 @@if
test ! -z
${JS_ENGINE}; then \
72 echo
"Checking jQuery against JSHint..."; \
73 ${JS_ENGINE} build
/jshint-check.js
; \
75 echo
"You must have NodeJS installed in order to test jQuery against JSHint."; \
79 @@if
test ! -z
${JS_ENGINE}; then \
80 gzip
-c
${JQ_MIN} > ${JQ_MIN}.gz
; \
81 wc
-c
${JQ} ${JQ_MIN} ${JQ_MIN}.gz |
${JS_ENGINE} ${BUILD_DIR}/sizer.js
; \
84 echo
"You must have NodeJS installed in order to size jQuery."; \
88 @@if
test ! -z
${JS_ENGINE}; then \
89 ${JS_ENGINE} ${BUILD_DIR}/freq.js
; \
91 echo
"You must have NodeJS installed to report the character frequency of minified jQuery."; \
97 @@if
test ! -z
${JS_ENGINE}; then \
98 echo
"Minifying jQuery" ${JQ_MIN}; \
99 ${COMPILER} ${JQ} > ${JQ_MIN}.tmp
; \
100 ${POST_COMPILER} ${JQ_MIN}.tmp
; \
101 rm -f
${JQ_MIN}.tmp
; \
103 echo
"You must have NodeJS installed in order to minify jQuery."; \
107 @@echo
"Removing Distribution directory:" ${DIST_DIR}
110 @@echo
"Removing built copy of Sizzle"
111 @@
rm -f src
/selector.js
114 @@echo
"Removing submodules"
115 @@
rm -rf
test/qunit src
/sizzle
117 # change pointers for submodules and update them to what is specified in jQuery
118 # --merge doesn't work when doing an initial clone, thus test if we have non-existing
119 # submodules, then do an real update
121 @@if
[ -d .git
]; then \
122 if git submodule status | grep
-q
-E
'^-'; then \
123 git submodule update
--init
--recursive
; \
125 git submodule update
--init
--recursive
--merge
; \
129 # update the submodules to the latest at the most logical branch
131 @@git submodule
foreach "git pull \$$(git config remote.origin.url)"
132 @@git submodule summary
134 pull
: pull_submodules
135 @@git pull
${REMOTE} ${BRANCH}
137 .PHONY
: all jquery hint min
clean distclean update_submodules pull_submodules pull core