Apply style from top to bottom;
some spelling and syntax fixes;
(sane) reordering of MAKEFLAGS.
Signed-off-by: Oleg Verych <[EMAIL PROTECTED]>
---
Examples of what can be done to unify overall style of the file.
Makefile | 383 ++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 199 insertions(+), 184 deletions(-)
Index: linux-2.6.19-rc2-git7/Makefile
===================================================================
--- linux-2.6.19-rc2-git7.orig/Makefile 2006-10-22 15:52:14.896215956 +0000
+++ linux-2.6.19-rc2-git7/Makefile 2006-10-23 03:51:27.931367282 +0000
@@ -10,8 +10,15 @@
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
-# Do not print "Entering directory ..."
-MAKEFLAGS += --no-print-directory
+# Do not:
+# o use make's built-in rules and variables
+# (this increases performance and avoid hard-to-debug behavour);
+# o print "Entering directory ...";
+MAKEFLAGS += -rR --no-print-directory
+
+# Look for make include files relative to root of kernel src, where
+# users usually run `make'.
+MAKEFLAGS += --include-dir=$(PWD)
# We are using a recursive build, so we need to do a little thinking
# to get the ordering right.
@@ -93,15 +100,16 @@
# KBUILD_SRC is not intended to be used by the regular user (for now)
ifeq ($(KBUILD_SRC),)
-# OK, Make called in directory where kernel src resides
-# Do we want to locate output files in a separate directory?
+# OK, `make' is called in the directory, where kernel src resides.
+# Overwrite environment with command line option, to locate
+# output files in a separate directory.
ifdef O
ifeq ("$(origin O)", "command line")
KBUILD_OUTPUT := $(O)
endif
endif
-# That's our default target when none is given on the command line
+# That's our default target, when none is given on the command line.
PHONY := _all
_all:
@@ -120,16 +128,16 @@
KBUILD_SRC=$(CURDIR) \
KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@
-# Leave processing to above invocation of make
+# Leave processing to above invocation of make.
skip-makefile := 1
endif # ifneq ($(KBUILD_OUTPUT),)
endif # ifeq ($(KBUILD_SRC),)
-# We process the rest of the Makefile if this is the final invocation of make
+# We process the rest of the Makefile if this is the final invocation of make.
ifeq ($(skip-makefile),)
-# If building an external module we do not care about the all: rule
-# but instead _all depend on modules
+# If building an external module we do not care about the all: rule,
+# but instead _all depend on modules.
PHONY += all
ifeq ($(KBUILD_EXTMOD),)
_all: all
@@ -183,14 +191,14 @@
CROSS_COMPILE ?=
# Architecture as present in compile.h
-UTS_MACHINE := $(ARCH)
+UTS_MACHINE := $(ARCH)
KCONFIG_CONFIG ?= .config
# SHELL used by kbuild
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
- else if [ -x /bin/bash ]; then echo /bin/bash; \
- else echo sh; fi ; fi)
+ else if [ -x /bin/bash ]; then echo /bin/bash; \
+ else echo sh; fi ; fi)
HOSTCC = gcc
HOSTCXX = g++
@@ -203,18 +211,18 @@
KBUILD_MODULES :=
KBUILD_BUILTIN := 1
-# If we have only "make modules", don't compile built-in objects.
-# When we're building modules with modversions, we need to consider
-# the built-in objects during the descend as well, in order to
-# make sure the checksums are up to date before we record them.
+# If we have only "make modules", don't compile built-in objects.
+# When we're building modules with modversions, we need to consider
+# the built-in objects during the descend as well, in order to
+# make sure the checksums are up to date before we record them.
ifeq ($(MAKECMDGOALS),modules)
KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
endif
-# If we have "make <whatever> modules", compile modules
-# in addition to whatever we do anyway.
-# Just "make" or "make all" shall build modules as well
+# If we have "make <whatever> modules", compile modules
+# in addition to whatever we do anyway.
+# Just "make" or "make all" shall build modules as well.
ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
KBUILD_MODULES := 1
@@ -268,16 +276,9 @@
export quiet Q KBUILD_VERBOSE
-# Look for make include files relative to root of kernel src
-MAKEFLAGS += --include-dir=$(srctree)
-
# We need some generic definitions
include $(srctree)/scripts/Kbuild.include
-# Do not use make's built-in rules and variables
-# This increases performance and avoid hard-to-debug behavour
-MAKEFLAGS += -rR
-
# Make variables (CC, etc...)
AS = $(CROSS_COMPILE)as
@@ -296,7 +297,8 @@
PERL = perl
CHECK = sparse
-CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise
$(CF)
+CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF)
+
MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS)
@@ -333,12 +335,20 @@
# When compiling out-of-tree modules, put MODVERDIR in the module
# tree rather than in the kernel tree. The kernel tree might
# even be read-only.
-export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword
$(KBUILD_EXTMOD))/).tmp_versions
+MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions
+export MODVERDIR
# Files to ignore in find ... statements
-RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS
-o -name .pc -o -name .hg -o -name .git \) -prune -o
-export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn
--exclude CVS --exclude .pc --exclude .hg --exclude .git
+RCS_FIND_IGNORE := \( -name SCCS -o -name .svn -o -name CVS -o -name
.pc \
+ -o -name .hg -o -name .git \) -prune
+
+# ... and tar statements
+
+RCS_TAR_IGNORE := --exclude SCCS --exclude .svn --exclude CVS --exclude .pc \
+ --exclude .hg --exclude .git
+
+export RCS_TAR_IGNORE
# ===========================================================================
# Rules shared between *config targets and build targets
@@ -379,18 +389,18 @@
dot-config := 1
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
- ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
- dot-config := 0
- endif
+ ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
+ dot-config := 0
+ endif
endif
ifeq ($(KBUILD_EXTMOD),)
- ifneq ($(filter config %config,$(MAKECMDGOALS)),)
- config-targets := 1
- ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
- mixed-targets := 1
- endif
- endif
+ ifneq ($(filter config %config,$(MAKECMDGOALS)),)
+ config-targets := 1
+ ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+ mixed-targets := 1
+ endif
+ endif
endif
ifeq ($(mixed-targets),1)
@@ -458,7 +468,7 @@
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
else
# external modules needs include/linux/autoconf.h and include/config/auto.conf
-# but do not care if they are up-to-date. Use auto.conf to trigger the test
+# but do not care if they are up-to-date. Use auto.conf to trigger the test.
PHONY += include/config/auto.conf
include/config/auto.conf:
@@ -473,7 +483,7 @@
endif # KBUILD_EXTMOD
else
-# Dummy target needed, because used as prerequisite
+# Dummy target is needed, because used as prerequisite.
include/config/auto.conf: ;
endif # $(dot-config)
@@ -484,58 +494,58 @@
all: vmlinux
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-CFLAGS += -Os
+CFLAGS += -Os
else
-CFLAGS += -O2
+CFLAGS += -O2
endif
include $(srctree)/arch/$(ARCH)/Makefile
ifdef CONFIG_FRAME_POINTER
-CFLAGS += -fno-omit-frame-pointer $(call
cc-option,-fno-optimize-sibling-calls,)
+CFLAGS += -fno-omit-frame-pointer \
+ $(call cc-option,-fno-optimize-sibling-calls,)
else
-CFLAGS += -fomit-frame-pointer
+CFLAGS += -fomit-frame-pointer
endif
ifdef CONFIG_UNWIND_INFO
-CFLAGS += -fasynchronous-unwind-tables
-LDFLAGS_vmlinux += --eh-frame-hdr
+CFLAGS += -fasynchronous-unwind-tables
+LDFLAGS_vmlinux += --eh-frame-hdr
endif
ifdef CONFIG_DEBUG_INFO
-CFLAGS += -g
+CFLAGS += -g
endif
# Force gcc to behave correct even for buggy distributions
-CFLAGS += $(call cc-option, -fno-stack-protector)
+CFLAGS += $(call cc-option, -fno-stack-protector)
# arch Makefile may override CC so keep this after arch Makefile is included
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
CHECKFLAGS += $(NOSTDINC_FLAGS)
# warn about C99 declaration after statement
-CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
+CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
# disable pointer signed / unsigned warnings in gcc 4.0
-CFLAGS += $(call cc-option,-Wno-pointer-sign,)
+CFLAGS += $(call cc-option,-Wno-pointer-sign,)
# Default kernel image to build when no specific target is given.
# KBUILD_IMAGE may be overruled on the command line or
# set in the environment
# Also any assignments in arch/$(ARCH)/Makefile take precedence over
-# this default value
+# this default value.
export KBUILD_IMAGE ?= vmlinux
#
# INSTALL_PATH specifies where to place the updated kernel and system map
-# images. Default is /boot, but you can set it to other values
-export INSTALL_PATH ?= /boot
+# images. Default is /boot, but it can be set to other values.
+export INSTALL_PATH ?= /boot
#
# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
# relocations required by build roots. This is not defined in the
# makefile but the argument can be passed to make if needed.
-#
MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
export MODLIB
@@ -547,14 +557,14 @@
# INSTALL_MOD_STRIP will used as the options to the strip command.
ifdef INSTALL_MOD_STRIP
-ifeq ($(INSTALL_MOD_STRIP),1)
-mod_strip_cmd = $(STRIP) --strip-debug
-else
-mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP)
-endif # INSTALL_MOD_STRIP=1
+ ifeq ($(INSTALL_MOD_STRIP),1)
+ mod_strip_cmd = $(STRIP) --strip-debug
+ else
+ mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP)
+ endif
else
-mod_strip_cmd = true
-endif # INSTALL_MOD_STRIP
+ mod_strip_cmd = true
+endif
export mod_strip_cmd
@@ -614,20 +624,20 @@
# May be overridden by arch/$(ARCH)/Makefile
quiet_cmd_vmlinux__ ?= LD $@
cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
- -T $(vmlinux-lds) $(vmlinux-init) \
- --start-group $(vmlinux-main) --end-group \
+ -T $(vmlinux-lds) $(vmlinux-init) \
+ --start-group $(vmlinux-main) --end-group \
$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
# Generate new vmlinux version
quiet_cmd_vmlinux_version = GEN .version
- cmd_vmlinux_version = set -e; \
- if [ ! -r .version ]; then \
- rm -f .version; \
- echo 1 >.version; \
- else \
- mv .version .old_version; \
- expr 0$$(cat .old_version) + 1 >.version; \
- fi; \
+ cmd_vmlinux_version = set -e; \
+ if [ ! -r .version ]; then \
+ rm -f .version; \
+ echo 1 >.version; \
+ else \
+ mv .version .old_version; \
+ expr 0$$(cat .old_version) + 1 >.version; \
+ fi; \
$(MAKE) $(build)=init
# Generate System.map
@@ -646,12 +656,12 @@
$(call cmd,vmlinux__)
$(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
- $(Q)$(if $($(quiet)cmd_sysmap), \
- echo ' $($(quiet)cmd_sysmap) System.map' &&) \
- $(cmd_sysmap) $@ System.map; \
- if [ $$? -ne 0 ]; then \
- rm -f $@; \
- /bin/false; \
+ $(Q)$(if $($(quiet)cmd_sysmap), \
+ echo ' $($(quiet)cmd_sysmap) System.map' &&) \
+ $(cmd_sysmap) $@ System.map; \
+ if [ $$? -ne 0 ]; then \
+ rm -f $@; \
+ /bin/false; \
fi;
$(verify_kallsyms)
endef
@@ -676,21 +686,21 @@
# maintainers work out what went wrong with kallsyms.
ifdef CONFIG_KALLSYMS_EXTRA_PASS
-last_kallsyms := 3
+ last_kallsyms := 3
else
-last_kallsyms := 2
+ last_kallsyms := 2
endif
kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
define verify_kallsyms
- $(Q)$(if $($(quiet)cmd_sysmap), \
- echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \
+ $(Q)$(if $($(quiet)cmd_sysmap), \
+ echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \
$(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map
- $(Q)cmp -s System.map .tmp_System.map || \
- (echo Inconsistent kallsyms data; \
- echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \
- rm .tmp_kallsyms* ; /bin/false )
+ $(Q)cmp -s System.map .tmp_System.map || \
+ (echo Inconsistent kallsyms data; \
+ echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \
+ rm .tmp_kallsyms* ; /bin/false)
endef
# Update vmlinux version before link
@@ -732,7 +742,9 @@
debug_kallsyms: .tmp_map$(last_kallsyms)
.tmp_map%: .tmp_vmlinux% FORCE
- ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<)
| sort > $@
+ ($(OBJDUMP) -h $< \
+ | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) \
+ | sort > $@
.tmp_map3: .tmp_map2
@@ -778,17 +790,17 @@
# $(KERNELVERSION)
# $(VERSION) eg, 2
# $(PATCHLEVEL) eg, 6
-# $(SUBLEVEL) eg, 18
-# $(EXTRAVERSION) eg, -rc6
+# $(SUBLEVEL) eg, 19
+# $(EXTRAVERSION) eg, -rc2
# $(localver-full)
# $(localver)
# localversion* (all localversion* files)
# $(CONFIG_LOCALVERSION) (from kernel config setting)
-# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is
set)
+# $(localver-auto) (CONFIG_LOCALVERSION_AUTO is set)
# ./scripts/setlocalversion (SCM tag, if one exists)
# $(LOCALVERSION) (from make command line if provided)
#
-# Note how the final $(localver-auto) string is included *only* if the
+# Note how the final $(localver-auto) string is included *only* if the
# kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the
# moment, only git is supported but other SCMs can edit the script
# scripts/setlocalversion and add the appropriate checks as needed.
@@ -813,9 +825,9 @@
# Other SCMs can edit scripts/setlocalversion and add the appropriate
# checks as needed.
ifdef CONFIG_LOCALVERSION_AUTO
- _localver-auto = $(shell $(CONFIG_SHELL) \
- $(srctree)/scripts/setlocalversion $(srctree))
- localver-auto = $(LOCALVERSION)$(_localver-auto)
+ _localver-auto = $(shell $(CONFIG_SHELL) \
+ $(srctree)/scripts/setlocalversion $(srctree))
+ localver-auto = $(LOCALVERSION)$(_localver-auto)
endif
localver-full = $(localver)$(localver-auto)
@@ -846,9 +858,9 @@
prepare3: include/config/kernel.release
ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel'
- $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
- echo " $(srctree) is not clean, please run 'make mrproper'";\
- echo " in the '$(srctree)' directory.";\
+ $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ];then \
+ echo " $(srctree) is not clean, please run 'make mrproper'"; \
+ echo " in the '$(srctree)' directory."; \
/bin/false; \
fi;
$(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
@@ -896,15 +908,15 @@
uts_len := 64
define filechk_utsrelease.h
if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
- echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
- exit 1; \
- fi; \
+ echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
+ exit 1; \
+ fi; \
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
endef
define filechk_version.h
- (echo \#define LINUX_VERSION_CODE $(shell \
- expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
+ (echo \#define LINUX_VERSION_CODE $(shell \
+ expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef
@@ -931,8 +943,9 @@
headers_install_all: include/linux/version.h scripts_basic FORCE
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
$(Q)for arch in $(HDRARCHES); do \
- $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst
obj=include BIASMDIR=-bi-$$arch ;\
- done
+ $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst \
+ obj=include BIASMDIR=-bi-$$arch ;\
+ done
PHONY += headers_install
headers_install: include/linux/version.h scripts_basic FORCE
@@ -955,7 +968,7 @@
all: modules
-# Build modules
+# Build modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
@@ -973,11 +986,6 @@
PHONY += _modinst_
_modinst_:
- @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
- echo "Warning: you may need to install module-init-tools"; \
- echo "See
http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
- sleep 1; \
- fi
@rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/source
@mkdir -p $(MODLIB)/kernel
@@ -994,15 +1002,17 @@
# boot a modules.dep even before / is mounted read-write. However the
# boot script depmod is the master version.
ifeq "$(strip $(INSTALL_MOD_PATH))" ""
-depmod_opts :=
+ depmod_opts :=
else
-depmod_opts := -b $(INSTALL_MOD_PATH) -r
+ depmod_opts := -b $(INSTALL_MOD_PATH) -r
endif
-PHONY += _modinst_post
+PHONY += _modinst_post
_modinst_post: _modinst_
- if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map
$(depmod_opts) $(KERNELRELEASE); fi
+ $(Q)if [ -r System.map -a -x $(DEPMOD) ]; then \
+ $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); \
+ fi
-else # CONFIG_MODULES
+else # ifdef CONFIG_MODULES
# Modules not configured
# ---------------------------------------------------------------------------
@@ -1015,7 +1025,7 @@
@echo
@exit 1
-endif # CONFIG_MODULES
+endif # ifdef CONFIG_MODULES
###
# Cleaning is done on three levels.
@@ -1032,8 +1042,8 @@
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include2 usr/include
MRPROPER_FILES += .config .config.old include/asm .version .old_version \
- include/linux/autoconf.h include/linux/version.h \
- include/linux/utsrelease.h \
+ include/linux/autoconf.h include/linux/version.h \
+ include/linux/utsrelease.h \
Module.symvers tags TAGS cscope*
# clean - Delete most, but leave enough to build external modules
@@ -1050,7 +1060,7 @@
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find . $(RCS_FIND_IGNORE) \
- \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+ -o \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '*.symtypes' \) \
-type f -print | xargs rm -f
@@ -1075,7 +1085,7 @@
distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE) \
- \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ -o \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -size 0 \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
@@ -1164,7 +1174,7 @@
%docs: scripts_basic FORCE
$(Q)$(MAKE) $(build)=Documentation/DocBook $@
-else # KBUILD_EXTMOD
+else # ifeq ($(KBUILD_EXTMOD),)
###
# External module support.
@@ -1219,10 +1229,10 @@
# Run depmod only is we have System.map and depmod is executable
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
- $(DEPMOD) -ae -F System.map \
- $(if $(strip $(INSTALL_MOD_PATH)), \
- -b $(INSTALL_MOD_PATH) -r) \
- $(KERNELRELEASE); \
+ $(DEPMOD) -ae -F System.map \
+ $(if $(strip $(INSTALL_MOD_PATH)), \
+ -b $(INSTALL_MOD_PATH) -r) \
+ $(KERNELRELEASE); \
fi
PHONY += _emodinst_post
@@ -1239,7 +1249,7 @@
clean: $(clean-dirs)
$(call cmd,rmdirs)
@find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \
- \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+ -o \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
-type f -print | xargs rm -f
@@ -1256,53 +1266,55 @@
PHONY += prepare scripts
prepare: ;
scripts: ;
-endif # KBUILD_EXTMOD
+endif # ifeq ($(KBUILD_EXTMOD),)
# Generate tags for editors
# ---------------------------------------------------------------------------
-#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set
-#(which is the most common case IMHO) to avoid unneeded clutter in the big
tags file.
-#Adding $(srctree) adds about 20M on i386 to the size of the output file!
+# We want __srctree to totally vanish out when KBUILD_OUTPUT is not
+# set (which is the most common case IMHO) to avoid unneeded clutter
+# in the big tags file.
+# Adding $(srctree) adds about 20M on i386 to the size of the output file!
ifeq ($(src),$(obj))
-__srctree =
+ __srctree =
else
-__srctree = $(srctree)/
+ __srctree = $(srctree)/
endif
ifeq ($(ALLSOURCE_ARCHS),)
-ifeq ($(ARCH),um)
-ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
-else
-ALLINCLUDE_ARCHS := $(ARCH)
-endif
+ ifeq ($(ARCH),um)
+ ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
+ else
+ ALLINCLUDE_ARCHS := $(ARCH)
+ endif
else
-#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping
existing behavour.
-ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
+# Allow user to specify only ALLSOURCE_PATHS on the command line,
+# keeping existing behavour.
+ ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
endif
ALLSOURCE_ARCHS := $(ARCH)
define find-sources
( find $(__srctree) $(RCS_FIND_IGNORE) \
- \( -name include -o -name arch \) -prune -o \
- -name $1 -print; \
+ -o \( -name include -o -name arch \) -prune \
+ -o -name $1 -print; \
for ARCH in $(ALLSOURCE_ARCHS) ; do \
find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
- -name $1 -print; \
+ -o -name $1 -print; \
done ; \
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
- -name $1 -print; \
+ -o -name $1 -print; \
find $(__srctree)include $(RCS_FIND_IGNORE) \
- \( -name config -o -name 'asm-*' \) -prune \
+ -o \( -name config -o -name 'asm-*' \) -prune \
-o -name $1 -print; \
for ARCH in $(ALLINCLUDE_ARCHS) ; do \
find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \
- -name $1 -print; \
+ -o -name $1 -print; \
done ; \
find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
- -name $1 -print )
+ -o -name $1 -print )
endef
define all-sources
@@ -1316,29 +1328,29 @@
endef
define xtags
- if $1 --version 2>&1 | grep -iq exuberant; then \
- $(all-sources) | xargs $1 -a \
- -I __initdata,__exitdata,__acquires,__releases \
- -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
- --extra=+f --c-kinds=+px \
- --regex-asm='/ENTRY\(([^)]*)\).*/\1/'; \
- $(all-kconfigs) | xargs $1 -a \
- --langdef=kconfig \
- --language-force=kconfig \
-
--regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \
- $(all-defconfigs) | xargs -r $1 -a \
- --langdef=dotconfig \
- --language-force=dotconfig \
- --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/';
\
- elif $1 --version 2>&1 | grep -iq emacs; then \
- $(all-sources) | xargs $1 -a; \
- $(all-kconfigs) | xargs $1 -a \
- --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
- $(all-defconfigs) | xargs -r $1 -a \
- --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
- else \
- $(all-sources) | xargs $1 -a; \
- fi
+ if $1 --version 2>&1 | grep -iq exuberant; then \
+ $(all-sources) | xargs $1 -a \
+ -I __initdata,__exitdata,__acquires,__releases \
+ -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
+ --extra=+f --c-kinds=+px \
+ --regex-asm='/ENTRY\(([^)]*)\).*/\1/'; \
+ $(all-kconfigs) | xargs $1 -a \
+ --langdef=kconfig \
+ --language-force=kconfig \
+ --regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \
+ $(all-defconfigs) | xargs -r $1 -a \
+ --langdef=dotconfig \
+ --language-force=dotconfig \
+ --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \
+ elif $1 --version 2>&1 | grep -iq emacs; then \
+ $(all-sources) | xargs $1 -a; \
+ $(all-kconfigs) | xargs $1 -a \
+ --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
+ $(all-defconfigs) | xargs -r $1 -a \
+ --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
+ else \
+ $(all-sources) | xargs $1 -a; \
+ fi
endef
quiet_cmd_cscope-file = FILELST cscope.files
@@ -1353,8 +1365,8 @@
quiet_cmd_TAGS = MAKE $@
define cmd_TAGS
- rm -f $@; \
- $(call xtags,etags)
+ rm -f $@; \
+ $(call xtags,etags)
endef
TAGS: FORCE
@@ -1362,8 +1374,8 @@
quiet_cmd_tags = MAKE $@
define cmd_tags
- rm -f $@; \
- $(call xtags,ctags)
+ rm -f $@; \
+ $(call xtags,ctags)
endef
tags: FORCE
@@ -1375,12 +1387,14 @@
includecheck:
find * $(RCS_FIND_IGNORE) \
- -name '*.[hcS]' -type f -print | sort \
+ -o -name '*.[hcS]' -type f -print \
+ | sort \
| xargs $(PERL) -w scripts/checkincludes.pl
versioncheck:
find * $(RCS_FIND_IGNORE) \
- -name '*.[hcS]' -type f -print | sort \
+ -o -name '*.[hcS]' -type f -print \
+ | sort \
| xargs $(PERL) -w scripts/checkversion.pl
namespacecheck:
@@ -1415,12 +1429,12 @@
# build-dir => directory in kernel source tree to use
ifeq ($(KBUILD_EXTMOD),)
- build-dir = $(patsubst %/,%,$(dir $@))
- target-dir = $(dir $@)
+ build-dir = $(patsubst %/,%,$(dir $@))
+ target-dir = $(dir $@)
else
- zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
- build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
- target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
+ zap-slash = $(filter-out .,$(patsubst %/,%,$(dir $@)))
+ build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
+ target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
%.s: %.c prepare scripts FORCE
@@ -1443,7 +1457,7 @@
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir)
%.ko: prepare scripts FORCE
- $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+ $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1467,11 +1481,12 @@
# read all saved command lines
targets := $(wildcard $(sort $(targets)))
-cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir
$(f)).cmd))
+cmd_files := $(wildcard .*.cmd \
+ $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
- $(cmd_files): ; # Do not try to update included dependency files
include $(cmd_files)
+ $(cmd_files): ;
endif
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
@@ -1479,7 +1494,7 @@
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
-endif # skip-makefile
+endif # ifeq ($(skip-makefile),)
PHONY += FORCE
FORCE:
--
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
kbuild-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel