8 DIST_DIR = ${PREFIX}/dist
10 JS_ENGINE ?= `which node nodejs`
11 COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
12 POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
14 BASE_FILES = ${SRC_DIR}/core.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
40 QUNIT_DIR = ${TEST_DIR}/qunit
42 JQ_VER = $(shell cat version.txt)
43 VER = sed "s/@VERSION/${JQ_VER}/"
45 DATE=$(shell git log -1 --pretty=format:%ad)
48 @@echo "jQuery build complete."
51 @@mkdir -p ${DIST_DIR}
53 ifeq ($(strip $(V)),0)
55 else ifeq ($(strip $(V)),1)
62 -@@if test ! -d $(strip ${1})/.git; then \
63 echo "Cloning $(strip ${1})..."; \
64 git clone $(strip ${verbose}) --depth=1 $(strip ${2}) $(strip ${1}); \
66 echo "Pulling $(strip ${1})..."; \
67 git --git-dir=$(strip ${1})/.git pull $(strip ${verbose}) origin master; \
73 $(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)
76 $(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)
78 init: ${QUNIT_DIR} ${SIZZLE_DIR}
83 ${JQ}: ${MODULES} | ${DIST_DIR}
84 @@echo "Building" ${JQ}
87 sed 's/.function..jQuery...{//' | \
88 sed 's/}...jQuery..;//' | \
89 sed 's/@DATE/'"${DATE}"'/' | \
92 ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
93 @@echo "Building selector code from Sizzle"
94 @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
97 @@if test ! -z ${JS_ENGINE}; then \
98 echo "Checking jQuery against JSLint..."; \
99 ${JS_ENGINE} build/jslint-check.js; \
101 echo "You must have NodeJS installed in order to test jQuery against JSLint."; \
107 @@if test ! -z ${JS_ENGINE}; then \
108 echo "Minifying jQuery" ${JQ_MIN}; \
109 ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
110 ${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
111 rm -f ${JQ_MIN}.tmp; \
113 echo "You must have NodeJS installed in order to minify jQuery."; \
118 @@echo "Removing Distribution directory:" ${DIST_DIR}
121 @@echo "Removing built copy of Sizzle"
122 @@rm -f src/selector.js
124 @@echo "Removing cloned directories"
125 @@rm -rf test/qunit src/sizzle
127 .PHONY: all jquery lint min init jq clean