Fix #10705. Don't bail too soon in `.off()` event string processing.
[jquery.git] / Makefile
blob2bc41a070f73500b243175ea8ffc3a14c5fac42b
1 SRC_DIR = src
2 TEST_DIR = test
3 BUILD_DIR = build
5 PREFIX = .
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\
16 ${SRC_DIR}/data.js\
17 ${SRC_DIR}/queue.js\
18 ${SRC_DIR}/attributes.js\
19 ${SRC_DIR}/event.js\
20 ${SRC_DIR}/selector.js\
21 ${SRC_DIR}/traversing.js\
22 ${SRC_DIR}/manipulation.js\
23 ${SRC_DIR}/css.js\
24 ${SRC_DIR}/ajax.js\
25 ${SRC_DIR}/ajax/jsonp.js\
26 ${SRC_DIR}/ajax/script.js\
27 ${SRC_DIR}/ajax/xhr.js\
28 ${SRC_DIR}/effects.js\
29 ${SRC_DIR}/offset.js\
30 ${SRC_DIR}/dimensions.js
32 MODULES = ${SRC_DIR}/intro.js\
33 ${BASE_FILES}\
34 ${SRC_DIR}/outro.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."
51 ${DIST_DIR}:
52 @@mkdir -p ${DIST_DIR}
54 jquery: ${JQ}
56 ${JQ}: ${MODULES} | ${DIST_DIR}
57 @@echo "Building" ${JQ}
59 @@cat ${MODULES} | \
60 sed 's/.function..jQuery...{//' | \
61 sed 's/}...jQuery..;//' | \
62 sed 's/@DATE/'"${DATE}"'/' | \
63 ${VER} > ${JQ};
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
69 lint: jquery
70 @@if test ! -z ${JS_ENGINE}; then \
71 echo "Checking jQuery against JSLint..."; \
72 ${JS_ENGINE} build/jslint-check.js; \
73 else \
74 echo "You must have NodeJS installed in order to test jQuery against JSLint."; \
77 size: jquery min
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; \
81 rm ${JQ_MIN}.gz; \
82 else \
83 echo "You must have NodeJS installed in order to size jQuery."; \
86 freq: jquery min
87 @@if test ! -z ${JS_ENGINE}; then \
88 ${JS_ENGINE} ${BUILD_DIR}/freq.js; \
89 else \
90 echo "You must have NodeJS installed to report the character frequency of minified jQuery."; \
93 min: jquery ${JQ_MIN}
95 ${JQ_MIN}: ${JQ}
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; \
101 else \
102 echo "You must have NodeJS installed in order to minify jQuery."; \
105 clean:
106 @@echo "Removing Distribution directory:" ${DIST_DIR}
107 @@rm -rf ${DIST_DIR}
109 @@echo "Removing built copy of Sizzle"
110 @@rm -f src/selector.js
112 distclean: clean
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
119 update_submodules:
120 @@if [ -d .git ]; then \
121 if git submodule status | grep -q -E '^-'; then \
122 git submodule update --init --recursive; \
123 else \
124 git submodule update --init --recursive --merge; \
125 fi; \
128 # update the submodules to the latest at the most logical branch
129 pull_submodules:
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