@@ -63,11 +63,17 @@ V ?= 1
63
63
# BUILDTYPE=Debug builds both release and debug builds. If you want to compile
64
64
# just the debug build, run `make -C out BUILDTYPE=Debug` instead.
65
65
ifeq ($(BUILDTYPE ) ,Release)
66
- all : out/Makefile $(NODE_EXE )
66
+ all : out/Makefile $(NODE_EXE ) # # Default target, builds node in out/Release/node.
67
67
else
68
68
all : out/Makefile $(NODE_EXE ) $(NODE_G_EXE )
69
69
endif
70
70
71
+ # To add a target to the help, add a double comment (##) on the target line.
72
+ help : # # Print help for targets with comments.
73
+ @printf " For more targets and info see the comments in the Makefile.\n\n"
74
+ @grep -E ' ^[a-zA-Z0-9._-]+:.*?## .*$$' Makefile | sort | \
75
+ awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
76
+
71
77
# The .PHONY is needed to ensure that we recursively use the out/Makefile
72
78
# to check for changes.
73
79
.PHONY : $(NODE_EXE ) $(NODE_G_EXE )
@@ -94,13 +100,13 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
94
100
config.gypi : configure
95
101
$(error Missing or stale $@ , please run ./$< )
96
102
97
- install : all
103
+ install : all # # Installs node into $PREFIX (default=/usr/local).
98
104
$(PYTHON ) tools/install.py $@ ' $(DESTDIR)' ' $(PREFIX)'
99
105
100
- uninstall :
106
+ uninstall : # # Uninstalls node from $PREFIX (default=/usr/local).
101
107
$(PYTHON ) tools/install.py $@ ' $(DESTDIR)' ' $(PREFIX)'
102
108
103
- clean :
109
+ clean : # # Remove build artifacts.
104
110
$(RM ) -r out/Makefile $(NODE_EXE ) $(NODE_G_EXE ) out/$(BUILDTYPE ) /$(NODE_EXE ) \
105
111
out/$(BUILDTYPE ) /node.exp
106
112
@if [ -d out ]; then find out/ -name ' *.o' -o -name ' *.a' -o -name ' *.d' | xargs $(RM ) -r; fi
@@ -145,7 +151,7 @@ coverage-clean:
145
151
# For C++ coverage reporting, this needs to be run in conjunction with configure
146
152
# --coverage. html coverage reports will be created under coverage/
147
153
148
- coverage : coverage-test
154
+ coverage : coverage-test # # Run the tests and generate a coverage report.
149
155
150
156
coverage-build : all
151
157
mkdir -p node_modules
206
212
$(MAKE ) -C deps/v8 $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
207
213
208
214
ifeq ($(NODE_TARGET_TYPE ) ,static_library)
209
- test : all
215
+ test : all # # Default test target. Runs default tests, linters, and builds docs.
210
216
$(MAKE ) cctest
211
217
else
212
218
test : all
@@ -378,7 +384,7 @@ test-build: | all build-addons build-addons-napi
378
384
379
385
test-build-addons-napi : all build-addons-napi
380
386
381
- test-all : test-build test/gc/build/Release/binding.node
387
+ test-all : test-build test/gc/build/Release/binding.node # # Run everything in test/.
382
388
$(PYTHON ) tools/test.py --mode=debug,release
383
389
384
390
test-all-valgrind : test-build
@@ -457,7 +463,7 @@ test-doc: doc-only
457
463
test-known-issues : all
458
464
$(PYTHON ) tools/test.py known_issues
459
465
460
- test-npm : $(NODE_EXE )
466
+ test-npm : $(NODE_EXE ) # # Run the npm test suite on deps/npm.
461
467
$(NODE ) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test-node
462
468
463
469
test-npm-publish : $(NODE_EXE )
@@ -499,7 +505,7 @@ test-with-async-hooks:
499
505
500
506
501
507
ifneq ("","$(wildcard deps/v8/tools/run-tests.py) ")
502
- test-v8 : v8
508
+ test-v8 : v8 # # Runs the V8 test suite on deps/v8.
503
509
# note: performs full test unless QUICKCHECK is specified
504
510
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \
505
511
--mode =$(BUILDTYPE_LOWER ) $(V8_TEST_OPTIONS ) $(QUICKCHECK_ARG ) \
@@ -865,7 +871,7 @@ ifeq ($(XZ), 0)
865
871
endif
866
872
$(RM) $(TARNAME).tar
867
873
868
- tar : $(TARBALL )
874
+ tar : $(TARBALL ) # # Create a source tarball.
869
875
870
876
tar-upload : tar
871
877
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) "
@@ -901,7 +907,7 @@ ifeq ($(XZ), 0)
901
907
endif
902
908
$(RM) $(TARNAME)-headers.tar
903
909
904
- tar-headers : $(TARBALL ) -headers
910
+ tar-headers : $(TARBALL ) -headers # # Build the node header tarball.
905
911
906
912
tar-headers-upload : tar-headers
907
913
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) "
@@ -938,7 +944,7 @@ ifeq ($(XZ), 0)
938
944
endif
939
945
$(RM) $(BINARYNAME).tar
940
946
941
- binary : $(BINARYTAR )
947
+ binary : $(BINARYTAR ) # # Build release binary tarballs.
942
948
943
949
binary-upload : binary
944
950
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) "
@@ -989,7 +995,7 @@ bench-dgram: all
989
995
990
996
bench-all : bench bench-misc bench-array bench-buffer bench-url bench-events bench-dgram bench-util
991
997
992
- bench : bench-net bench-http bench-fs bench-tls
998
+ bench : bench-net bench-http bench-fs bench-tls # # Run node benchmarks.
993
999
994
1000
bench-ci : bench
995
1001
@@ -1115,7 +1121,7 @@ cpplint: lint-cpp
1115
1121
@echo " Please use lint-cpp instead of cpplint"
1116
1122
1117
1123
ifneq ("","$(wildcard tools/eslint/) ")
1118
- lint :
1124
+ lint : # # Run JS, C++, MD and doc linters.
1119
1125
@EXIT_STATUS=0 ; \
1120
1126
$(MAKE ) lint-js || EXIT_STATUS=$$? ; \
1121
1127
$(MAKE ) lint-cpp || EXIT_STATUS=$$? ; \
@@ -1181,6 +1187,7 @@ lint-clean:
1181
1187
docclean \
1182
1188
docopen \
1183
1189
dynamiclib \
1190
+ help \
1184
1191
install \
1185
1192
install-bin \
1186
1193
install-includes \
0 commit comments