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}/effects.js\
29 ${SRC_DIR}/dimensions.js
31 MODULES = ${SRC_DIR}/intro.js\
35 JQ = ${DIST_DIR}/jquery.js
36 JQ_MIN = ${DIST_DIR}/jquery.min.js
38 SIZZLE_DIR = ${SRC_DIR}/sizzle
39 QUNIT_DIR = ${TEST_DIR}/qunit
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: init jquery min lint
47 @@echo "jQuery build complete."
50 @@mkdir -p ${DIST_DIR}
52 ifeq ($(strip $(V)),0)
54 else ifeq ($(strip $(V)),1)
61 -@@if test ! -d $(strip ${1})/.git; then \
62 echo "Cloning $(strip ${1})..."; \
63 git clone $(strip ${verbose}) --depth=1 $(strip ${2}) $(strip ${1}); \
65 echo "Pulling $(strip ${1})..."; \
66 git --git-dir=$(strip ${1})/.git pull $(strip ${verbose}) origin master; \
72 $(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git)
73 $(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git)
78 ${JQ}: ${MODULES} ${DIST_DIR}
79 @@echo "Building" ${JQ}
82 sed 's/.function..jQuery...{//' | \
83 sed 's/}...jQuery..;//' | \
84 sed 's/Date:./&'"${DATE}"'/' | \
87 ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
88 @@echo "Building selector code from Sizzle"
89 @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
92 @@echo "Checking jQuery against JSLint..."
93 @@${RHINO} build/jslint-check.js
98 @@echo "Building" ${JQ_MIN}
100 @@head -15 ${JQ} > ${JQ_MIN}
101 @@${MINJAR} --js ${JQ} --warning_level QUIET --js_output_file ${JQ_MIN}.tmp
102 @@cat ${JQ_MIN}.tmp >> ${JQ_MIN}
103 @@rm -f ${JQ_MIN}.tmp
106 @@echo "Removing Distribution directory:" ${DIST_DIR}
109 @@echo "Removing built copy of Sizzle"
110 @@rm -f src/selector.js
112 @@echo "Removing cloned directories"
113 @@rm -rf test/qunit src/sizzle
115 .PHONY: all jquery lint min init jq clean