fixes from Vladimir Dronnikov <dronnikov@gmail.ru>
[oweals/busybox.git] / Makefile
index 16fcfeb987a909060b626d8281cae3bf8dc8bee9..5117c45504bb57300cb5ac97cf3f62fe641787fe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERSION = 1
 PATCHLEVEL = 2
 SUBLEVEL = 1
 EXTRAVERSION = .svn
-NAME=Unnamed
+NAME = Unnamed
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -563,9 +563,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