randomconfig fixes
[oweals/busybox.git] / Makefile
index aad67a1a814f3796469e6ae00adbbda133e74900..495b16cabf0d61fb0541271817707d401da6f2e8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 VERSION = 1
-PATCHLEVEL = 11
+PATCHLEVEL = 13
 SUBLEVEL = 0
 EXTRAVERSION = .svn
 NAME = Unnamed
@@ -315,6 +315,8 @@ AFLAGS_KERNEL       =
 # Use LINUXINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
 CFLAGS         := $(CFLAGS)
+# Added only to final link stage of busybox binary
+CFLAGS_busybox := $(CFLAGS_busybox)
 CPPFLAGS       := $(CPPFLAGS)
 AFLAGS         := $(AFLAGS)
 LDFLAGS                := $(LDFLAGS)
@@ -454,6 +456,7 @@ libs-y              := \
                libbb/ \
                libpwdgrp/ \
                loginutils/ \
+               mailutils/ \
                miscutils/ \
                modutils/ \
                networking/ \
@@ -503,7 +506,7 @@ endif
 # command line.
 # This allow a user to issue only 'make' to build a kernel including modules
 # Defaults busybox but it is usually overridden in the arch makefile
-all: busybox
+all: busybox doc
 
 -include $(srctree)/arch/$(ARCH)/Makefile
 
@@ -580,7 +583,7 @@ quiet_cmd_busybox__ ?= LINK    $@
       cmd_busybox__ ?= $(srctree)/scripts/trylink \
       "$@" \
       "$(CC)" \
-      "$(CFLAGS)" \
+      "$(CFLAGS) $(CFLAGS_busybox)" \
       "$(LDFLAGS) $(EXTRA_LDFLAGS)" \
       "$(core-y)" \
       "$(libs-y)" \
@@ -696,6 +699,8 @@ ifeq ($(SKIP_STRIP),y)
 else
        $(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \
                busybox_unstripped -o $@
+# strip is confused by PIE executable and does not set exec bits
+       $(Q)chmod a+x $@
 endif
 
 # The actual objects are generated when descending,
@@ -928,8 +933,9 @@ endif # CONFIG_MODULES
 # make distclean Remove editor backup files, patch leftover files and the like
 
 # Directories & files removed with 'make clean'
-CLEAN_DIRS  += $(MODVERDIR)
-CLEAN_FILES += busybox* System.map .kernelrelease \
+CLEAN_DIRS  += $(MODVERDIR) _install 0_lib
+CLEAN_FILES += busybox busybox_unstripped* busybox.links \
+                System.map .kernelrelease \
                 .tmp_kallsyms* .tmp_version .tmp_busybox* .tmp_System.map
 
 # Directories & files removed with 'make mrproper'
@@ -940,7 +946,8 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \
                  include/usage_compressed.h \
                  include/applet_tables.h \
                  applets/usage \
-                 .kernelrelease Module.symvers tags TAGS cscope*
+                 .kernelrelease Module.symvers tags TAGS cscope* \
+                 busybox_old
 
 # clean - Delete most, but leave enough to build external modules
 #
@@ -956,10 +963,16 @@ clean: archclean $(clean-dirs)
        $(call cmd,rmdirs)
        $(call cmd,rmfiles)
        @find . $(RCS_FIND_IGNORE) \
-               \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+               \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
                -type f -print | xargs rm -f
 
+PHONY += doc-clean
+doc-clean: rm-files := docs/busybox.pod \
+                 docs/BusyBox.html docs/BusyBox.1 docs/BusyBox.txt
+doc-clean:
+       $(call cmd,rmfiles)
+
 # mrproper - Delete all generated files, including .config
 #
 mrproper: rm-dirs  := $(wildcard $(MRPROPER_DIRS))
@@ -980,9 +993,9 @@ PHONY += distclean
 
 distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
-               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-               -o -name '.*.rej' -o -name '*.tmp' -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
 
@@ -1086,7 +1099,7 @@ clean:    rm-dirs := $(MODVERDIR)
 clean: $(clean-dirs)
        $(call cmd,rmdirs)
        @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \
-               \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+               \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
                -type f -print | xargs rm -f