aboutsummaryrefslogtreecommitdiff
path: root/scripts/Makefile.host
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-10-30 08:25:45 +0000
committerRon Yorston <rmy@pobox.com>2022-10-30 08:25:45 +0000
commit7390f29cfc9a3cc0636e20f84f24fbd05f821720 (patch)
treeee040facd1f276cb5daf733092f137527c75630f /scripts/Makefile.host
parentd71cb67ff91762ae78e87440b87d7c9a160b2937 (diff)
downloadbusybox-w32-7390f29cfc9a3cc0636e20f84f24fbd05f821720.tar.gz
busybox-w32-7390f29cfc9a3cc0636e20f84f24fbd05f821720.tar.bz2
busybox-w32-7390f29cfc9a3cc0636e20f84f24fbd05f821720.zip
build system: allow building with w64devkit
Make some adjustments to the build system to allow busybox-w32 to be built with w64devkit: - Strip drive prefix from CURDIR in Makefile to avoid confusing make with colons. - Limit file redirection to a subshell in the usage_compressed and embedded_scripts scripts. Otherwise it isn't possible to move the open generated file on Windows. - Change the option tests in Kbuild.include to allow for /dev/null not existing on Windows. - Create host binaries without a '.exe' extension. Otherwise they're rebuilt more often than necessary. - Modify split-include.c to allow for Windows' popen() not expanding wildcards. (GitHub issue #239)
Diffstat (limited to 'scripts/Makefile.host')
-rw-r--r--scripts/Makefile.host21
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 2e628508d..0deec32e6 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -92,13 +92,30 @@ endif
92hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) 92hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags)
93hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) 93hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
94 94
95# Programs built for use on the host are defined without a suffix
96# (usually '.exe' on Windows). Rather than adjust all the makefiles
97# force a suffix of '.' if the host platform is mingw32. This will
98# result in binaries with no suffix.
99#
100# It's not a big deal if this doesn't work. MSYS2 doesn't need it
101# and the downside is just that the programs will be rebuilt more
102# often than really needed.
103#
104host_target := $(shell $(HOSTCC) -v 2>&1 | grep ^Target:)
105host_platform := $(lastword $(subst -, ,$(host_target)))
106ifeq ($(host_platform),mingw32)
107dot := .
108else
109dot :=
110endif
111
95##### 112#####
96# Compile programs on the host 113# Compile programs on the host
97 114
98# Create executable from a single .c file 115# Create executable from a single .c file
99# host-csingle -> Executable 116# host-csingle -> Executable
100quiet_cmd_host-csingle = HOSTCC $@ 117quiet_cmd_host-csingle = HOSTCC $@
101 cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \ 118 cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@$(dot) $< \
102 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 119 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
103$(host-csingle): %: %.c FORCE 120$(host-csingle): %: %.c FORCE
104 $(call if_changed_dep,host-csingle) 121 $(call if_changed_dep,host-csingle)
@@ -106,7 +123,7 @@ $(host-csingle): %: %.c FORCE
106# Link an executable based on list of .o files, all plain c 123# Link an executable based on list of .o files, all plain c
107# host-cmulti -> executable 124# host-cmulti -> executable
108quiet_cmd_host-cmulti = HOSTLD $@ 125quiet_cmd_host-cmulti = HOSTLD $@
109 cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ 126 cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@$(dot) \
110 $(addprefix $(obj)/,$($(@F)-objs)) \ 127 $(addprefix $(obj)/,$($(@F)-objs)) \
111 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 128 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
112$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE 129$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE