Skip to content

Commit e79b550

Browse files
committed
Move files and reorganize
1 parent 627e64e commit e79b550

File tree

7 files changed

+121
-63
lines changed

7 files changed

+121
-63
lines changed

tools/make/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ include $(TOOLS_MAKE_LIB_DIR)/links/Makefile
8888
include $(TOOLS_MAKE_LIB_DIR)/lint/Makefile
8989
include $(TOOLS_MAKE_LIB_DIR)/ls/Makefile
9090
include $(TOOLS_MAKE_LIB_DIR)/markdown/Makefile
91-
include $(TOOLS_MAKE_LIB_DIR)/node/Makefile
9291
include $(TOOLS_MAKE_LIB_DIR)/notes/Makefile
9392
include $(TOOLS_MAKE_LIB_DIR)/repl/Makefile
9493
include $(TOOLS_MAKE_LIB_DIR)/stats/Makefile

tools/make/lib/install/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
# limitations under the License.
1717
#/
1818

19+
# DEPENDENCIES #
20+
21+
# Please keep in alphabetical order...
22+
include $(TOOLS_MAKE_LIB_DIR)/install/node.mk
23+
24+
1925
# RULES #
2026

2127
#/
@@ -24,6 +30,6 @@
2430
# @example
2531
# make install
2632
#/
27-
install: install-node
33+
install: install-node clean-deps-electron install-deps-electron
2834

2935
.PHONY: install

tools/make/lib/install/README.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ limitations under the License.
2626

2727
<section class="intro">
2828

