diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 34 |
1 files changed, 25 insertions, 9 deletions
@@ -8,7 +8,7 @@ | |||
8 | #-------------------------------------------------------------- | 8 | #-------------------------------------------------------------- |
9 | # You shouldn't need to mess with anything beyond this point... | 9 | # You shouldn't need to mess with anything beyond this point... |
10 | #-------------------------------------------------------------- | 10 | #-------------------------------------------------------------- |
11 | noconfig_targets := menuconfig config oldconfig randconfig \ | 11 | noconfig_targets := menuconfig config oldconfig randconfig hosttools \ |
12 | defconfig allyesconfig allnoconfig allbareconfig \ | 12 | defconfig allyesconfig allnoconfig allbareconfig \ |
13 | clean distclean help \ | 13 | clean distclean help \ |
14 | release tags | 14 | release tags |
@@ -126,6 +126,10 @@ help: | |||
126 | @echo ' defconfig - set .config to largest generic configuration' | 126 | @echo ' defconfig - set .config to largest generic configuration' |
127 | @echo ' menuconfig - interactive curses-based configurator' | 127 | @echo ' menuconfig - interactive curses-based configurator' |
128 | @echo ' oldconfig - resolve any unresolved symbols in .config' | 128 | @echo ' oldconfig - resolve any unresolved symbols in .config' |
129 | @echo ' hosttools - build sed for the host.' | ||
130 | @echo ' You can use these commands if the commands on the host' | ||
131 | @echo ' is unusable. Afterwards use it like:' | ||
132 | @echo ' make SED="$(top_builddir)/sed"' | ||
129 | @echo | 133 | @echo |
130 | @echo 'Installation:' | 134 | @echo 'Installation:' |
131 | @echo ' install - install busybox into $(PREFIX)' | 135 | @echo ' install - install busybox into $(PREFIX)' |
@@ -210,6 +214,18 @@ allbareconfig: scripts/config/conf | |||
210 | @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config | 214 | @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config |
211 | @yes n | ./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null | 215 | @yes n | ./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null |
212 | 216 | ||
217 | hosttools: | ||
218 | $(Q)cp .config .config.bak || noold=yea | ||
219 | $(Q)$(MAKE) CC="$(HOSTCC)" CFLAGS="$(HOSTCFLAGS) $(INCS)" allnoconfig | ||
220 | $(Q)mv .config .config.in | ||
221 | $(Q)(grep -v CONFIG_SED .config.in ; \ | ||
222 | echo "CONFIG_SED=y" ; ) > .config | ||
223 | $(Q)$(MAKE) CC="$(HOSTCC)" CFLAGS="$(HOSTCFLAGS) $(INCS)" oldconfig include/bb_config.h | ||
224 | $(Q)$(MAKE) CC="$(HOSTCC)" CFLAGS="$(HOSTCFLAGS) $(INCS)" busybox | ||
225 | $(Q)[ -f .config.bak ] && mv .config.bak .config || rm .config | ||
226 | mv busybox sed | ||
227 | @echo "Now do: $(MAKE) SED=$(top_builddir)/sed <target>" | ||
228 | |||
213 | else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y) | 229 | else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y) |
214 | 230 | ||
215 | all: busybox busybox.links doc | 231 | all: busybox busybox.links doc |
@@ -287,9 +303,9 @@ endif | |||
287 | -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ | 303 | -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ |
288 | -Wl,-z,combreloc $(LIB_LDFLAGS) \ | 304 | -Wl,-z,combreloc $(LIB_LDFLAGS) \ |
289 | -o $(@) \ | 305 | -o $(@) \ |
290 | -Wl,--start-group -Wl,--whole-archive \ | 306 | $(LD_START_GROUP) $(LD_WHOLE_ARCHIVE) \ |
291 | $(LIBRARY_DEFINE) $(^) \ | 307 | $(LIBRARY_DEFINE) $(^) \ |
292 | -Wl,--no-whole-archive -Wl,--end-group | 308 | $(LD_NO_WHOLE_ARCHIVE) $(LD_END_GROUP) |
293 | @rm -f $(DO_INSTALL_LIBS) | 309 | @rm -f $(DO_INSTALL_LIBS) |
294 | @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done | 310 | @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done |
295 | $(do_strip) | 311 | $(do_strip) |
@@ -298,11 +314,11 @@ endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) | |||
298 | 314 | ||
299 | busybox_unstripped: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y) | 315 | busybox_unstripped: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y) |
300 | $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \ | 316 | $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \ |
301 | -o $@ -Wl,--start-group \ | 317 | -o $@ $(LD_START_GROUP) \ |
302 | $(APPLETS_DEFINE) $(APPLET_SRC) \ | 318 | $(APPLETS_DEFINE) $(APPLET_SRC) \ |
303 | $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) $(libraries-y) \ | 319 | $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) $(libraries-y) \ |
304 | $(LDBUSYBOX) $(LIBRARIES) \ | 320 | $(LDBUSYBOX) $(LIBRARIES) \ |
305 | -Wl,--end-group | 321 | $(LD_END_GROUP) |
306 | 322 | ||
307 | busybox: busybox_unstripped | 323 | busybox: busybox_unstripped |
308 | $(Q)cp busybox_unstripped busybox | 324 | $(Q)cp busybox_unstripped busybox |
@@ -349,8 +365,8 @@ ifneq ($(strip $(KBUILD_VERBOSE)),) | |||
349 | # ARFLAGS+=v | 365 | # ARFLAGS+=v |
350 | endif | 366 | endif |
351 | check test: busybox | 367 | check test: busybox |
352 | bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \ | 368 | bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite SED="$(SED)" \ |
353 | $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE) | 369 | $(SHELL) $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE) |
354 | 370 | ||
355 | .PHONY: checkhelp | 371 | .PHONY: checkhelp |
356 | checkhelp: | 372 | checkhelp: |
@@ -422,7 +438,7 @@ $(USAGE_BIN): $(top_srcdir)/scripts/usage.c | |||
422 | DEP_INCLUDES += include/usage_compressed.h | 438 | DEP_INCLUDES += include/usage_compressed.h |
423 | 439 | ||
424 | include/usage_compressed.h: .config $(USAGE_BIN) | 440 | include/usage_compressed.h: .config $(USAGE_BIN) |
425 | $(Q)$(SHELL) $(top_srcdir)/scripts/usage_compressed "$(top_builddir)/scripts" > $@ | 441 | $(Q)SED="$(SED)" $(SHELL) $(top_srcdir)/scripts/usage_compressed "$(top_builddir)/scripts" > $@ |
426 | endif # CONFIG_FEATURE_COMPRESS_USAGE | 442 | endif # CONFIG_FEATURE_COMPRESS_USAGE |
427 | 443 | ||
428 | # workaround alleged bug in make-3.80, make-3.81 | 444 | # workaround alleged bug in make-3.80, make-3.81 |
@@ -486,4 +502,4 @@ tags: | |||
486 | endif # ifeq ($(skip-makefile),) | 502 | endif # ifeq ($(skip-makefile),) |
487 | 503 | ||
488 | .PHONY: dummy subdirs release distclean clean config oldconfig \ | 504 | .PHONY: dummy subdirs release distclean clean config oldconfig \ |
489 | menuconfig tags check test depend dep buildtree | 505 | menuconfig tags check test depend dep buildtree hosttools |