8 DIST_DIR = ${PREFIX}/dist
10 RHINO ?= java -jar ${BUILD_DIR}/js.jar
12 CLOSURE_COMPILER = ${BUILD_DIR}/google-compiler-20100917.jar
14 MINJAR ?= java -jar ${CLOSURE_COMPILER}
16 BASE_FILES = ${SRC_DIR}/core.js\
17 ${SRC_DIR}/support.js\
20 ${SRC_DIR}/attributes.js\
22 ${SRC_DIR}/selector.js\
23 ${SRC_DIR}/traversing.js\
24 ${SRC_DIR}/manipulation.js\
28 ${SRC_DIR}/transports/jsonp.js\
29 ${SRC_DIR}/transports/script.js\
30 ${SRC_DIR}/transports/xhr.js\
31 ${SRC_DIR}/effects.js\
33 ${SRC_DIR}/dimensions.js
35 MODULES = ${SRC_DIR}/intro.js\
39 JQ = ${DIST_DIR}/jquery.js
40 JQ_MIN = ${DIST_DIR}/jquery.min.js
42 SIZZLE_DIR = ${SRC_DIR}/sizzle
43 QUNIT_DIR = ${TEST_DIR}/qunit
45 JQ_VER = $(shell cat version.txt)
46 VER = sed "s/@VERSION/${JQ_VER}/"
48 DATE=$(shell git log -1 --pretty=format:%ad)
50 all: init jquery min lint
51 @@echo "jQuery build complete."
54 @@mkdir -p ${DIST_DIR}
56 ifeq ($(strip $(V)),0)
58 else ifeq ($(strip $(V)),1)
65 -@@if test ! -d $(strip ${1})/.git; then \
66 echo "Cloning $(strip ${1})..."; \
67 git clone $(strip ${verbose}) --depth=1 $(strip ${2}) $(strip ${1}); \
69 echo "Pulling $(strip ${1})..."; \
70 git --git-dir=$(strip ${1})/.git pull $(strip ${verbose}) origin master; \
76 $(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)
77 $(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)
82 ${JQ}: ${MODULES} ${DIST_DIR}
83 @@echo "Building" ${JQ}
86 sed 's/.function..jQuery...{//' | \
87 sed 's/}...jQuery..;//' | \
88 sed 's/Date:./&'"${DATE}"'/' | \
91 ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
92 @@echo "Building selector code from Sizzle"
93 @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
96 @@echo "Checking jQuery against JSLint..."
97 @@${RHINO} build/jslint-check.js
102 @@echo "Building" ${JQ_MIN}
104 @@head -15 ${JQ} > ${JQ_MIN}
105 @@${MINJAR} --js ${JQ} --warning_level QUIET --js_output_file ${JQ_MIN}.tmp
106 @@cat ${JQ_MIN}.tmp >> ${JQ_MIN}
107 @@rm -f ${JQ_MIN}.tmp
110 @@echo "Removing Distribution directory:" ${DIST_DIR}
113 @@echo "Removing built copy of Sizzle"
114 @@rm -f src/selector.js
116 @@echo "Removing cloned directories"
117 @@rm -rf test/qunit src/sizzle
119 .PHONY: all jquery lint min init jq clean