aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-06-13 14:20:17 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-06-13 14:20:17 +0000
commit7b8ff22685339709c84a67fcb43147c2e4971afa (patch)
tree3119c4c8a74435b746a5d3b2dee7e4db99507d02 /Makefile
parent2f6a3179446c83c23347fc7f7aef05c51310c6db (diff)
downloadbusybox-w32-7b8ff22685339709c84a67fcb43147c2e4971afa.tar.gz
busybox-w32-7b8ff22685339709c84a67fcb43147c2e4971afa.tar.bz2
busybox-w32-7b8ff22685339709c84a67fcb43147c2e4971afa.zip
- make VERBOSE= and V= work equally; use BUILD_VERBOSE internally.
- move the link flags to cmd_link* so they are printed when requesting verbose output
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile85
1 files changed, 41 insertions, 44 deletions
diff --git a/Makefile b/Makefile
index 27e51e35e..036888e3d 100644
--- a/Makefile
+++ b/Makefile
@@ -43,18 +43,36 @@ _all:
43 43
44CONFIG_CONFIG_IN = $(top_srcdir)/Config.in 44CONFIG_CONFIG_IN = $(top_srcdir)/Config.in
45 45
46ifeq ($(KBUILD_SRC),) 46ifeq ($(BUILD_SRC),)
47
48ifdef O 47ifdef O
49 ifeq ("$(origin O)", "command line") 48 ifeq ("$(origin O)", "command line")
50 KBUILD_OUTPUT := $(O) 49 BUILD_OUTPUT := $(O)
51 top_builddir := $(O) 50 top_builddir := $(O)
52 endif 51 endif
53else 52else
54# If no alternate output-dir was specified, we build in cwd 53# If no alternate output-dir was specified, we build in cwd
55# We are using KBUILD_OUTPUT nevertheless to make sure that we create 54# We are using BUILD_OUTPUT nevertheless to make sure that we create
56# Rules.mak and the toplevel Makefile, in case they don't exist. 55# Rules.mak and the toplevel Makefile, in case they don't exist.
57 KBUILD_OUTPUT := $(top_builddir) 56 BUILD_OUTPUT := $(top_builddir)
57endif
58
59# see if we are in verbose mode
60BUILD_VERBOSE :=
61ifdef V
62 ifeq ("$(origin V)", "command line")
63 BUILD_VERBOSE := $(V)
64 endif
65endif
66ifdef VERBOSE
67 ifeq ("$(origin VERBOSE)", "command line")
68 BUILD_VERBOSE := $(VERBOSE)
69 endif
70endif
71
72ifneq ($(strip $(BUILD_VERBOSE)),)
73 export BUILD_VERBOSE
74 CHECK_VERBOSE := -v
75# ARFLAGS+=v
58endif 76endif
59 77
60ifneq ($(strip $(HAVE_DOT_CONFIG)),y) 78ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
@@ -69,40 +87,40 @@ all_tree: $(all_tree)
69$(all_tree): 87$(all_tree):
70 @mkdir -p "$@" 88 @mkdir -p "$@"
71 89
72ifneq ($(KBUILD_OUTPUT),) 90ifneq ($(BUILD_OUTPUT),)
73# Invoke a second make in the output directory, passing relevant variables 91# Invoke a second make in the output directory, passing relevant variables
74# Check that the output directory actually exists 92# Check that the output directory actually exists
75saved-output := $(KBUILD_OUTPUT) 93saved-output := $(BUILD_OUTPUT)
76KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) 94BUILD_OUTPUT := $(shell cd $(BUILD_OUTPUT) && /bin/pwd)
77$(if $(wildcard $(KBUILD_OUTPUT)),, \ 95$(if $(wildcard $(BUILD_OUTPUT)),, \
78 $(error output directory "$(saved-output)" does not exist)) 96 $(error output directory "$(saved-output)" does not exist))
79 97
80.PHONY: $(MAKECMDGOALS) 98.PHONY: $(MAKECMDGOALS)
81 99
82$(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile all_tree 100$(filter-out _all,$(MAKECMDGOALS)) _all: $(BUILD_OUTPUT)/Rules.mak $(BUILD_OUTPUT)/Makefile all_tree
83 $(Q)$(MAKE) -C $(KBUILD_OUTPUT) \ 101 $(Q)$(MAKE) -C $(BUILD_OUTPUT) \
84 top_srcdir=$(top_srcdir) \ 102 top_srcdir=$(top_srcdir) \
85 top_builddir=$(top_builddir) \ 103 top_builddir=$(top_builddir) \
86 KBUILD_SRC=$(top_srcdir) \ 104 BUILD_SRC=$(top_srcdir) \
87 -f $(CURDIR)/Makefile $@ 105 -f $(CURDIR)/Makefile $@
88 106
89$(KBUILD_OUTPUT)/Rules.mak: 107$(BUILD_OUTPUT)/Rules.mak:
90 @echo > $@ 108 @echo > $@
91 @echo top_srcdir=$(top_srcdir) >> $@ 109 @echo top_srcdir=$(top_srcdir) >> $@
92 @echo top_builddir=$(KBUILD_OUTPUT) >> $@ 110 @echo top_builddir=$(BUILD_OUTPUT) >> $@
93 @echo include $(top_srcdir)/Rules.mak >> $@ 111 @echo include $(top_srcdir)/Rules.mak >> $@
94 112
95$(KBUILD_OUTPUT)/Makefile: 113$(BUILD_OUTPUT)/Makefile:
96 @echo > $@ 114 @echo > $@
97 @echo top_srcdir=$(top_srcdir) >> $@ 115 @echo top_srcdir=$(top_srcdir) >> $@
98 @echo top_builddir=$(KBUILD_OUTPUT) >> $@ 116 @echo top_builddir=$(BUILD_OUTPUT) >> $@
99 @echo KBUILD_SRC='$$(top_srcdir)' >> $@ 117 @echo BUILD_SRC='$$(top_srcdir)' >> $@
100 @echo include '$$(KBUILD_SRC)'/Makefile >> $@ 118 @echo include '$$(BUILD_SRC)'/Makefile >> $@
101 119
102# Leave processing to above invocation of make 120# Leave processing to above invocation of make
103skip-makefile := 1 121skip-makefile := 1
104endif # ifneq ($(KBUILD_OUTPUT),) 122endif # ifneq ($(BUILD_OUTPUT),)
105endif # ifeq ($(KBUILD_SRC),) 123endif # ifeq ($(BUILD_SRC),)
106 124
107ifeq ($(skip-makefile),) 125ifeq ($(skip-makefile),)
108 126
@@ -305,13 +323,9 @@ $(LIBBUSYBOX_SONAME):
305ifndef MAJOR_VERSION 323ifndef MAJOR_VERSION
306 $(error MAJOR_VERSION needed for $@ is not defined) 324 $(error MAJOR_VERSION needed for $@ is not defined)
307endif 325endif
308 $(do_link) $(LIB_CFLAGS) $(CFLAGS_COMBINE) \ 326 $(do_link.so) \
309 -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ 327 -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
310 -Wl,-z,combreloc $(LIB_LDFLAGS) \ 328 -Wl,-z,combreloc
311 -o $(@) \
312 $(LD_START_GROUP) $(LD_WHOLE_ARCHIVE) \
313 $(LIBRARY_DEFINE) $(^) \
314 $(LD_NO_WHOLE_ARCHIVE) $(LD_END_GROUP)
315 @rm -f $(DO_INSTALL_LIBS) 329 @rm -f $(DO_INSTALL_LIBS)
316 @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done 330 @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done
317 $(do_strip) 331 $(do_strip)
@@ -319,12 +333,7 @@ endif
319endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) 333endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
320 334
321busybox_unstripped: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y) 335busybox_unstripped: .depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y)
322 $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \ 336 $(do_link)
323 -o $@ $(LD_START_GROUP) \
324 $(APPLETS_DEFINE) $(APPLET_SRC) \
325 $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) $(libraries-y) \
326 $(LDBUSYBOX) $(LIBRARIES) \
327 $(LD_END_GROUP)
328 337
329busybox: busybox_unstripped 338busybox: busybox_unstripped
330 $(Q)cp busybox_unstripped busybox 339 $(Q)cp busybox_unstripped busybox
@@ -359,18 +368,6 @@ ifneq ($(strip $(DO_INSTALL_LIBS)),n)
359 done 368 done
360endif 369endif
361 370
362# see if we are in verbose mode
363KBUILD_VERBOSE :=
364ifdef V
365 ifeq ("$(origin V)", "command line")
366 KBUILD_VERBOSE := $(V)
367 endif
368endif
369ifneq ($(strip $(KBUILD_VERBOSE)),)
370 CHECK_VERBOSE := -v
371# ARFLAGS+=v
372endif
373
374check test: busybox 371check test: busybox
375 bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite SED="$(SED)" \ 372 bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite SED="$(SED)" \
376 $(SHELL) $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE) 373 $(SHELL) $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE)