aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2004-10-27 01:50:54 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2004-10-27 01:50:54 +0200
commit6a7cb7739139cd5994a2be73e9c4088a70a568c2 (patch)
tree183b00d4f9ed52d3fde756c19cc72c5fd03b8b40 /Makefile
parent403f291258456ffc3beb40bc92c0006569e20bc0 (diff)
parent1ceee1b789e4c34b677eacabc39d99b0d6132d0f (diff)
downloadhistory-6a7cb7739139cd5994a2be73e9c4088a70a568c2.tar.gz
Merge bk://linux-sam.bkbits.net/kbuild
into mars.ravnborg.org:/home/sam/bk/to-linus
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 35 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 4316689a8f9157..15eb1cc457a3ab 100644
--- a/Makefile
+++ b/Makefile
@@ -157,7 +157,7 @@ endif
LOCALVERSION = $(subst $(space),, \
$(shell cat /dev/null $(localversion-files)) \
- $(subst ",,$(CONFIG_LOCALVERSION)))
+ $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)
@@ -295,6 +295,11 @@ check_gcc = $(warning check_gcc is deprecated - use cc-option) \
cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
+# cc-option-align
+# Prefix align with either -falign or -malign
+cc-option-align = $(subst -functions=0,,\
+ $(call cc-option,-falign-functions=0,-malign-functions=0))
+
# cc-version
# Usage gcc-ver := $(call cc-version $(CC))
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
@@ -379,6 +384,18 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV
scripts_basic:
$(Q)$(MAKE) $(build)=scripts/basic
+.PHONY: outputmakefile
+# outputmakefile generate a Makefile to be placed in output directory, if
+# using a seperate output directory. This allows convinient use
+# of make in output directory
+outputmakefile:
+ $(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
+ $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
+ $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \
+ > $(objtree)/Makefile; \
+ echo ' GEN $(objtree)/Makefile'; \
+ fi
+
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
# It is allowed to specify more targets when calling make, including
@@ -423,9 +440,9 @@ ifeq ($(config-targets),1)
# *config targets only - make sure prerequisites are updated, and descend
# in scripts/kconfig to make the *config target
-config: scripts_basic FORCE
+config: scripts_basic outputmakefile FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
-%config: scripts_basic FORCE
+%config: scripts_basic outputmakefile FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
else
@@ -486,7 +503,16 @@ else
CFLAGS += -O2
endif
-ifndef CONFIG_FRAME_POINTER
+#Add align options if CONFIG_CC_* is not equal to 0
+add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1)))
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions)
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels)
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops)
+CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)
+
+ifdef CONFIG_FRAME_POINTER
+CFLAGS += -fno-omit-frame-pointer
+else
CFLAGS += -fomit-frame-pointer
endif
@@ -711,22 +737,12 @@ $(vmlinux-dirs): prepare-all scripts
.PHONY: prepare-all prepare prepare0 prepare1 prepare2
-# prepare 2 generate Makefile to be placed in output directory, if
-# using a seperate output directory. This allows convinient use
-# of make in output directory
-prepare2:
- $(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
- $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
- $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \
- > $(objtree)/Makefile; \
- fi
-
-# prepare1 is used to check if we are building in a separate output directory,
+# prepare2 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
# 2) Create the include2 directory, used for the second asm symlink
-prepare1: prepare2
+prepare2:
ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel'
$(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \
@@ -738,6 +754,9 @@ ifneq ($(KBUILD_SRC),)
$(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
endif
+# prepare1 creates a makefile if using a separate output directory
+prepare1: prepare2 outputmakefile
+
prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER
ifneq ($(KBUILD_MODULES),)
$(Q)rm -rf $(MODVERDIR)