7 # BUILDTYPE=Debug builds both release and debug builds. If you want to compile
8 # just the debug build, run `make -C out BUILDTYPE=Debug` instead.
9 ifeq ($(BUILDTYPE),Release)
10 all: out/Makefile node
12 all: out/Makefile node node_g
15 # The .PHONY is needed to ensure that we recursively use the out/Makefile
16 # to check for changes.
20 $(MAKE) -C out BUILDTYPE=Release
21 ln -fs out/Release/node node
24 $(MAKE) -C out BUILDTYPE=Debug
25 ln -fs out/Debug/node node_g
27 config.gypi: configure
31 $(MAKE) -C out BUILDTYPE=Debug
33 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
34 tools/gyp_node -f make
37 out/Release/node tools/installer.js install $(DESTDIR)
40 out/Release/node tools/installer.js uninstall
43 -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md
44 -find out/ -name '*.o' -o -name '*.a' | xargs rm -rf
51 -rm -rf node node_g blog.html email.md
55 $(PYTHON) tools/test.py --mode=release simple message
56 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
59 $(PYTHON) tools/test.py --mode=release --use-http1 simple message
62 $(PYTHON) tools/test.py --mode=release --valgrind simple message
65 @if [ ! -f node ]; then make all; fi
66 @if [ ! -d node_modules ]; then mkdir -p node_modules; fi
67 ./node deps/npm/bin/npm-cli.js install weak \
68 --nodedir="$(shell pwd)" \
69 --prefix="$(shell pwd)" --unsafe-perm # go ahead and run as root.
71 test-gc: all node_modules/weak
72 $(PYTHON) tools/test.py --mode=release gc
74 test-all: all node_modules/weak
75 $(PYTHON) tools/test.py --mode=debug,release
79 $(PYTHON) tools/test.py --mode=debug,release --use-http1
81 test-all-valgrind: all
82 $(PYTHON) tools/test.py --mode=debug,release --valgrind
85 $(PYTHON) tools/test.py --mode=release
88 $(PYTHON) tools/test.py --mode=debug
91 $(PYTHON) tools/test.py message
94 $(PYTHON) tools/test.py simple
97 $(PYTHON) tools/test.py pummel
100 $(PYTHON) tools/test.py internet
103 ./node deps/npm/test/run.js
105 test-npm-publish: node
106 npm_package_config_publishtest=true ./node deps/npm/test/run.js
108 apidoc_sources = $(wildcard doc/api/*.markdown)
109 apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
110 $(addprefix out/,$(apidoc_sources:.markdown=.json))
112 apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos out/doc/images
114 apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
116 doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))
120 out/doc/v0.4_announcement.html \
123 out/doc/sh_javascript.min.js \
124 out/doc/sh_vim-dark.css \
126 out/doc/favicon.ico \
128 out/doc/about/index.html \
129 out/doc/community/index.html \
130 out/doc/logos/index.html \
131 out/doc/changelog.html \
134 doc: program $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/
139 out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
142 out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh
143 bash tools/build-changelog.sh
145 out/doc/%.html: doc/%.html
146 cat $< | sed -e 's|__VERSION__|'$(VERSION)'|g' > $@
151 out/doc/api/%.json: doc/api/%.markdown
152 out/Release/node tools/doc/generate.js --format=json $< > $@
154 out/doc/api/%.html: doc/api/%.markdown
155 out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
157 email.md: ChangeLog tools/email-footer.md
158 bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@
159 cat tools/email-footer.md | sed -e 's|__VERSION__|'$(VERSION)'|g' >> $@
162 cat $< | ./node tools/doc/node_modules/.bin/marked > $@
165 rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/
166 ssh node@nodejs.org '\
167 rm -f ~/web/nodejs.org/dist/latest &&\
168 ln -s $(VERSION) ~/web/nodejs.org/dist/latest &&\
169 rm -f ~/web/nodejs.org/docs/latest &&\
170 ln -s $(VERSION) ~/web/nodejs.org/docs/latest &&\
171 rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\
172 ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz'
174 docopen: out/doc/api/all.html
175 -google-chrome out/doc/api/all.html
180 VERSION=v$(shell $(PYTHON) tools/getnodeversion.py)
181 TARNAME=node-$(VERSION)
182 TARBALL=$(TARNAME).tar.gz
183 PKG=out/$(TARNAME).pkg
184 packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
186 dist: doc $(TARBALL) $(PKG)
194 rm -rf out/deps out/Release
195 ./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32
197 rm -rf out/deps out/Release
198 ./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64
200 lipo $(PKGDIR)/32/usr/local/bin/node \
201 $(PKGDIR)/usr/local/bin/node \
202 -output $(PKGDIR)/usr/local/bin/node-universal \
204 mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
207 --id "org.nodejs.NodeJS-$(VERSION)" \
208 --doc tools/osx-pkg.pmdoc \
211 $(TARBALL): node out/doc
212 @if [ $(shell ./node --version) = "$(VERSION)" ]; then \
216 echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \
217 echo "Did you remember to update src/node_version.cc?" >&2 ; \
221 git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
222 mkdir -p $(TARNAME)/doc/api
223 cp doc/node.1 $(TARNAME)/doc/node.1
224 cp -r out/doc/api/* $(TARNAME)/doc/api/
225 rm -rf $(TARNAME)/deps/v8/test # too big
226 rm -rf $(TARNAME)/doc/images # too big
227 find $(TARNAME)/ -type l | xargs rm # annoying on windows
228 tar -cf $(TARNAME).tar $(TARNAME)
230 gzip -f -9 $(TARNAME).tar
232 dist-upload: $(TARBALL) $(PKG)
233 ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION)
234 scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL)
235 scp $(PKG) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARNAME).pkg
238 benchmark/http_simple_bench.sh
241 ./node benchmark/idle_server.js &
243 ./node benchmark/idle_clients.js &
246 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
249 @$(PYTHON) tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
253 .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all program staticlib dynamiclib test test-all website-upload pkg