dos2unix: tiny shrink
[oweals/busybox.git] / Makefile
index 663062477c8b1163db531a301c338ca9a8d238ef..ab9698e3ed77cd768850a7bc7a7d3968d039f18c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 VERSION = 1
-PATCHLEVEL = 6
+PATCHLEVEL = 10
 SUBLEVEL = 0
 EXTRAVERSION = .svn
 NAME = Unnamed
@@ -183,11 +183,6 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
          else if [ -x /bin/bash ]; then echo /bin/bash; \
          else echo sh; fi ; fi)
 
-HOSTCC         = gcc
-HOSTCXX        = g++
-HOSTCFLAGS     = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-HOSTCXXFLAGS   = -O2
-
 #      Decide whether to build built-in, modular, or both.
 #      Normally, just do built-in.
 
@@ -262,9 +257,16 @@ export quiet Q KBUILD_VERBOSE
 # Look for make include files relative to root of kernel src
 MAKEFLAGS += --include-dir=$(srctree)
 
+HOSTCC         = gcc
+HOSTCXX        = g++
+HOSTCFLAGS     :=
+HOSTCXXFLAGS   :=
 # We need some generic definitions
 include $(srctree)/scripts/Kbuild.include
 
+HOSTCFLAGS     += $(call hostcc-option,-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer,)
+HOSTCXXFLAGS   += -O2
+
 # For maximum performance (+ possibly random breakage, uncomment
 # the following)
 
@@ -444,12 +446,14 @@ libs-y            := \
                networking/ \
                networking/libiproute/ \
                networking/udhcp/ \
+               printutils/ \
                procps/ \
                runit/ \
                selinux/ \
                shell/ \
                sysklogd/ \
                util-linux/ \
+               util-linux/volume_id/ \
 
 endif # KBUILD_EXTMOD
 
@@ -566,11 +570,14 @@ busybox-all  := $(core-y) $(libs-y)
 # Rule to link busybox - also used during CONFIG_KALLSYMS
 # May be overridden by arch/$(ARCH)/Makefile
 quiet_cmd_busybox__ ?= LINK    $@
-      cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
-      -o $@ -Wl,-M \
-      -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
-      -Wl,--start-group $(busybox-all) -Wl,--end-group \
-      $(LDLIBS)
+      cmd_busybox__ ?= $(srctree)/scripts/trylink \
+      "$@" \
+      "$(CC)" \
+      "$(CFLAGS)" \
+      "$(LDFLAGS) $(EXTRA_LDFLAGS)" \
+      "$(core-y)" \
+      "$(libs-y)" \
+      "$(LDLIBS)"
 
 # Generate System.map
 quiet_cmd_sysmap = SYSMAP
@@ -677,8 +684,12 @@ busybox_unstripped: $(busybox-all) FORCE
        $(Q)rm -f .old_version
 
 busybox: busybox_unstripped
+ifeq ($(SKIP_STRIP),y)
+       $(Q)cp $< $@
+else
        $(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \
                busybox_unstripped -o $@
+endif
 
 # The actual objects are generated when descending,
 # make sure no implicit rule kicks in
@@ -721,7 +732,7 @@ localver = $(subst $(space),, \
 # Currently, only git is supported.
 # Other SCMs can edit scripts/setlocalversion and add the appropriate
 # checks as needed.
-ifdef CONFIG_LOCALVERSION_AUTO
+ifdef _BB_DISABLED_CONFIG_LOCALVERSION_AUTO
        _localver-auto = $(shell $(CONFIG_SHELL) \
                          $(srctree)/scripts/setlocalversion $(srctree))
        localver-auto  = $(LOCALVERSION)$(_localver-auto)
@@ -754,7 +765,7 @@ PHONY += prepare-all
 # 2) Create the include2 directory, used for the second asm symlink
 prepare3: .kernelrelease
 ifneq ($(KBUILD_SRC),)
-       @echo '  Using $(srctree) as source for kernel'
+       @echo '  Using $(srctree) as source for busybox'
        $(Q)if [ -f $(srctree)/.config ]; then \
                echo "  $(srctree) is not clean, please run 'make mrproper'";\
                echo "  in the '$(srctree)' directory.";\
@@ -834,7 +845,7 @@ depend dep:
 # ---------------------------------------------------------------------------
 # Modules
 
-ifdef CONFIG_MODULES
+ifdef _BB_DISABLED_CONFIG_MODULES
 
 #      By default, build modules as well
 
@@ -920,6 +931,8 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \
                  include/autoconf.h \
                  include/bbconfigopts.h \
                  include/usage_compressed.h \
+                 include/applet_tables.h \
+                 applets/usage \
                  .kernelrelease Module.symvers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
@@ -962,7 +975,7 @@ distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-               -o -name '.*.rej' -o -size 0 \
+               -o -name '.*.rej' -o -name '*.tmp' -o -size 0 \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
                -type f -print | xargs rm -f