Skip to content
Browse files
Pull in the Sizzle library dynamically using a submodule and make it …
…part of the jQuery build process.
  • Loading branch information
jeresig committed Oct 26, 2009
1 parent bbffc99 commit 81f65ce33931831dc651c5d3ebf2b31b551b6b8b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1,022 deletions.
@@ -1,3 +1,6 @@
[submodule "test/qunit"]
path = test/qunit
url = git://
[submodule "src/sizzle"]
path = src/sizzle
url = git://
@@ -2,7 +2,6 @@ SRC_DIR = src
BUILD_DIR = build


BASE_FILES = ${SRC_DIR}/core.js\
@@ -33,25 +32,35 @@ MINJAR = java -jar ${BUILD_DIR}/yuicompressor-2.4.2.jar

DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`

all: jquery test min
all: jquery min
@@echo "jQuery build complete."

@@mkdir -p ${DIST_DIR}

jquery: ${DIST_DIR} ${JQ}
@@echo "Grabbing external dependencies..."
@@git submodule init
@@git submodule update

jquery: ${DIST_DIR} selector ${JQ}

@@echo "Building" ${JQ}

@@mkdir -p ${DIST_DIR}

@@cat ${MODULES} | \
sed 's/Date:./&'"${DATE}"'/' | \
${VER} > ${JQ};

@@echo ${JQ} "Built"

selector: init
@@echo "Building selector code from Sizzle"
@@sed '/EXPOSE/r src/sizzle-jquery.js' src/sizzle/sizzle.js > src/selector.js

min: ${JQ_MIN}

${JQ_MIN}: ${JQ}
@@ -63,13 +72,9 @@ ${JQ_MIN}: ${JQ}
@@echo ${JQ_MIN} "Built"

test: ${JQ}
@@echo "Building Test Suite"
@@echo "Test Suite Built"
git submodule init
git submodule update

@@echo "Removing Distribution directory:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}

@@echo "Removing built copy of Sizzle"
@@rm src/selector.js
@@ -24,11 +24,14 @@ What you need to build your own jQuery:
How to build your own jQuery:

In the main directory of the distribution (the one that this file is in), type
the following to make all versions of jQuery, the documentation, and the test suite:
the following to make all versions of jQuery:

Here are each of the individual items that are buildable from the Makefile.

make init
Pull in all the external dependencies (QUnit, Sizzle) for the project.

make jquery
The standard, uncompressed, jQuery code.
Makes: ./dist/jquery.js
@@ -37,10 +40,9 @@ make min
A compressed version of jQuery (made the YUI Minifier).
Makes: ./dist/jquery.min.js

make test
Makes sure that the QUnit submodule is properly checked out.
Open this file in your browser:
make selector
Builds the selector library for jQuery from Sizzle.
Makes: ./src/selector.js

Finally, you can remove all the built files using the command:
make clean

0 comments on commit 81f65ce

Please sign in to comment.