aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-03-06 14:19:15 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-03-06 14:19:15 +0000
commita59721166afc8be2ce0c454e4e163351ce58d76a (patch)
tree42e18a90fd10f5175cedf4fe5210d928086535ea
parent56ee779074e27fc6971db87073b458f56498910c (diff)
downloadbusybox-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--Makefile30
1 files changed, 22 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index c6d6635a2..fffc52466 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,15 @@
10#-------------------------------------------------------------- 10#--------------------------------------------------------------
11noconfig_targets := menuconfig config oldconfig randconfig \ 11noconfig_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
19ifndef MAKEFILE_LIST
20MAKEFILE_LIST=.
21endif
15# the toplevel sourcedir 22# the toplevel sourcedir
16ifndef top_srcdir 23ifndef top_srcdir
17top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd) 24top_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.
72ifeq ($(MAKE_VERSION),3.79.1)
73|: ;
74endif
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
252define dir_pattern.o 265define dir_pattern.o
253ifeq ($(os),.os) 266ifeq ($(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)
256endif 268endif
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
260lib-obj-y+=$($(1)_OBJ) $($(1)_OBJ.o) $($(1)_OBJ.os)
261lib-mobj-y+=$($(1)_MOBJ.o) $($(1)_MOBJ.os)
262bin-obj-y+=$($(1)_OBJ:.os=.o) $($(1)_OBJ.o:.os=.o) $($(1)_OBJ.os:.os=.o)
263bin-mobj-y+=$($(1)_MOBJ.o:.osm=.om) $($(1)_MOBJ.os:.osm=.om)
264endef 271endef
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
276define file_lists
277$($(1)$(2)) $($(1)$(2).o) $($(1)$(2).os)
278endef
279bin-obj-y:=$(subst .os,.o,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_OBJ)))
280bin-mobj-y:=$(subst .osm,.om,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_MOBJ)))
281
268ifeq ($(strip $(HAVE_DOT_CONFIG)),y) 282ifeq ($(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 {} \;