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\
27 ${SRC_DIR}/ajax/jsonp.js\
28 ${SRC_DIR}/ajax/script.js\
29 ${SRC_DIR}/ajax/xhr.js\
30 ${SRC_DIR}/effects.js\
32 ${SRC_DIR}/dimensions.js
34 MODULES = ${SRC_DIR}/intro.js\
38 JQ = ${DIST_DIR}/jquery.js
39 JQ_MIN = ${DIST_DIR}/jquery.min.js
41 SIZZLE_DIR = ${SRC_DIR}/sizzle
42 QUNIT_DIR = ${TEST_DIR}/qunit
44 JQ_VER = $(shell cat version.txt)
45 VER = sed "s/@VERSION/${JQ_VER}/"
47 DATE=$(shell git log -1 --pretty=format:%ad)
49 all: init jquery min lint
50 @@echo "jQuery build complete."
53 @@mkdir -p ${DIST_DIR}
55 ifeq ($(strip $(V)),0)
57 else ifeq ($(strip $(V)),1)
64 -@@if test ! -d $(strip ${1})/.git; then \
65 echo "Cloning $(strip ${1})..."; \
66 git clone $(strip ${verbose}) --depth=1 $(strip ${2}) $(strip ${1}); \
68 echo "Pulling $(strip ${1})..."; \
69 git --git-dir=$(strip ${1})/.git pull $(strip ${verbose}) origin master; \
75 $(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)
81 ${JQ}: ${MODULES} | ${DIST_DIR}
82 @@echo "Building" ${JQ}
85 sed 's/.function..jQuery...{//' | \
86 sed 's/}...jQuery..;//' | \
87 sed 's/@DATE/'"${DATE}"'/' | \
90 ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
91 @@echo "Building selector code from Sizzle"
92 @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
95 @@echo "Checking jQuery against JSLint..."
96 @@${RHINO} build/jslint-check.js
101 @@echo "Building" ${JQ_MIN}
103 @@head -15 ${JQ} > ${JQ_MIN}
104 @@${MINJAR} --js ${JQ} --warning_level QUIET --js_output_file ${JQ_MIN}.tmp
105 @@cat ${JQ_MIN}.tmp >> ${JQ_MIN}
106 @@rm -f ${JQ_MIN}.tmp
109 @@echo "Removing Distribution directory:" ${DIST_DIR}
112 @@echo "Removing built copy of Sizzle"
113 @@rm -f src/selector.js
115 @@echo "Removing cloned directories"
116 @@rm -rf test/qunit src/sizzle
118 .PHONY: all jquery lint min init jq clean