diff options
| author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-03-06 14:19:15 +0000 |
|---|---|---|
| committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-03-06 14:19:15 +0000 |
| commit | a59721166afc8be2ce0c454e4e163351ce58d76a (patch) | |
| tree | 42e18a90fd10f5175cedf4fe5210d928086535ea | |
| parent | 56ee779074e27fc6971db87073b458f56498910c (diff) | |
| download | busybox-w32-a59721166afc8be2ce0c454e4e163351ce58d76a.tar.gz busybox-w32-a59721166afc8be2ce0c454e4e163351ce58d76a.tar.bz2 busybox-w32-a59721166afc8be2ce0c454e4e163351ce58d76a.zip | |
- work around missing features and bugs in make-3.79.1:
- no order-only prerequisites; incomplete workaround (see comment in diff)
- no internal variable MAKEFILE_LIST; workaround
- define bar\nfoo:=<long-list> doesn't work; workaround
also:
- reinstate clean, distclean as noconfig_target.
- unconditionally clean libbusybox.so*
| -rw-r--r-- | Makefile | 30 |
1 files changed, 22 insertions, 8 deletions
| @@ -10,8 +10,15 @@ | |||
| 10 | #-------------------------------------------------------------- | 10 | #-------------------------------------------------------------- |
| 11 | noconfig_targets := menuconfig config oldconfig randconfig \ | 11 | noconfig_targets := menuconfig config oldconfig randconfig \ |
| 12 | defconfig allyesconfig allnoconfig allbareconfig \ | 12 | defconfig allyesconfig allnoconfig allbareconfig \ |
| 13 | clean distclean \ | ||
| 13 | release tags | 14 | release tags |
| 14 | 15 | ||
| 16 | # make-3.79.1 didn't support MAKEFILE_LIST | ||
| 17 | # for building out-of-tree, users of make-3.79 still have to pass top_srcdir= | ||
| 18 | # to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox | ||
| 19 | ifndef MAKEFILE_LIST | ||
| 20 | MAKEFILE_LIST=. | ||
| 21 | endif | ||
| 15 | # the toplevel sourcedir | 22 | # the toplevel sourcedir |
| 16 | ifndef top_srcdir | 23 | ifndef top_srcdir |
| 17 | top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd) | 24 | top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd) |
| @@ -59,6 +66,13 @@ endif | |||
| 59 | ####################################################################### | 66 | ####################################################################### |
| 60 | # Try to workaround bugs in make | 67 | # Try to workaround bugs in make |
| 61 | 68 | ||
| 69 | # make-3.79.1 didn't understand order-only prerequisites ('|'). | ||
| 70 | # Just treat them as normal prerequisites. Note that this will lead to | ||
| 71 | # spurious rebuilds. | ||
| 72 | ifeq ($(MAKE_VERSION),3.79.1) | ||
| 73 | |: ; | ||
| 74 | endif | ||
| 75 | |||
| 62 | # Workaround for bugs in make-3.80 | 76 | # Workaround for bugs in make-3.80 |
| 63 | # eval is broken if it is in a conditional | 77 | # eval is broken if it is in a conditional |
| 64 | 78 | ||
| @@ -86,7 +100,6 @@ endef | |||
| 86 | 100 | ||
| 87 | ####################################################################### | 101 | ####################################################################### |
| 88 | 102 | ||
| 89 | |||
| 90 | -include $(top_srcdir)/Rules.mak | 103 | -include $(top_srcdir)/Rules.mak |
| 91 | 104 | ||
| 92 | # Handle building out of tree | 105 | # Handle building out of tree |
| @@ -251,20 +264,21 @@ include $(patsubst %,%/Makefile.in,$(SRC_DIRS)) | |||
| 251 | # Then we need the dependencies for ..._OBJ | 264 | # Then we need the dependencies for ..._OBJ |
| 252 | define dir_pattern.o | 265 | define dir_pattern.o |
| 253 | ifeq ($(os),.os) | 266 | ifeq ($(os),.os) |
| 254 | # write patterns for both .os and .o | ||
| 255 | $(if $($(1)_OBJ.os),$($(1)_OBJ.os:.os=.o): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c) | 267 | $(if $($(1)_OBJ.os),$($(1)_OBJ.os:.os=.o): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c) |
| 256 | endif | 268 | endif |
| 257 | $(if $($(1)_OBJ$(os)),$($(1)_OBJ$(os)): $(top_builddir)/$(2)/%$(os): $(top_srcdir)/$(2)/%.c) | 269 | $(if $($(1)_OBJ$(os)),$($(1)_OBJ$(os)): $(top_builddir)/$(2)/%$(os): $(top_srcdir)/$(2)/%.c) |
| 258 | $(if $($(1)_OBJ),$($(1)_OBJ): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c) | 270 | $(if $($(1)_OBJ),$($(1)_OBJ): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c) |
| 259 | |||
| 260 | lib-obj-y+=$($(1)_OBJ) $($(1)_OBJ.o) $($(1)_OBJ.os) | ||
| 261 | lib-mobj-y+=$($(1)_MOBJ.o) $($(1)_MOBJ.os) | ||
| 262 | bin-obj-y+=$($(1)_OBJ:.os=.o) $($(1)_OBJ.o:.os=.o) $($(1)_OBJ.os:.os=.o) | ||
| 263 | bin-mobj-y+=$($(1)_MOBJ.o:.osm=.om) $($(1)_MOBJ.os:.osm=.om) | ||
| 264 | endef | 271 | endef |
| 272 | |||
| 265 | # The actual directory patterns for .o* | 273 | # The actual directory patterns for .o* |
| 266 | $(foreach d,$(DIRS),$(eval $(call dir_pattern.o,$(subst /,_,$(d)),$(d)))) | 274 | $(foreach d,$(DIRS),$(eval $(call dir_pattern.o,$(subst /,_,$(d)),$(d)))) |
| 267 | 275 | ||
| 276 | define file_lists | ||
| 277 | $($(1)$(2)) $($(1)$(2).o) $($(1)$(2).os) | ||
| 278 | endef | ||
| 279 | bin-obj-y:=$(subst .os,.o,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_OBJ))) | ||
| 280 | bin-mobj-y:=$(subst .osm,.om,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_MOBJ))) | ||
| 281 | |||
| 268 | ifeq ($(strip $(HAVE_DOT_CONFIG)),y) | 282 | ifeq ($(strip $(HAVE_DOT_CONFIG)),y) |
| 269 | # Finally pull in the dependencies (headers and other includes) of the | 283 | # Finally pull in the dependencies (headers and other includes) of the |
| 270 | # individual object files | 284 | # individual object files |
| @@ -481,7 +495,7 @@ clean: | |||
| 481 | docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \ | 495 | docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \ |
| 482 | docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \ | 496 | docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \ |
| 483 | docs/busybox.net/BusyBox.html busybox.links \ | 497 | docs/busybox.net/BusyBox.html busybox.links \ |
| 484 | $(DO_INSTALL_LIBS) $(LIBBUSYBOX_SONAME) \ | 498 | libbusybox.so* \ |
| 485 | .config.old busybox busybox_unstripped | 499 | .config.old busybox busybox_unstripped |
| 486 | - rm -r -f _install testsuite/links | 500 | - rm -r -f _install testsuite/links |
| 487 | - find . -name .\*.flags -exec rm -f {} \; | 501 | - find . -name .\*.flags -exec rm -f {} \; |