29-
This directory contains [`make`][make] rules for running the project's installation processes.
29+
This directory contains [`make`][make] rules for running the project's installation processes (e.g., managing [Node.js][node-js] environments, including `node_modules` dependencies and Node.js native [add-ons][node-js-add-ons]).
30+
31+
- [Commands](#commands)
32+
33+
- [Install](#install)
34+
- [Node.js](#nodejs)
3035

3136
</section>
3237

@@ -54,6 +59,72 @@ Runs the project's install sequence.
5459
$ make install
5560
```
5661

62+
* * *
63+
64+
<a name="nodejs"></a>
65+
66+
### Node.js
67+
68+
#### install-node
69+
70+
Installs node modules dependencies and compiles native [add-ons][node-js-add-ons].
71+
72+
<!-- run-disable -->
73+
74+
```bash
75+
$ make install-node
76+
```
77+
78+
#### clean-node
79+
80+
Runs cleanup tasks specific to Node.js, such as removing node modules dependencies and compiled native [add-ons][node-js-add-ons].
81+
82+
<!-- run-disable -->
83+
84+
```bash
85+
$ make clean-node
86+
```
87+
88+
#### install-node-modules
89+
90+
Installs node modules dependencies.
91+
92+
<!-- run-disable -->
93+
94+
```bash
95+
$ make install-node-modules
96+
```
97+
98+
#### clean-node-modules
99+
100+
Removes node modules dependencies.
101+
102+
<!-- run-disable -->
103+
104+
```bash
105+
$ make clean-node-modules
106+
```
107+
108+
#### install-node-addons
109+
110+
Compiles Node.js native [add-ons][node-js-add-ons].
111+
112+
<!-- run-disable -->
113+
114+
```bash
115+
$ make install-node-addons
116+
```
117+
118+
#### clean-node-addons
119+
120+
Removes Node.js native [add-ons][node-js-add-ons].
121+
122+
<!-- run-disable -->
123+
124+
```bash
125+
$ make clean-node-addons
126+
```
127+
57128
</section>
58129

59130
<!-- /.usage -->
@@ -72,6 +143,10 @@ $ make install
72143

73144
[make]: https://www.gnu.org/software/make/
74145

146+
[node-js]: https://nodejs.org/en/
147+
148+
[node-js-add-ons]: https://nodejs.org/api/addons.html
149+
75150
</section>
76151

77152
<!-- /.links -->
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020

2121
# Define the path of the executable for [node-gyp][1].
2222
#
23-
# To install `node-gyp`:
24-
#
25-
# ```bash
26-
# $ npm install node-gyp
27-
# ```
28-
#
2923
# [1]: https://github.com/nodejs/node-gyp
3024
NODE_GYP ?= $(BIN_DIR)/node-gyp
3125

@@ -54,12 +48,18 @@ endif
5448
install_node_addons_list_addons_flags := "--pattern $(node_addons_pattern)"
5549

5650

57-
# TARGETS #
51+
# RULES #
5852

59-
# Install add-ons.
53+
#/
54+
# Installs Node.js native add-ons.
6055
#
61-
# This target installs native add-ons. If unable to install a native add-on, the target prints an error message and proceeds to try installing the next add-on.
62-
56+
# ## Notes
57+
#
58+
# - If unable to install a native add-on, the target prints an error message and proceeds to try installing the next add-on.
59+
#
60+
# @example
61+
# make install-node-addons
62+
#/
6363
install-node-addons: $(NODE_MODULES) clean-node-addons
6464
$(QUIET) $(MAKE) LIST_PACKAGE_ADDONS_FLAGS=$(install_node_addons_list_addons_flags) -f $(this_file) list-pkgs-addons | while read -r pkg; do \
6565
if echo "$$pkg" | grep -v '^\/.*\|^[a-zA-Z]:.*' >/dev/null; then \
@@ -77,11 +77,12 @@ install-node-addons: $(NODE_MODULES) clean-node-addons
7777

7878
.PHONY: install-node-addons
7979

80-
81-
# Remove add-ons.
80+
#/
81+
# Removes all compiled and generated files for Node.js native add-ons.
8282
#
83-
# This target removes all compiled and generated files for native add-ons.
84-
83+
# @example
84+
# make clean-node-addons
85+
#/
8586
clean-node-addons:
8687
$(QUIET) $(MAKE) LIST_PACKAGE_ADDONS_FLAGS=$(install_node_addons_list_addons_flags) -f $(this_file) list-pkgs-addons | while read -r pkg; do \
8788
if echo "$$pkg" | grep -v '^\/.*\|^[a-zA-Z]:.*' >/dev/null; then \
Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,37 @@
1818

1919
# DEPENDENCIES #
2020

21-
include $(TOOLS_MAKE_LIB_DIR)/node/addons.mk
22-
include $(TOOLS_MAKE_LIB_DIR)/node/modules.mk
21+
# Please keep in alphabetical order...
22+
include $(TOOLS_MAKE_LIB_DIR)/install/addons.mk
23+
include $(TOOLS_MAKE_LIB_DIR)/install/modules.mk
2324

2425

25-
# TARGETS #
26+
# RULES #
2627

27-
# Run Node install sequence.
28+
#/
29+
# Runs the Node.js install sequence.
2830
#
29-
# This target runs the Node install sequence, including installing node module dependencies and compiling native add-ons.
30-
31-
install-node: install-node-modules install-node-addons clean-deps-electron install-deps-electron
31+
# ## Notes
32+
#
33+
# - This recipe installs node module dependencies and compiles native add-ons.
34+
#
35+
# @example
36+
# make install-node
37+
#/
38+
install-node: install-node-modules install-node-addons
3239

3340
.PHONY: install-node
3441

35-
36-
# Perform Node clean-up.
42+
#/
43+
# Runs cleanup tasks specific to Node.js.
3744
#
38-
# This target runs cleanup tasks specific to Node.js, such as removing node module dependencies and removing native add-ons.
39-
45+
# ## Notes
46+
#
47+
# - This recipe removes node module dependencies and native add-ons.
48+
#
49+
# @example
50+
# make clean-node
51+
#/
4052
clean-node: clean-node-addons clean-node-modules
4153

4254
.PHONY: clean-node

tools/make/lib/node/README.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)