@@ -24,8 +24,8 @@ DEPS_ELECTRON_URL ?= https://github.com/electron/electron/releases/download/v$(D
2424# Determine the basename for the download:
2525deps_electron_basename := $(notdir $(DEPS_ELECTRON_URL ) )
2626
27- # Define the path to the file containing a checksum verify a download:
28- DEPS_ELECTRON_CHECKSUM ?= $(shell cat $(DEPS_CHECKSUMS_DIR ) /$(subst .,_,$(subst -,_,$(deps_electron_basename ) ) ) /sha256)
27+ # Define the path to the file containing a checksum to verify a download:
28+ DEPS_ELECTRON_CHECKSUM ?= $(shell $( CAT ) $(DEPS_CHECKSUMS_DIR ) /$(subst .,_,$(subst -,_,$(deps_electron_basename ) ) ) /sha256)
2929
3030# Define the output path when downloading:
3131DEPS_ELECTRON_DOWNLOAD_OUT ?= $(DEPS_TMP_DIR ) /$(deps_electron_basename )
@@ -72,96 +72,109 @@ deps_electron_prereqs := \
7272deps_electron_dest := $(NODE_MODULES ) /@stdlib/electron
7373
7474
75- # TARGETS #
75+ # RULES #
7676
77- # Download.
77+ # /
78+ # Downloads an Electron distribution.
7879#
79- # This target downloads an Electron distribution.
80-
80+ # @private
81+ # /
8182$(DEPS_ELECTRON_DOWNLOAD_OUT ) : | $(DEPS_TMP_DIR )
8283 $(QUIET ) echo ' Downloading Electron...' >&2
8384 $(QUIET ) $(DEPS_DOWNLOAD_BIN ) $(DEPS_ELECTRON_URL ) $(DEPS_ELECTRON_DOWNLOAD_OUT )
8485
85-
86- # Path .
86+ # /
87+ # Creates a text file containing the executable path .
8788#
88- # This target creates a text file containing the executable path.
89-
89+ # @private
90+ # /
9091$(DEPS_ELECTRON_BUILD_OUT ) /path.txt : | $(DEPS_BUILD_DIR )
9192 $(QUIET ) $(MKDIR_RECURSIVE ) $(DEPS_ELECTRON_BUILD_OUT )
9293 $(QUIET ) printf $(deps_electron_path ) > $(DEPS_ELECTRON_BUILD_OUT ) /path.txt
9394
94-
95- # Main entry point.
95+ # /
96+ # Creates the main entry point for a Node.js wrapper package .
9697#
97- # This target creates the main entry point for the Node.js wrapper package.
98-
98+ # @private
99+ # /
99100$(DEPS_ELECTRON_BUILD_OUT ) /index.js : | $(DEPS_BUILD_DIR )
100101 $(QUIET ) $(MKDIR_RECURSIVE ) $(DEPS_ELECTRON_BUILD_OUT )
101102 $(QUIET ) printf $(deps_electron_index ) > $(DEPS_ELECTRON_BUILD_OUT ) /index.js
102103
103-
104- # Command -line interface.
104+ # /
105+ # Creates a Node.js Electron command -line interface (CLI) .
105106#
106- # This target creates the Node.js Electron command-line interface (CLI).
107-
107+ # @private
108+ # /
108109$(DEPS_ELECTRON_BUILD_OUT ) /cli.js : | $(DEPS_BUILD_DIR )
109110 $(QUIET ) $(MKDIR_RECURSIVE ) $(DEPS_ELECTRON_BUILD_OUT )
110111 $(QUIET ) printf $(deps_electron_cli ) > $(DEPS_ELECTRON_BUILD_OUT ) /cli.js
111112
112-
113- # Package.json .
113+ # /
114+ # Creates an Node.js Electron package meta data file .
114115#
115- # This target creates the Node.js Electron package meta data file.
116-
116+ # @private
117+ # /
117118$(DEPS_ELECTRON_BUILD_OUT ) /package.json : | $(DEPS_BUILD_DIR )
118119 $(QUIET ) $(MKDIR_RECURSIVE ) $(DEPS_ELECTRON_BUILD_OUT )
119120 $(QUIET ) printf $(deps_electron_package_json ) > $(DEPS_ELECTRON_BUILD_OUT ) /package.json
120121
121-
122- # Extract .
122+ # /
123+ # Extracts a downloaded Electron ZIP archive .
123124#
124- # This target extracts a ZIP archive.
125-
125+ # @private
126+ # /
126127$(DEPS_ELECTRON_BUILD_OUT ) : $(DEPS_ELECTRON_DOWNLOAD_OUT ) $(deps_electron_prereqs ) | $(DEPS_BUILD_DIR )
127128 $(QUIET ) echo ' Extracting Electron...' >&2
128129 $(QUIET ) $(MKDIR_RECURSIVE ) $(DEPS_ELECTRON_BUILD_OUT ) /dist
129130 $(QUIET ) $(UNZIP ) -q $(DEPS_ELECTRON_DOWNLOAD_OUT ) -d $@ /dist
130131
131-
132- # Download Electron.
132+ # /
133+ # Downloads an Electron distribution .
133134#
134- # This target downloads an Electron distribution.
135-
135+ # @private
136+ #
137+ # @example
138+ # make deps-download-electron
139+ # /
136140deps-download-electron : $(DEPS_ELECTRON_DOWNLOAD_OUT )
137141
138142.PHONY : deps-download-electron
139143
140-
141- # Verify download .
144+ # /
145+ # Verifies a downloaded Electron distribution .
142146#
143- # This targets verifies a download.
144-
147+ # @private
148+ #
149+ # @example
150+ # make deps-verify-electron
151+ # /
145152deps-verify-electron : deps-download-electron
146153 $(QUIET ) echo ' Verifying download...' >&2
147154 $(QUIET ) $(DEPS_CHECKSUM_BIN ) $(DEPS_ELECTRON_DOWNLOAD_OUT ) $(DEPS_ELECTRON_CHECKSUM ) >&2
148155
149156.PHONY : deps-verify-electron
150157
151-
152- # Extract Electron.
158+ # /
159+ # Extracts an Electron download .
153160#
154- # This target extracts an Electron download.
155-
161+ # @private
162+ #
163+ # @example
164+ # make deps-extract-electron
165+ # /
156166deps-extract-electron : $(DEPS_ELECTRON_BUILD_OUT )
157167
158168.PHONY : deps-extract-electron
159169
160-
161- # Test install .
170+ # /
171+ # Tests an Electron installation .
162172#
163- # This target tests an installation.
164-
173+ # @private
174+ #
175+ # @example
176+ # make deps-test-electron
177+ # /
165178deps-test-electron : $(DEPS_ELECTRON_BUILD_OUT ) /cli.js
166179 $(QUIET ) echo ' Running tests...' >&2
167180 $(QUIET ) $(NODE ) $< --version >&2
@@ -170,33 +183,40 @@ deps-test-electron: $(DEPS_ELECTRON_BUILD_OUT)/cli.js
170183
171184.PHONY : deps-test-electron
172185
173-
174- # Install Electron.
186+ # /
187+ # Installs Electron.
175188#
176- # This target installs Electron.
177-
189+ # @example
190+ # make install-deps-electron
191+ # /
178192install-deps-electron : deps-download-electron deps-verify-electron deps-extract-electron deps-test-electron
179193 $(QUIET ) $(MKDIR_RECURSIVE ) $(deps_electron_dest )
180194 $(QUIET ) $(CP ) -rp $(DEPS_ELECTRON_BUILD_OUT ) /* $(deps_electron_dest )
181195
182196.PHONY : install-deps-electron
183197
184-
185- # Clean Electron.
198+ # /
199+ # Removes an Electron distribution .
186200#
187- # This target removes an Electron distribution (but does not remove an Electron download if one exists).
188-
201+ # ## Notes
202+ #
203+ # - This recipe does **not** remove an Electron download if one exists.
204+ #
205+ # @example
206+ # make clean-deps-electron
207+ # /
189208clean-deps-electron : clean-deps-electron-tests
190209 $(QUIET ) $(DELETE ) $(DELETE_FLAGS ) $(DEPS_ELECTRON_BUILD_OUT )
191210 $(QUIET ) $(DELETE ) $(DELETE_FLAGS ) $(deps_electron_dest )
192211
193212.PHONY : clean-deps-electron
194213
195-
196- # Clean tests .
214+ # /
215+ # Removes Electron installation test artifacts .
197216#
198- # This targets remove installation tests.
199-
217+ # @example
218+ # make clean-deps-electron-tests
219+ # /
200220clean-deps-electron-tests :
201221
202222.PHONY : clean-deps-electron-tests
0 commit comments