MAJOR_VERSION :=1
MINOR_VERSION :=1
SUBLEVEL_VERSION:=1
-EXTRAVERSION :=-pre0
+EXTRAVERSION :=
VERSION :=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL_VERSION)$(EXTRAVERSION)
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
NM = $(CROSS)nm
STRIP = $(CROSS)strip
CPP = $(CC) -E
-# MAKEFILES = $(top_builddir)/.config
-RM = rm
-RM_F = $(RM) -f
-LN = ln
-LN_S = $(LN) -s
-MKDIR = mkdir
-MKDIR_P = $(MKDIR) -p
-MV = mv
-CP = cp
+SED ?= sed
# What OS are you compiling busybox for? This allows you to include
$(LD) --help | grep -q "\$(1)" && echo "-Wl,$(1)" ; \
fi)
-
-# Setup some shortcuts so that silent mode is silent like it should be
-ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS))
-export MAKE_IS_SILENT=n
-SECHO=@echo
-else
-export MAKE_IS_SILENT=y
-SECHO=-@false
-endif
-
CFLAGS+=$(call check_gcc,-funsigned-char,)
CFLAGS+=$(call check_gcc,-mmax-stack-frame=256,)
ifeq ($(CONFIG_BUILD_AT_ONCE),y)
# gcc 2.95 exits with 0 for "unrecognized option"
ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 3 ] ; echo $$?)),0)
- OPTIMIZATION+=$(call check_gcc,--combine,)
+ CFLAGS_COMBINE:=$(call check_gcc,--combine,)
endif
OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
-PROG_CFLAGS+=$(call check_gcc,-fwhole-program,)
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25795
+#PROG_CFLAGS+=$(call check_gcc,-fwhole-program,)
endif # CONFIG_BUILD_AT_ONCE
LIB_LDFLAGS:=$(call check_ld,--enable-new-dtags,)
endif
ifeq ($(strip $(TARGET_ARCH)),i386)
OPTIMIZATION+=$(call check_gcc,-march=i386,)
-# gcc-4.0 and older seem to suffer from these
-ifneq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0)
+# gcc-4.0 and older seem to benefit from these
+#ifneq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0)
OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,)
- OPTIMIZATION+=$(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,\
+ OPTIMIZATION+=$(call check_gcc,-falign-functions=1 -falign-jumps=1 -falign-loops=1,\
-malign-functions=0 -malign-jumps=0 -malign-loops=0)
-endif # gcc-4.0 and older
+#endif # gcc-4.0 and older
# gcc-4.1 and beyond seem to benefit from these
ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0)
ifeq ($(strip $(CONFIG_DEBUG)),y)
CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
LDFLAGS += $(call check_ld,--warn-common,)
- STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
else
CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
LDFLAGS += $(call check_ld,--warn-common,)
LDFLAGS += $(call check_ld,--sort-common,)
- STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
endif
+STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
ifeq ($(strip $(CONFIG_STATIC)),y)
PROG_CFLAGS += $(call check_gcc,-static,)
endif
ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
CFLAGS_PIC:= $(call check_gcc,-fPIC,)
+ LIB_CFLAGS+=$(CFLAGS_PIC)
endif
+
ifeq ($(strip $(CONFIG_SELINUX)),y)
- LIBRARIES += -lselinux
+ SELINUX_INC ?= /usr/include
+ SELINUX_LIB ?= /usr/lib
+ CFLAGS := -I$(SELINUX_INC) $(CFLAGS)
+ LDFLAGS := -L$(SELINUX_LIB) $(LDFLAGS)
+ LIBRARIES += -lselinux
endif
ifeq ($(strip $(PREFIX)),)
INSTALL_OPTS=
endif
+#------------------------------------------------------------
+# Make the output nice and tight
+MAKEFLAGS += --no-print-directory
+export MAKE_IS_SILENT=n
+ifneq ($(findstring s,$(MAKEFLAGS)),)
+export MAKE_IS_SILENT=y
+SECHO := @-false
+DISP := sil
+Q := @
+else
+ifneq ($(V)$(VERBOSE),)
+SECHO := @-false
+DISP := ver
+Q :=
+else
+SECHO := @echo
+DISP := pur
+Q := @
+endif
+endif
+
+show_objs = $(subst $(top_builddir)/,,$(subst ../,,$@))
+pur_disp_compile.c = echo " "CC $(show_objs)
+pur_disp_compile.h = echo " "HOSTCC $(show_objs)
+pur_disp_strip = echo " "STRIP $(show_objs)
+pur_disp_link = echo " "LINK $(show_objs)
+pur_disp_ar = echo " "AR $(ARFLAGS) $(show_objs)
+sil_disp_compile.c = true
+sil_disp_compile.h = true
+sil_disp_strip = true
+sil_disp_link = true
+sil_disp_ar = true
+ver_disp_compile.c = echo $(cmd_compile.c)
+ver_disp_compile.h = echo $(cmd_compile.h)
+ver_disp_strip = echo $(cmd_strip)
+ver_disp_link = echo $(cmd_link)
+ver_disp_ar = echo $(cmd_ar)
+disp_compile.c = $($(DISP)_disp_compile.c)
+disp_compile.h = $($(DISP)_disp_compile.h)
+disp_strip = $($(DISP)_disp_strip)
+disp_link = $($(DISP)_disp_link)
+disp_ar = $($(DISP)_disp_ar)
+disp_gen = $(SECHO) " "GEN $@ ; true
+disp_doc = $(SECHO) " "DOC $(subst docs/,,$@) ; true
+cmd_compile.c = $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+cmd_compile.h = $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
+cmd_strip = $(STRIPCMD) $@
+cmd_link = $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS)
+cmd_ar = $(AR) $(ARFLAGS) $@ $^
+compile.c = @$(disp_compile.c) ; $(cmd_compile.c)
+compile.h = @$(disp_compile.h) ; $(cmd_compile.h)
+do_strip = @$(disp_strip) ; $(cmd_strip)
+do_link = @$(disp_link) ; $(cmd_link)
+do_ar = @$(disp_ar) ; $(cmd_ar)
+
.PHONY: dummy