8 # Default to verbose builds.
9 # To do quiet/pretty builds, run `make V=` to set V to an empty string,
10 # or set the V environment variable to an empty string.
13 # BUILDTYPE=Debug builds both release and debug builds. If you want to compile
14 # just the debug build, run `make -C out BUILDTYPE=Debug` instead.
15 ifeq ($(BUILDTYPE),Release)
16 all: out/Makefile node
18 all: out/Makefile node node_g
21 # The .PHONY is needed to ensure that we recursively use the out/Makefile
22 # to check for changes.
26 $(MAKE) -C out BUILDTYPE=Release V=$(V)
27 ln -fs out/Release/node node
30 $(MAKE) -C out BUILDTYPE=Debug V=$(V)
31 ln -fs out/Debug/node node_g
33 config.gypi: configure
37 $(MAKE) -C out BUILDTYPE=Debug V=$(V)
39 out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
40 $(PYTHON) tools/gyp_node -f make
43 $(PYTHON) tools/install.py $@ $(DESTDIR)
46 $(PYTHON) tools/install.py $@ $(DESTDIR)
49 -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md
50 -find out/ -name '*.o' -o -name '*.a' | xargs rm -rf
57 -rm -rf node node_g blog.html email.md
61 $(PYTHON) tools/test.py --mode=release simple message
65 $(PYTHON) tools/test.py --mode=release --use-http1 simple message
68 $(PYTHON) tools/test.py --mode=release --valgrind simple message
70 test/gc/node_modules/weak/build:
71 @if [ ! -f node ]; then make all; fi
72 ./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
73 --directory="$(shell pwd)/test/gc/node_modules/weak" \
74 --nodedir="$(shell pwd)"
76 test-gc: all test/gc/node_modules/weak/build
77 $(PYTHON) tools/test.py --mode=release gc
79 test-all: all test/gc/node_modules/weak/build
80 $(PYTHON) tools/test.py --mode=debug,release
84 $(PYTHON) tools/test.py --mode=debug,release --use-http1
86 test-all-valgrind: all
87 $(PYTHON) tools/test.py --mode=debug,release --valgrind
90 $(PYTHON) tools/test.py --mode=release
93 $(PYTHON) tools/test.py --mode=debug
96 $(PYTHON) tools/test.py message
99 $(PYTHON) tools/test.py simple
102 $(PYTHON) tools/test.py pummel
105 $(PYTHON) tools/test.py internet
108 ./node deps/npm/test/run.js
110 test-npm-publish: node
111 npm_package_config_publishtest=true ./node deps/npm/test/run.js
113 apidoc_sources = $(wildcard doc/api/*.markdown)
114 apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
115 $(addprefix out/,$(apidoc_sources:.markdown=.json))
117 apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos out/doc/images
119 apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
121 doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))
125 out/doc/v0.4_announcement.html \
128 out/doc/sh_javascript.min.js \
129 out/doc/sh_vim-dark.css \
131 out/doc/favicon.ico \
133 out/doc/about/index.html \
134 out/doc/community/index.html \
135 out/doc/logos/index.html \
136 out/doc/changelog.html \
139 doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ blog node
144 blog: doc/blog out/Release/node tools/blog
145 out/Release/node tools/blog/generate.js doc/blog/ out/blog/ doc/blog.html doc/rss.xml
150 out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
153 out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh node
154 bash tools/build-changelog.sh
156 out/doc/%.html: doc/%.html node
157 cat $< | sed -e 's|__VERSION__|'$(VERSION)'|g' > $@
162 out/doc/api/%.json: doc/api/%.markdown node
163 out/Release/node tools/doc/generate.js --format=json $< > $@
165 out/doc/api/%.html: doc/api/%.markdown node
166 out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
168 email.md: ChangeLog tools/email-footer.md
169 bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@
170 cat tools/email-footer.md | sed -e 's|__VERSION__|'$(VERSION)'|g' >> $@
173 cat $< | ./node tools/doc/node_modules/.bin/marked > $@
176 rsync -r out/blog/ node@nodejs.org:~/web/nodejs.org/blog/
179 rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/
180 ssh node@nodejs.org '\
181 rm -f ~/web/nodejs.org/dist/latest &&\
182 ln -s $(VERSION) ~/web/nodejs.org/dist/latest &&\
183 rm -f ~/web/nodejs.org/docs/latest &&\
184 ln -s $(VERSION) ~/web/nodejs.org/docs/latest &&\
185 rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\
186 ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz'
188 docopen: out/doc/api/all.html
189 -google-chrome out/doc/api/all.html
194 VERSION=v$(shell $(PYTHON) tools/getnodeversion.py)
195 TARNAME=node-$(VERSION)
196 TARBALL=$(TARNAME).tar.gz
197 PKG=out/$(TARNAME).pkg
198 packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
200 dist: doc $(TARBALL) $(PKG)
208 rm -rf out/deps out/Release
209 ./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32
210 $(MAKE) install V=$(V)
211 rm -rf out/deps out/Release
212 ./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64
213 $(MAKE) install V=$(V)
214 SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
215 lipo $(PKGDIR)/32/usr/local/bin/node \
216 $(PKGDIR)/usr/local/bin/node \
217 -output $(PKGDIR)/usr/local/bin/node-universal \
219 mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
222 --id "org.nodejs.Node" \
223 --doc tools/osx-pkg.pmdoc \
225 SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
228 @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
232 echo "The git repository is not clean." >&2 ; \
233 echo "Please commit changes before building release tarball." >&2 ; \
235 git status --porcelain | egrep -v '^\?\?' >&2 ; \
239 @if [ $(shell ./node --version) = "$(VERSION)" ]; then \
243 echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \
244 echo "Did you remember to update src/node_version.cc?" >&2 ; \
248 git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
249 mkdir -p $(TARNAME)/doc/api
250 cp doc/node.1 $(TARNAME)/doc/node.1
251 cp -r out/doc/api/* $(TARNAME)/doc/api/
252 rm -rf $(TARNAME)/deps/v8/test # too big
253 rm -rf $(TARNAME)/doc/images # too big
254 find $(TARNAME)/ -type l | xargs rm # annoying on windows
255 tar -cf $(TARNAME).tar $(TARNAME)
257 gzip -f -9 $(TARNAME).tar
259 dist-upload: $(TARBALL) $(PKG)
260 ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION)
261 scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL)
262 scp $(PKG) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARNAME).pkg
265 benchmark/http_simple_bench.sh
268 ./node benchmark/idle_server.js &
270 ./node benchmark/idle_clients.js &
273 PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
276 PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
279 @$(PYTHON) tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
283 .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean