@@ -66,18 +66,13 @@ endif
66
66
# to check for changes.
67
67
.PHONY : $(NODE_EXE ) $(NODE_G_EXE )
68
68
69
- # The -r/-L check stops it recreating the link if it is already in place,
70
- # otherwise $(NODE_EXE) being a .PHONY target means it is always re-run.
71
- # Without the check there is a race condition between the link being deleted
72
- # and recreated which can break the addons build when running test-ci
73
- # See comments on the build-addons target for some more info
74
69
$(NODE_EXE ) : config.gypi out/Makefile
75
70
$(MAKE ) -C out BUILDTYPE=Release V=$(V )
76
- if [ ! -r $@ -o ! -L $@ ] ; then ln -fs out/Release/$( NODE_EXE) $@ ; fi
71
+ ln -fs out/Release/$(NODE_EXE ) $@
77
72
78
73
$(NODE_G_EXE ) : config.gypi out/Makefile
79
74
$(MAKE ) -C out BUILDTYPE=Debug V=$(V )
80
- if [ ! -r $@ -o ! -L $@ ] ; then ln -fs out/Debug/$( NODE_EXE) $@ ; fi
75
+ ln -fs out/Debug/$(NODE_EXE ) $@
81
76
82
77
out/Makefile : common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
83
78
deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \
191
186
tools/make-v8.sh
192
187
$(MAKE ) -C deps/v8 $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
193
188
194
- test : all
195
- $(MAKE ) build-addons
196
- $(MAKE ) build-addons-napi
189
+ test : build-addons
197
190
$(MAKE ) cctest
198
191
$(PYTHON ) tools/test.py --mode=release -J \
199
192
doctool inspector known_issues message pseudo-tty parallel sequential $(CI_NATIVE_SUITES )
@@ -205,99 +198,6 @@ test-parallel: all
205
198
test-valgrind : all
206
199
$(PYTHON ) tools/test.py --mode=release --valgrind sequential parallel message
207
200
208
- # Implicitly depends on $(NODE_EXE). We don't depend on it explicitly because
209
- # it always triggers a rebuild due to it being a .PHONY rule. See the comment
210
- # near the build-addons rule for more background.
211
- test/gc/build/Release/binding.node : test/gc/binding.cc test/gc/binding.gyp
212
- $(NODE ) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
213
- --python=" $( PYTHON) " \
214
- --directory=" $( shell pwd) /test/gc" \
215
- --nodedir=" $( shell pwd) "
216
-
217
- # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
218
- DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md
219
-
220
- ifeq ($(OSTYPE ) ,aix)
221
- DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS ) out/$(BUILDTYPE ) /node.exp
222
- endif
223
-
224
- test/addons/.docbuildstamp : $(DOCBUILDSTAMP_PREREQS )
225
- $(RM ) -r test/addons/?? _* /
226
- $(NODE ) $<
227
- touch $@
228
-
229
- ADDONS_BINDING_GYPS := \
230
- $(filter-out test/addons/??_* /binding.gyp, \
231
- $(wildcard test/addons/* /binding.gyp) )
232
-
233
- ADDONS_BINDING_SOURCES := \
234
- $(filter-out test/addons/??_* /* .cc, $(wildcard test/addons/* /* .cc) ) \
235
- $(filter-out test/addons/??_* /* .h, $(wildcard test/addons/* /* .h) )
236
-
237
- # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
238
- # Depends on node-gyp package.json so that build-addons is (re)executed when
239
- # node-gyp is updated as part of an npm update.
240
- test/addons/.buildstamp : config.gypi \
241
- deps/npm/node_modules/node-gyp/package.json \
242
- $(ADDONS_BINDING_GYPS ) $(ADDONS_BINDING_SOURCES ) \
243
- deps/uv/include/* .h deps/v8/include/* .h \
244
- src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \
245
- test/addons/.docbuildstamp
246
- # Cannot use $(wildcard test/addons/*/) here, it's evaluated before
247
- # embedded addons have been generated from the documentation.
248
- @for dirname in test/addons/*/; do \
249
- printf "\nBuilding addon $$PWD/$$dirname\n" ; \
250
- env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \
251
- --loglevel=$(LOGLEVEL) rebuild \
252
- --python="$(PYTHON)" \
253
- --directory="$$PWD/$$dirname" \
254
- --nodedir="$$PWD" || exit 1 ; \
255
- done
256
- touch $@
257
-
258
- # .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
259
- # directly because it calls make recursively. The parent make cannot know
260
- # if the subprocess touched anything so it pessimistically assumes that
261
- # .buildstamp and .docbuildstamp are out of date and need a rebuild.
262
- # Just goes to show that recursive make really is harmful...
263
- # TODO(bnoordhuis) Force rebuild after gyp update.
264
- build-addons : $(NODE_EXE ) test/addons/.buildstamp
265
-
266
- ADDONS_NAPI_BINDING_GYPS := \
267
- $(filter-out test/addons-napi/??_* /binding.gyp, \
268
- $(wildcard test/addons-napi/* /binding.gyp) )
269
-
270
- ADDONS_NAPI_BINDING_SOURCES := \
271
- $(filter-out test/addons-napi/??_* /* .cc, $(wildcard test/addons-napi/* /* .cc) ) \
272
- $(filter-out test/addons-napi/??_* /* .h, $(wildcard test/addons-napi/* /* .h) )
273
-
274
- # Implicitly depends on $(NODE_EXE), see the build-addons-napi rule for rationale.
275
- test/addons-napi/.buildstamp : config.gypi \
276
- deps/npm/node_modules/node-gyp/package.json \
277
- $(ADDONS_NAPI_BINDING_GYPS ) $(ADDONS_NAPI_BINDING_SOURCES ) \
278
- deps/uv/include/* .h deps/v8/include/* .h \
279
- src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \
280
- src/node_api.h src/node_api_types.h
281
- # Cannot use $(wildcard test/addons-napi/*/) here, it's evaluated before
282
- # embedded addons have been generated from the documentation.
283
- @for dirname in test/addons-napi/*/; do \
284
- printf "\nBuilding addon $$PWD/$$dirname\n" ; \
285
- env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \
286
- --loglevel=$(LOGLEVEL) rebuild \
287
- --python="$(PYTHON)" \
288
- --directory="$$PWD/$$dirname" \
289
- --nodedir="$$PWD" || exit 1 ; \
290
- done
291
- touch $@
292
-
293
- # .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
294
- # directly because it calls make recursively. The parent make cannot know
295
- # if the subprocess touched anything so it pessimistically assumes that
296
- # .buildstamp and .docbuildstamp are out of date and need a rebuild.
297
- # Just goes to show that recursive make really is harmful...
298
- # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
299
- build-addons-napi : $(NODE_EXE ) test/addons-napi/.buildstamp
300
-
301
201
clear-stalled :
302
202
# Clean up any leftover processes but don't error if found.
303
203
ps awwx | grep Release/node | grep -v grep | cat
@@ -306,28 +206,25 @@ clear-stalled:
306
206
echo $$ {PS_OUT} | xargs kill ; \
307
207
fi
308
208
309
- test-gc : all test/gc/ build/Release/binding.node
209
+ test-gc : build-addons
310
210
$(PYTHON ) tools/test.py --mode=release gc
311
211
312
- test-gc-clean :
313
- $(RM ) -r test/gc/build
314
-
315
- test-build : | all build-addons build-addons-napi
212
+ # Builds test/addons, test/addons-napi and test/gc.
213
+ build-addons : $(NODE_EXE )
214
+ ./$< tools/build-addons.js
316
215
317
- test-build-addons-napi : all build-addons-napi
318
-
319
- test-all : test-build test/gc/build/Release/binding.node
216
+ test-all : build-addons
320
217
$(PYTHON ) tools/test.py --mode=debug,release
321
218
322
- test-all-valgrind : test- build
219
+ test-all-valgrind : build-addons
323
220
$(PYTHON ) tools/test.py --mode=debug,release --valgrind
324
221
325
222
CI_NATIVE_SUITES := addons addons-napi
326
223
CI_JS_SUITES := doctool inspector known_issues message parallel pseudo-tty sequential
327
224
328
225
# Build and test addons without building anything else
329
226
test-ci-native : LOGLEVEL := info
330
- test-ci-native : | test/addons/.buildstamp test/addons-napi/.buildstamp
227
+ test-ci-native : build-addons
331
228
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
332
229
--mode=release --flaky-tests=$(FLAKY_TESTS ) \
333
230
$(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -345,7 +242,7 @@ test-ci-js: | clear-stalled
345
242
fi
346
243
347
244
test-ci : LOGLEVEL := info
348
- test-ci : | clear-stalled build-addons build-addons-napi
245
+ test-ci : | clear-stalled build-addons
349
246
out/Release/cctest --gtest_output=tap:cctest.tap
350
247
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
351
248
--mode=release --flaky-tests=$(FLAKY_TESTS ) \
@@ -357,13 +254,13 @@ test-ci: | clear-stalled build-addons build-addons-napi
357
254
echo $$ {PS_OUT} | xargs kill ; exit 1; \
358
255
fi
359
256
360
- test-release : test- build
257
+ test-release : build-addons
361
258
$(PYTHON ) tools/test.py --mode=release
362
259
363
- test-debug : test- build
260
+ test-debug : build-addons
364
261
$(PYTHON ) tools/test.py --mode=debug
365
262
366
- test-message : test- build
263
+ test-message : build-addons
367
264
$(PYTHON ) tools/test.py message
368
265
369
266
test-simple : | cctest # Depends on 'all'.
@@ -397,16 +294,17 @@ test-npm: $(NODE_EXE)
397
294
test-npm-publish : $(NODE_EXE )
398
295
npm_package_config_publishtest=true $(NODE ) deps/npm/test/run.js
399
296
400
- test-addons-napi : test-build-addons-napi
401
- $(PYTHON ) tools/test.py --mode=release addons-napi
402
-
403
- test-addons : test-build test-addons-napi
297
+ test-addons : build-addons
404
298
$(PYTHON ) tools/test.py --mode=release addons
405
299
300
+ test-addons-napi : build-addons
301
+ $(PYTHON ) tools/test.py --mode=release addons-napi
302
+
406
303
test-addons-clean :
407
304
$(RM ) -rf test/addons/?? _* /
408
305
$(RM ) -rf test/addons/* /build
409
- $(RM ) test/addons/.buildstamp test/addons/.docbuildstamp
306
+ $(RM ) -rf test/addons/Release/
307
+ $(RM ) -rf test/addons/include/
410
308
411
309
test-timers :
412
310
$(MAKE ) --directory=tools faketime
@@ -934,7 +832,6 @@ endif
934
832
blog \
935
833
blogclean \
936
834
build-addons \
937
- build-addons-napi \
938
835
build-ci \
939
836
cctest \
940
837
check \
@@ -974,7 +871,6 @@ endif
974
871
test-ci-js \
975
872
test-ci-native \
976
873
test-gc \
977
- test-gc-clean \
978
874
test-v8 \
979
875
test-v8-all \
980
876
test-v8-benchmarks \
0 commit comments