Skip to content

Commit 4b5be2c

Browse files
committed
Add support for specifying external include dirs and files
1 parent d482e08 commit 4b5be2c

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

  • lib/node_modules/@stdlib/math/base/assert/is-positive-zero/src

lib/node_modules/@stdlib/math/base/assert/is-positive-zero/src/Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ else
123123
LDFLAGS ?=
124124
endif
125125

126+
# List of external includes:
127+
INCLUDE ?=
128+
129+
# List of external source files:
130+
SOURCE_FILES ?=
131+
132+
# List of external object files:
133+
OBJECT_FILES ?=
134+
126135
# List of C targets:
127136
c_objects := is_positive_zero.o
128137

@@ -152,7 +161,7 @@ all: $(c_objects) $(addon_objects) addon.node wasm
152161
# This target compiles C source files.
153162

154163
$(c_objects): %.o: %.c
155-
$(QUIET) $(CC) $(CFLAGS) $(fPIC) -I ../include -c -o $@ $<
164+
$(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -I ../include -c -o $@ $<
156165

157166

158167
# Compile add-ons.
@@ -168,6 +177,7 @@ $(addon_objects): %.o: %.cpp
168177
-I "$(NODE_DIR)/deps/uv/include" \
169178
-I "$(NODE_DIR)/deps/v8/include" \
170179
-I "$(INCLUDE_NAN)" \
180+
$(INCLUDE) \
171181
-I ../include \
172182
-c \
173183
-o $@ \
@@ -183,8 +193,10 @@ $(wasm_objects): %.wasm: %.c
183193
$(EMCCFLAGS) \
184194
$(EMCC_WASM_FLAGS) \
185195
$(fPIC) \
196+
$(INCLUDE) \
186197
-I ../include \
187198
-o $*.js \
199+
$(SOURCE_FILES) \
188200
$<
189201
$(QUIET) rm -f $*.js
190202

@@ -204,7 +216,7 @@ $(wat_objects): %.wat: %.wasm
204216
# This target generates a Node.js add-on by creating a shared object which can be linked to by other libraries and executables.
205217

206218
addon.node: $(addon_objects)
207-
$(QUIET) $(LD) -shared $(LDFLAGS) $(fPIC) -o $@ $(c_objects) $<
219+
$(QUIET) $(LD) -shared $(LDFLAGS) $(fPIC) -o $@ $(OBJECT_FILES) $(c_objects) $<
208220

209221

210222
# Generate WebAssembly.

0 commit comments

Comments
 (0)