aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-06-24 18:07:55 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-24 18:07:55 -0400
commit070b98bfda3d27269519067c1c67eaef695f3e0c (patch)
treee389ac93cadba08a955bae1baf0f2513867e6067
parente838db685fcfd2e9a0548ffc5cb9447e6c3c11be (diff)
kbuild: trivial fixes in Makefile
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--Makefile82
1 files changed, 41 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index a21c3192e8c9..1c558a43f8e7 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ endif
71# In both cases the working directory must be the root of the kernel src. 71# In both cases the working directory must be the root of the kernel src.
72# 1) O= 72# 1) O=
73# Use "make O=dir/to/store/output/files/" 73# Use "make O=dir/to/store/output/files/"
74# 74#
75# 2) Set KBUILD_OUTPUT 75# 2) Set KBUILD_OUTPUT
76# Set the environment variable KBUILD_OUTPUT to point to the directory 76# Set the environment variable KBUILD_OUTPUT to point to the directory
77# where the output files shall be placed. 77# where the output files shall be placed.
@@ -185,13 +185,13 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
185 else if [ -x /bin/bash ]; then echo /bin/bash; \ 185 else if [ -x /bin/bash ]; then echo /bin/bash; \
186 else echo sh; fi ; fi) 186 else echo sh; fi ; fi)
187 187
188HOSTCC = gcc 188HOSTCC = gcc
189HOSTCXX = g++ 189HOSTCXX = g++
190HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 190HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
191HOSTCXXFLAGS = -O2 191HOSTCXXFLAGS = -O2
192 192
193# Decide whether to build built-in, modular, or both. 193# Decide whether to build built-in, modular, or both.
194# Normally, just do built-in. 194# Normally, just do built-in.
195 195
196KBUILD_MODULES := 196KBUILD_MODULES :=
197KBUILD_BUILTIN := 1 197KBUILD_BUILTIN := 1
@@ -199,7 +199,7 @@ KBUILD_BUILTIN := 1
199# If we have only "make modules", don't compile built-in objects. 199# If we have only "make modules", don't compile built-in objects.
200# When we're building modules with modversions, we need to consider 200# When we're building modules with modversions, we need to consider
201# the built-in objects during the descend as well, in order to 201# the built-in objects during the descend as well, in order to
202# make sure the checksums are uptodate before we record them. 202# make sure the checksums are up to date before we record them.
203 203
204ifeq ($(MAKECMDGOALS),modules) 204ifeq ($(MAKECMDGOALS),modules)
205 KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) 205 KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
@@ -232,7 +232,7 @@ export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
232# 232#
233# If $(quiet) is empty, the whole command will be printed. 233# If $(quiet) is empty, the whole command will be printed.
234# If it is set to "quiet_", only the short version will be printed. 234# If it is set to "quiet_", only the short version will be printed.
235# If it is set to "silent_", nothing wil be printed at all, since 235# If it is set to "silent_", nothing will be printed at all, since
236# the variable $(silent_cmd_cc_o_c) doesn't exist. 236# the variable $(silent_cmd_cc_o_c) doesn't exist.
237# 237#
238# A simple variant is to prefix commands with $(Q) - that's useful 238# A simple variant is to prefix commands with $(Q) - that's useful
@@ -268,7 +268,7 @@ MAKEFLAGS += --include-dir=$(srctree)
268include $(srctree)/scripts/Kbuild.include 268include $(srctree)/scripts/Kbuild.include
269 269
270# Do not use make's built-in rules and variables 270# Do not use make's built-in rules and variables
271# This increases performance and avoid hard-to-debug behaviour 271# This increases performance and avoid hard-to-debug behavour
272MAKEFLAGS += -rR 272MAKEFLAGS += -rR
273 273
274# Make variables (CC, etc...) 274# Make variables (CC, etc...)
@@ -306,21 +306,21 @@ LINUXINCLUDE := -Iinclude \
306 306
307CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) 307CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
308 308
309CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 309CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
310 -fno-strict-aliasing -fno-common 310 -fno-strict-aliasing -fno-common
311AFLAGS := -D__ASSEMBLY__ 311AFLAGS := -D__ASSEMBLY__
312 312
313# Read KERNELRELEASE from include/config/kernel.release (if it exists) 313# Read KERNELRELEASE from include/config/kernel.release (if it exists)
314KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) 314KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
315KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 315KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
316 316
317export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \ 317export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
318 ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ 318export ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
319 CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ 319export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
320 HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS 320export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
321 321
322export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS 322export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
323export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE 323export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
324export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 324export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
325 325
326# When compiling out-of-tree modules, put MODVERDIR in the module 326# When compiling out-of-tree modules, put MODVERDIR in the module
@@ -358,7 +358,7 @@ endif
358# catch them early, and hand them over to scripts/kconfig/Makefile 358# catch them early, and hand them over to scripts/kconfig/Makefile
359# It is allowed to specify more targets when calling make, including 359# It is allowed to specify more targets when calling make, including
360# mixing *config targets and build targets. 360# mixing *config targets and build targets.
361# For example 'make oldconfig all'. 361# For example 'make oldconfig all'.
362# Detect when mixed targets is specified, and make a second invocation 362# Detect when mixed targets is specified, and make a second invocation
363# of make so .config is not included in this case either (for *config). 363# of make so .config is not included in this case either (for *config).
364 364
@@ -417,7 +417,7 @@ else
417ifeq ($(KBUILD_EXTMOD),) 417ifeq ($(KBUILD_EXTMOD),)
418# Additional helpers built in scripts/ 418# Additional helpers built in scripts/
419# Carefully list dependencies so we do not try to build scripts twice 419# Carefully list dependencies so we do not try to build scripts twice
420# in parrallel 420# in parallel
421PHONY += scripts 421PHONY += scripts
422scripts: scripts_basic include/config/auto.conf 422scripts: scripts_basic include/config/auto.conf
423 $(Q)$(MAKE) $(build)=$(@) 423 $(Q)$(MAKE) $(build)=$(@)
@@ -443,7 +443,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
443 443
444# If .config is newer than include/config/auto.conf, someone tinkered 444# If .config is newer than include/config/auto.conf, someone tinkered
445# with it and forgot to run make oldconfig. 445# with it and forgot to run make oldconfig.
446# if auto.conf.cmd is missing then we are probarly in a cleaned tree so 446# if auto.conf.cmd is missing then we are probably in a cleaned tree so
447# we execute the config step to be sure to catch updated Kconfig files 447# we execute the config step to be sure to catch updated Kconfig files
448include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd 448include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
449ifeq ($(KBUILD_EXTMOD),) 449ifeq ($(KBUILD_EXTMOD),)
@@ -460,7 +460,7 @@ endif
460# The all: target is the default when no target is given on the 460# The all: target is the default when no target is given on the
461# command line. 461# command line.
462# This allow a user to issue only 'make' to build a kernel including modules 462# This allow a user to issue only 'make' to build a kernel including modules
463# Defaults vmlinux but it is usually overriden in the arch makefile 463# Defaults vmlinux but it is usually overridden in the arch makefile
464all: vmlinux 464all: vmlinux
465 465
466ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 466ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
@@ -492,11 +492,11 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
492# warn about C99 declaration after statement 492# warn about C99 declaration after statement
493CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) 493CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
494 494
495# disable pointer signedness warnings in gcc 4.0 495# disable pointer signed / unsigned warnings in gcc 4.0
496CFLAGS += $(call cc-option,-Wno-pointer-sign,) 496CFLAGS += $(call cc-option,-Wno-pointer-sign,)
497 497
498# Default kernel image to build when no specific target is given. 498# Default kernel image to build when no specific target is given.
499# KBUILD_IMAGE may be overruled on the commandline or 499# KBUILD_IMAGE may be overruled on the command line or
500# set in the environment 500# set in the environment
501# Also any assignments in arch/$(ARCH)/Makefile take precedence over 501# Also any assignments in arch/$(ARCH)/Makefile take precedence over
502# this default value 502# this default value
@@ -510,7 +510,7 @@ export INSTALL_PATH ?= /boot
510# 510#
511# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory 511# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
512# relocations required by build roots. This is not defined in the 512# relocations required by build roots. This is not defined in the
513# makefile but the arguement can be passed to make if needed. 513# makefile but the argument can be passed to make if needed.
514# 514#
515 515
516MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 516MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
@@ -556,7 +556,7 @@ libs-y := $(libs-y1) $(libs-y2)
556 556
557# Build vmlinux 557# Build vmlinux
558# --------------------------------------------------------------------------- 558# ---------------------------------------------------------------------------
559# vmlinux is build from the objects selected by $(vmlinux-init) and 559# vmlinux is built from the objects selected by $(vmlinux-init) and
560# $(vmlinux-main). Most are built-in.o files from top-level directories 560# $(vmlinux-main). Most are built-in.o files from top-level directories
561# in the kernel tree, others are specified in arch/$(ARCH)Makefile. 561# in the kernel tree, others are specified in arch/$(ARCH)Makefile.
562# Ordering when linking is important, and $(vmlinux-init) must be first. 562# Ordering when linking is important, and $(vmlinux-init) must be first.
@@ -607,7 +607,7 @@ quiet_cmd_vmlinux_version = GEN .version
607 $(MAKE) $(build)=init 607 $(MAKE) $(build)=init
608 608
609# Generate System.map 609# Generate System.map
610quiet_cmd_sysmap = SYSMAP 610quiet_cmd_sysmap = SYSMAP
611 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap 611 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
612 612
613# Link of vmlinux 613# Link of vmlinux
@@ -754,10 +754,10 @@ _localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
754localver = $(subst $(space),, \ 754localver = $(subst $(space),, \
755 $(shell cat /dev/null $(_localver)) \ 755 $(shell cat /dev/null $(_localver)) \
756 $(patsubst "%",%,$(CONFIG_LOCALVERSION))) 756 $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
757 757
758# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called 758# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
759# and if the SCM is know a tag from the SCM is appended. 759# and if the SCM is know a tag from the SCM is appended.
760# The appended tag is determinded by the SCM used. 760# The appended tag is determined by the SCM used.
761# 761#
762# Currently, only git is supported. 762# Currently, only git is supported.
763# Other SCMs can edit scripts/setlocalversion and add the appropriate 763# Other SCMs can edit scripts/setlocalversion and add the appropriate
@@ -823,14 +823,14 @@ prepare0: archprepare FORCE
823# All the preparing.. 823# All the preparing..
824prepare prepare-all: prepare0 824prepare prepare-all: prepare0
825 825
826# Leave this as default for preprocessing vmlinux.lds.S, which is now 826# Leave this as default for preprocessing vmlinux.lds.S, which is now
827# done in arch/$(ARCH)/kernel/Makefile 827# done in arch/$(ARCH)/kernel/Makefile
828 828
829export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) 829export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
830 830
831# FIXME: The asm symlink changes when $(ARCH) changes. That's 831# FIXME: The asm symlink changes when $(ARCH) changes. That's
832# hard to detect, but I suppose "make mrproper" is a good idea 832# hard to detect, but I suppose "make mrproper" is a good idea
833# before switching between archs anyway. 833# before switching between archs anyway.
834 834
835include/asm: 835include/asm:
836 @echo ' SYMLINK $@ -> include/asm-$(ARCH)' 836 @echo ' SYMLINK $@ -> include/asm-$(ARCH)'
@@ -870,7 +870,7 @@ depend dep:
870 870
871ifdef CONFIG_MODULES 871ifdef CONFIG_MODULES
872 872
873# By default, build modules as well 873# By default, build modules as well
874 874
875all: modules 875all: modules
876 876
@@ -968,7 +968,7 @@ clean: archclean $(clean-dirs)
968 $(call cmd,rmdirs) 968 $(call cmd,rmdirs)
969 $(call cmd,rmfiles) 969 $(call cmd,rmfiles)
970 @find . $(RCS_FIND_IGNORE) \ 970 @find . $(RCS_FIND_IGNORE) \
971 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 971 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
972 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 972 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
973 -o -name '*.symtypes' \) \ 973 -o -name '*.symtypes' \) \
974 -type f -print | xargs rm -f 974 -type f -print | xargs rm -f
@@ -993,9 +993,9 @@ PHONY += distclean
993 993
994distclean: mrproper 994distclean: mrproper
995 @find $(srctree) $(RCS_FIND_IGNORE) \ 995 @find $(srctree) $(RCS_FIND_IGNORE) \
996 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ 996 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
997 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ 997 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
998 -o -name '.*.rej' -o -size 0 \ 998 -o -name '.*.rej' -o -size 0 \
999 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ 999 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
1000 -type f -print | xargs rm -f 1000 -type f -print | xargs rm -f
1001 1001
@@ -1088,7 +1088,7 @@ else # KBUILD_EXTMOD
1088# make M=dir modules Make all modules in specified dir 1088# make M=dir modules Make all modules in specified dir
1089# make M=dir Same as 'make M=dir modules' 1089# make M=dir Same as 'make M=dir modules'
1090# make M=dir modules_install 1090# make M=dir modules_install
1091# Install the modules build in the module directory 1091# Install the modules built in the module directory
1092# Assumes install directory is already created 1092# Assumes install directory is already created
1093 1093
1094# We are always building modules 1094# We are always building modules
@@ -1147,7 +1147,7 @@ clean: rm-dirs := $(MODVERDIR)
1147clean: $(clean-dirs) 1147clean: $(clean-dirs)
1148 $(call cmd,rmdirs) 1148 $(call cmd,rmdirs)
1149 @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ 1149 @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \
1150 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1150 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
1151 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ 1151 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
1152 -type f -print | xargs rm -f 1152 -type f -print | xargs rm -f
1153 1153
@@ -1186,7 +1186,7 @@ else
1186ALLINCLUDE_ARCHS := $(ARCH) 1186ALLINCLUDE_ARCHS := $(ARCH)
1187endif 1187endif
1188else 1188else
1189#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behaviour. 1189#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behavour.
1190ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) 1190ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
1191endif 1191endif
1192 1192