introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
[oweals/busybox.git] / Makefile
index c1103cf955d0008b7acc267f86de13ab9399d0ef..1fc6fce5b9eb9acf2aa023f8fe6aa71bef5fd6c6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 2
-SUBLEVEL = 1
+SUBLEVEL = 2
 EXTRAVERSION = .svn
 NAME = Unnamed
 
@@ -263,7 +263,7 @@ export quiet Q KBUILD_VERBOSE
 MAKEFLAGS += --include-dir=$(srctree)
 
 # We need some generic definitions
-include  $(srctree)/scripts/Kbuild.include
+include $(srctree)/scripts/Kbuild.include
 
 # For maximum performance (+ possibly random breakage, uncomment
 # the following)
@@ -302,7 +302,6 @@ AFLAGS_KERNEL       =
 CFLAGS         :=
 CPPFLAGS       :=
 AFLAGS         :=
-include $(srctree)/Makefile.flags
 
 # Read KERNELRELEASE from .kernelrelease (if it exists)
 KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
@@ -399,6 +398,7 @@ ifeq ($(config-targets),1)
 export KBUILD_DEFCONFIG
 
 config %config: scripts_basic outputmakefile FORCE
+       $(Q)mkdir -p include
        $(Q)$(MAKE) $(build)=scripts/kconfig $@
        $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
 
@@ -466,6 +466,9 @@ ifeq ($(dot-config),1)
 # To avoid any implicit rule to kick in, define an empty command
 .config .kconfig.d: ;
 
+# Now we can define CFLAGS etc according to .config
+include $(srctree)/Makefile.flags
+
 # If .config is newer than include/autoconf.h, someone tinkered
 # with it and forgot to run make oldconfig.
 # If kconfig.d is missing then we are probarly in a cleaned tree so
@@ -563,9 +566,17 @@ 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    $@
+ifdef CONFIG_STATIC
+      cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) \
+      -static \
+      -o $@ \
+      -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
+      -Wl,--start-group $(busybox-all) -Wl,--end-group
+else
       cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) -o $@ \
       -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
-      -Wl,--start-group $(busybox-all) -Wl,--end-group \
+      -Wl,--start-group $(busybox-all) -Wl,--end-group
+endif
 
 # Generate System.map
 quiet_cmd_sysmap = SYSMAP 
@@ -672,7 +683,7 @@ busybox_unstripped: $(busybox-all) FORCE
        $(Q)rm -f .old_version
 
 busybox: busybox_unstripped
-       $(Q)strip -s --remove-section=.note --remove-section=.comment \
+       $(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \
                busybox_unstripped -o $@
 
 # The actual objects are generated when descending, 
@@ -797,9 +808,6 @@ include/config/MARKER: scripts/basic/split-include include/autoconf.h
        @scripts/basic/split-include include/autoconf.h include/config
        @echo '  GEN     include/bbconfigopts.h'
        @$(srctree)/scripts/mkconfigs >include/bbconfigopts.h
-       @$(MAKE) $(build)=scripts
-       @echo '  GEN     include/usage_compressed.h'
-       @$(srctree)/scripts/usage_compressed include/usage_compressed.h scripts
        @touch $@
 
 # Generate some files
@@ -980,7 +988,7 @@ rpm: FORCE
 boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig)
 boards := $(notdir $(boards))
 
--include Makefile.help
+-include $(srctree)/Makefile.help
 
 # Documentation targets
 # ---------------------------------------------------------------------------
@@ -1274,7 +1282,7 @@ endif     # skip-makefile
 PHONY += FORCE
 FORCE:
 
--include Makefile.custom
+-include $(srctree)/Makefile.custom
 
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable se we can use it in if_changed and friends.