Skip to content

Commit 2ad05ae

Browse files
committed
Fix various issues associated with building on windows
1 parent b89e1c0 commit 2ad05ae

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

mk/rt.mk

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -164,41 +164,46 @@ LIBUV_DEPS := $$(wildcard \
164164
endif
165165

166166
LIBUV_GYP := $$(S)src/libuv/build/gyp
167-
LIBUV_MAKEFILE := $$(S)src/libuv/out/Makefile
167+
LIBUV_MAKEFILE_$(1)_$(2) := $$(CFG_BUILD_DIR)rt/$(1)/stage$(2)/libuv/Makefile
168168
LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
169169
uv_dtrace_header.target.mk uv_dtrace_provider.target.mk
170170

171+
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
172+
(cd $(S)src/libuv/ && \
173+
./gyp_uv -f make -Dtarget_arch=$$(HOST_$(1)) -D ninja \
174+
-Goutput_dir=$$(@D) --generator-output $$(@D))
175+
171176
# XXX: Shouldn't need platform-specific conditions here
172177
ifdef CFG_WINDOWSY_$(1)
173-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE)
174-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175-
builddir="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
176-
OS=mingw \
177-
BUILDTYPE=Release \
178-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
178+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
179+
$$(Q)rm -f $$(S)src/libuv/libuv.a
180+
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
181+
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
182+
AR="$$(AR_$(1))" \
179183
V=$$(VERBOSE)
184+
$$(Q)cp $$(S)src/libuv/libuv.a $$@
180185
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
181-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE)
182-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
186+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
187+
$$(Q)$$(MAKE) -C $$(@D) \
183188
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
184189
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
185190
CC="$$(CC_$(1))" \
186191
CXX="$$(CXX_$(1))" \
187192
AR="$$(AR_$(1))" \
188-
builddir="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
189193
host=android OS=linux \
194+
builddir="." \
190195
BUILDTYPE=Release \
191196
NO_LOAD="$$(LIBUV_NO_LOAD)" \
192197
V=$$(VERBOSE)
193198
else
194-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE)
195-
$$(Q)$$(MAKE) -C $$(S)src/libuv/out \
199+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
200+
$$(Q)$$(MAKE) -C $$(@D) \
196201
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
197202
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
198203
CC="$$(CC_$(1))" \
199204
CXX="$$(CXX_$(1))" \
200205
AR="$$(AR_$(1))" \
201-
builddir="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
206+
builddir="." \
202207
BUILDTYPE=Release \
203208
NO_LOAD="$$(LIBUV_NO_LOAD)" \
204209
V=$$(VERBOSE)
@@ -260,13 +265,6 @@ endif
260265

261266
endef
262267

263-
$(LIBUV_GYP):
264-
mkdir -p $(S)src/libuv/build
265-
git clone https://git.chromium.org/external/gyp.git $(S)src/libuv/build/gyp
266-
267-
$(LIBUV_MAKEFILE): $(LIBUV_GYP)
268-
(cd $(S)src/libuv/ && ./gyp_uv -f make)
269-
270268
# Instantiate template for all stages
271269
$(foreach stage,$(STAGES), \
272270
$(foreach target,$(CFG_TARGET_TRIPLES), \
@@ -275,6 +273,3 @@ $(foreach stage,$(STAGES), \
275273
$(LIBUV_GYP):
276274
mkdir -p $(S)src/libuv/build
277275
git clone https://git.chromium.org/external/gyp.git $(S)src/libuv/build/gyp
278-
279-
$(LIBUV_MAKEFILE): $(LIBUV_GYP)
280-
(cd $(S)src/libuv/ && ./gyp_uv -f make)

0 commit comments

Comments
 (0)