compressed usage broke parallel builds
Bernhard Fischer
rep.nop at aon.at
Sun May 21 18:51:57 UTC 2006
On Sun, May 21, 2006 at 06:00:43PM +0200, Yann E. MORIN wrote:
>Bernhard, Denis,
>All,
>
>On Sunday 21 May 2006 170, Bernhard Fischer wrote:
>> I'm giving up on trying to run the rest of the prerequisites of .depend
>> in parallel and just (try to) indicate that the prerequisites of .depend
>> are not to be run in parallel.
>> While this makes `make distclean defconfig;make -j´ work for me, it is
>> not a real -- longterm -- solution; FIXME
>
>Now make -j works, but is no longer // : a single job is spawned!
>So I guess it's a workaround that *disables* // builds, while still allowing
>one to call make -j, but it's clearly not a solution...
Bad idea of mine to redirect stdout to /dev/null.
>
>Sorry that my makefile-foo is so bad, I tried to find something here, and
>miserably failed... :-/
The attached patch works for me for
make distclean defconfig -f $HOME/src/bb2/Makefile top_srcdir=$HOME/src/bb2
make -j
in an empty objdir.
Can somebody please test it with their use pattern and let me know if i
broke something?
>
>Regards,
>Yann E. MORIN.
>
>--
>.-----------------.--------------------.------------------.--------------------.
>| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
>| +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ |
>| --==< °_° >==-- °---.----------------: X AGAINST | /e\ There is no |
>| web: ymorin.free.fr | SETI at home 3808 | / \ HTML MAIL | """ conspiracy. |
>°---------------------°----------------°------------------°--------------------°
>
>
-------------- next part --------------
Index: Rules.mak
===================================================================
--- Rules.mak (revision 15154)
+++ Rules.mak (working copy)
@@ -6,8 +6,8 @@
#
# Pull in the user's busybox configuration
-ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
--include $(top_builddir)/.config
+ifeq ($(strip $(filter $(noconfig_targets),$(MAKECMDGOALS))),)
+include $(top_builddir)/.config
endif
#--------------------------------------------------------
Index: Makefile
===================================================================
--- Makefile (revision 15154)
+++ Makefile (working copy)
@@ -10,7 +10,7 @@
#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allbareconfig \
- clean distclean help \
+ clean distclean help ncurses conf mconf \
release tags
# the toplevel sourcedir
@@ -79,6 +79,7 @@
top_srcdir=$(top_srcdir) \
top_builddir=$(top_builddir) \
KBUILD_SRC=$(top_srcdir) \
+ noconfig_targets="$(noconfig_targets)" \
-f $(CURDIR)/Makefile $@
$(KBUILD_OUTPUT)/Rules.mak:
@@ -104,7 +105,7 @@
# We only need a copy of the Makefile for the config targets and reuse
# the rest from the source directory, i.e. we do not cp ALL_MAKEFILES.
scripts/config/Makefile: $(top_srcdir)/scripts/config/Makefile
- cp $< $@
+ @cp $< $@
_all: all
@@ -148,7 +149,7 @@
# Default target if none was requested explicitly
all: menuconfig
-
+ifeq ($(strip $(filter $(noconfig_targets),$(MAKECMDGOALS))),)
# warn if no configuration exists and we are asked to build a non-config target
.config:
@echo ""
@@ -156,18 +157,20 @@
@echo "Please refer to 'make help', section Configuration."
@echo ""
@exit 1
-
+endif
# configuration
# ---------------------------------------------------------------------------
scripts/config/conf: scripts/config/Makefile
- $(Q)$(MAKE) -C scripts/config conf
+ $(Q)$(MAKE) noconfig_targets="$(noconfig_targets)" \
+ -C scripts/config conf
- at if [ ! -f .config ] ; then \
touch .config; \
fi
scripts/config/mconf: scripts/config/Makefile
- $(Q)$(MAKE) -C scripts/config ncurses conf mconf
+ $(Q)$(MAKE) noconfig_targets="$(noconfig_targets)" \
+ -C scripts/config ncurses conf mconf
- at if [ ! -f .config ] ; then \
touch .config; \
fi
@@ -221,9 +224,54 @@
endif # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
-include $(top_builddir)/.config
+
+# The nifty new dependency generator
+scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
+ $(do_link.h)
+
+DEP_INCLUDES := include/bb_config.h
+
+include/bb_config.h: .config
+ @if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
+ $(MAKE) -C scripts/config conf; \
+ fi;
+ @$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
+
+ifeq ($(strip $(CONFIG_FEATURE_COMPRESS_USAGE)),y)
+scripts/usage: $(top_srcdir)/scripts/usage.c
+ $(do_link.h)
+
+DEP_INCLUDES += include/usage_compressed.h
+
+$(top_srcdir)/scripts/usage_compressed: scripts/usage include/bb_config.h
+
+include/usage_compressed.h: $(top_srcdir)/scripts/usage_compressed
+ $(disp_gen)
+ $(Q)$(<) "$(top_builddir)/scripts" > $@
+
+endif # CONFIG_FEATURE_COMPRESS_USAGE
+
+ifeq ($(strip $(CONFIG_BBCONFIG)),y)
+DEP_INCLUDES += include/bbconfigopts.h
+
+include/bbconfigopts.h: .config
+ $(disp_gen)
+ $(Q)$(top_srcdir)/scripts/config/mkconfigs > $@
+endif
+
+$(top_builddir)/.depend: scripts/bb_mkdep $(DEP_INCLUDES)
+ $(disp_gen)
+ $(Q)rm -f .depend
+ $(Q)mkdir -p include/config
+ $(Q)scripts/bb_mkdep -I $(top_srcdir)/include $(top_srcdir) > $@.tmp
+ $(Q)mv $@.tmp $@
+
-include $(top_builddir)/.depend
+depend dep: .depend $(DEP_INCLUDES)
+
+
ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
libraries-y:=
# Which parts of the internal libs are requested?
@@ -296,7 +344,7 @@
endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
-busybox_unstripped: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y)
+busybox_unstripped: depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y)
$(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \
-o $@ -Wl,--start-group \
$(APPLETS_DEFINE) $(APPLET_SRC) \
@@ -358,14 +406,14 @@
$(wildcard $(patsubst %,%/Config.in,$(SRC_DIRS) ./))
.PHONY: sizes
sizes: busybox_unstripped
- $(NM) --size-sort $(<)
+ $(Q)$(NM) --size-sort $(<)
.PHONY: bloatcheck
bloatcheck: busybox_old busybox_unstripped
- @$(top_srcdir)/scripts/bloat-o-meter busybox_old busybox_unstripped
+ $(Q)$(top_srcdir)/scripts/bloat-o-meter busybox_old busybox_unstripped
.PHONY: objsizes
objsizes: busybox_unstripped
- $(SHELL) $(top_srcdir)/scripts/objsizes
+ $(Q)$(SHELL) $(top_srcdir)/scripts/objsizes
# Documentation Targets
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
@@ -400,48 +448,6 @@
docs/busybox.net/BusyBox.html
$(Q)-rm -f pod2htm*
-# The nifty new dependency stuff
-scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
- $(do_link.h)
-
-DEP_INCLUDES := include/bb_config.h
-
-ifeq ($(strip $(CONFIG_BBCONFIG)),y)
-DEP_INCLUDES += include/bbconfigopts.h
-
-include/bbconfigopts.h: .config
- $(disp_gen)
- $(Q)$(top_srcdir)/scripts/config/mkconfigs > $@
-endif
-
-ifeq ($(strip $(CONFIG_FEATURE_COMPRESS_USAGE)),y)
-USAGE_BIN:=scripts/usage
-$(USAGE_BIN): $(top_srcdir)/scripts/usage.c
- $(do_link.h)
-
-DEP_INCLUDES += include/usage_compressed.h
-
-include/usage_compressed.h: .config $(USAGE_BIN)
- $(Q)$(SHELL) $(top_srcdir)/scripts/usage_compressed "$(top_builddir)/scripts" > $@
-endif # CONFIG_FEATURE_COMPRESS_USAGE
-
-# workaround alleged bug in make-3.80, make-3.81
-.NOTPARALLEL: .depend
-
-depend dep: .depend
-.depend: scripts/bb_mkdep $(USAGE_BIN) $(DEP_INCLUDES)
- $(disp_gen)
- $(Q)rm -f .depend
- $(Q)mkdir -p include/config
- $(Q)scripts/bb_mkdep -I $(top_srcdir)/include $(top_srcdir) > $@.tmp
- $(Q)mv $@.tmp $@
-
-include/bb_config.h: .config
- @if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
- $(MAKE) -C scripts/config conf; \
- fi;
- @$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
-
clean:
- $(MAKE) -C scripts/config $@
- rm -f docs/busybox.dvi docs/busybox.ps \
More information about the busybox
mailing list