Makefile (2f058256cb64e346f4fb4499ff4e0f1c2791a4b4) Makefile (aaebf4332018980fef4e601d1b5a6e52dd9e9ae4)
1VERSION = 2
2PATCHLEVEL = 6
3SUBLEVEL = 13
1VERSION = 2
2PATCHLEVEL = 6
3SUBLEVEL = 13
4EXTRAVERSION =-rc6
4EXTRAVERSION =-rc2
5NAME=Woozy Numbat
6
7# *DOCUMENTATION*
8# To see a list of typical targets execute "make help"
9# More info can be located in ./README
10# Comments in this file are targeted only to the developer, do not
11# expect to learn how to build the kernel reading this file.
12

--- 91 unchanged lines hidden (view full) ---

104saved-output := $(KBUILD_OUTPUT)
105KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
106$(if $(KBUILD_OUTPUT),, \
107 $(error output directory "$(saved-output)" does not exist))
108
109.PHONY: $(MAKECMDGOALS)
110
111$(filter-out _all,$(MAKECMDGOALS)) _all:
5NAME=Woozy Numbat
6
7# *DOCUMENTATION*
8# To see a list of typical targets execute "make help"
9# More info can be located in ./README
10# Comments in this file are targeted only to the developer, do not
11# expect to learn how to build the kernel reading this file.
12

--- 91 unchanged lines hidden (view full) ---

104saved-output := $(KBUILD_OUTPUT)
105KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
106$(if $(KBUILD_OUTPUT),, \
107 $(error output directory "$(saved-output)" does not exist))
108
109.PHONY: $(MAKECMDGOALS)
110
111$(filter-out _all,$(MAKECMDGOALS)) _all:
112 $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
113 KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \
114 KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)" \
115 -f $(CURDIR)/Makefile $@
112 $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
113 KBUILD_SRC=$(CURDIR) \
114 KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@
116
117# Leave processing to above invocation of make
118skip-makefile := 1
119endif # ifneq ($(KBUILD_OUTPUT),)
120endif # ifeq ($(KBUILD_SRC),)
121
122# We process the rest of the Makefile if this is the final invocation of make
123ifeq ($(skip-makefile),)

--- 104 unchanged lines hidden (view full) ---

228ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
229 KBUILD_MODULES := 1
230endif
231
232ifeq ($(MAKECMDGOALS),)
233 KBUILD_MODULES := 1
234endif
235
115
116# Leave processing to above invocation of make
117skip-makefile := 1
118endif # ifneq ($(KBUILD_OUTPUT),)
119endif # ifeq ($(KBUILD_SRC),)
120
121# We process the rest of the Makefile if this is the final invocation of make
122ifeq ($(skip-makefile),)

--- 104 unchanged lines hidden (view full) ---

227ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
228 KBUILD_MODULES := 1
229endif
230
231ifeq ($(MAKECMDGOALS),)
232 KBUILD_MODULES := 1
233endif
234
236export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE
235export KBUILD_MODULES KBUILD_BUILTIN
237export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
238
239# Beautify output
240# ---------------------------------------------------------------------------
241#
242# Normally, we echo the whole command before executing it. By making
243# that echo $($(quiet)$(cmd)), we now have the possibility to set
244# $(quiet) to choose other forms of output instead, e.g.

--- 59 unchanged lines hidden (view full) ---

304# Usage gcc-ver := $(call cc-version $(CC))
305cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
306 $(if $(1), $(1), $(CC)))
307
308
309# Look for make include files relative to root of kernel src
310MAKEFLAGS += --include-dir=$(srctree)
311
236export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
237
238# Beautify output
239# ---------------------------------------------------------------------------
240#
241# Normally, we echo the whole command before executing it. By making
242# that echo $($(quiet)$(cmd)), we now have the possibility to set
243# $(quiet) to choose other forms of output instead, e.g.

--- 59 unchanged lines hidden (view full) ---

303# Usage gcc-ver := $(call cc-version $(CC))
304cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
305 $(if $(1), $(1), $(CC)))
306
307
308# Look for make include files relative to root of kernel src
309MAKEFLAGS += --include-dir=$(srctree)
310
311# We need some generic definitions
312include $(srctree)/scripts/Kbuild.include
313
312# For maximum performance (+ possibly random breakage, uncomment
313# the following)
314
315#MAKEFLAGS += -rR
316
317# Make variables (CC, etc...)
318
319AS = $(CROSS_COMPILE)as

--- 23 unchanged lines hidden (view full) ---

343
344# Use LINUXINCLUDE when you must reference the include/ directory.
345# Needed to be compatible with the O= option
346LINUXINCLUDE := -Iinclude \
347 $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
348
349CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
350
314# For maximum performance (+ possibly random breakage, uncomment
315# the following)
316
317#MAKEFLAGS += -rR
318
319# Make variables (CC, etc...)
320
321AS = $(CROSS_COMPILE)as

--- 23 unchanged lines hidden (view full) ---

345
346# Use LINUXINCLUDE when you must reference the include/ directory.
347# Needed to be compatible with the O= option
348LINUXINCLUDE := -Iinclude \
349 $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
350
351CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
352
351CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \
353CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
352 -fno-strict-aliasing -fno-common \
353 -ffreestanding
354AFLAGS := -D__ASSEMBLY__
355
356export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \
357 ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
358 CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
359 HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
360
361export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
362export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
363export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
364
365# When compiling out-of-tree modules, put MODVERDIR in the module
366# tree rather than in the kernel tree. The kernel tree might
367# even be read-only.
368export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions
369
354 -fno-strict-aliasing -fno-common \
355 -ffreestanding
356AFLAGS := -D__ASSEMBLY__
357
358export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \
359 ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
360 CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
361 HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
362
363export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
364export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
365export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
366
367# When compiling out-of-tree modules, put MODVERDIR in the module
368# tree rather than in the kernel tree. The kernel tree might
369# even be read-only.
370export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions
371
370# The temporary file to save gcc -MD generated dependencies must not
371# contain a comma
372comma := ,
373depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
374
375# Files to ignore in find ... statements
376
377RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc \) -prune -o
378RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc
379
380# ===========================================================================
381# Rules shared between *config targets and build targets
382

--- 163 unchanged lines hidden (view full) ---

546# this default value
547export KBUILD_IMAGE ?= vmlinux
548
549#
550# INSTALL_PATH specifies where to place the updated kernel and system map
551# images. Default is /boot, but you can set it to other values
552export INSTALL_PATH ?= /boot
553
372# Files to ignore in find ... statements
373
374RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc \) -prune -o
375RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc
376
377# ===========================================================================
378# Rules shared between *config targets and build targets
379

--- 163 unchanged lines hidden (view full) ---

543# this default value
544export KBUILD_IMAGE ?= vmlinux
545
546#
547# INSTALL_PATH specifies where to place the updated kernel and system map
548# images. Default is /boot, but you can set it to other values
549export INSTALL_PATH ?= /boot
550
551# If CONFIG_LOCALVERSION_AUTO is set, we automatically perform some tests
552# and try to determine if the current source tree is a release tree, of any sort,
553# or if is a pure development tree.
554#
554#
555# A 'release tree' is any tree with a git TAG associated
556# with it. The primary goal of this is to make it safe for a native
557# git/CVS/SVN user to build a release tree (i.e, 2.6.9) and also to
558# continue developing against the current Linus tree, without having the Linus
559# tree overwrite the 2.6.9 tree when installed.
560#
561# Currently, only git is supported.
562# Other SCMs can edit scripts/setlocalversion and add the appropriate
563# checks as needed.
564
565
566ifdef CONFIG_LOCALVERSION_AUTO
567 localversion-auto := $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))
568 LOCALVERSION := $(LOCALVERSION)$(localversion-auto)
569endif
570
571#
555# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
556# relocations required by build roots. This is not defined in the
557# makefile but the arguement can be passed to make if needed.
558#
559
560MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
561export MODLIB
562

--- 123 unchanged lines hidden (view full) ---

686 $(Q)cmp -s System.map .tmp_System.map || \
687 (echo Inconsistent kallsyms data; \
688 echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \
689 rm .tmp_kallsyms* ; /bin/false )
690endef
691
692# Update vmlinux version before link
693# Use + in front of this rule to silent warning about make -j1
572# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
573# relocations required by build roots. This is not defined in the
574# makefile but the arguement can be passed to make if needed.
575#
576
577MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
578export MODLIB
579

--- 123 unchanged lines hidden (view full) ---

703 $(Q)cmp -s System.map .tmp_System.map || \
704 (echo Inconsistent kallsyms data; \
705 echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \
706 rm .tmp_kallsyms* ; /bin/false )
707endef
708
709# Update vmlinux version before link
710# Use + in front of this rule to silent warning about make -j1
711# First command is ':' to allow us to use + in front of this rule
694cmd_ksym_ld = $(cmd_vmlinux__)
695define rule_ksym_ld
712cmd_ksym_ld = $(cmd_vmlinux__)
713define rule_ksym_ld
714 :
696 +$(call cmd,vmlinux_version)
697 $(call cmd,vmlinux__)
698 $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
699endef
700
701# Generate .S file with all kernel symbols
702quiet_cmd_kallsyms = KSYM $@
703 cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \

--- 13 unchanged lines hidden (view full) ---

717 $(call if_changed,vmlinux__)
718
719.tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE
720 $(call if_changed,vmlinux__)
721
722# Needs to visit scripts/ before $(KALLSYMS) can be used.
723$(KALLSYMS): scripts ;
724
715 +$(call cmd,vmlinux_version)
716 $(call cmd,vmlinux__)
717 $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
718endef
719
720# Generate .S file with all kernel symbols
721quiet_cmd_kallsyms = KSYM $@
722 cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \

--- 13 unchanged lines hidden (view full) ---

736 $(call if_changed,vmlinux__)
737
738.tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE
739 $(call if_changed,vmlinux__)
740
741# Needs to visit scripts/ before $(KALLSYMS) can be used.
742$(KALLSYMS): scripts ;
743
744# Generate some data for debugging strange kallsyms problems
745debug_kallsyms: .tmp_map$(last_kallsyms)
746
747.tmp_map%: .tmp_vmlinux% FORCE
748 ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@
749
750.tmp_map3: .tmp_map2
751
752.tmp_map2: .tmp_map1
753
725endif # ifdef CONFIG_KALLSYMS
726
727# vmlinux image - including updated kernel symbols
728vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
729 $(call if_changed_rule,vmlinux__)
730
731# The actual objects are generated when descending,
732# make sure no implicit rule kicks in

--- 19 unchanged lines hidden (view full) ---

752# prepare2 is used to check if we are building in a separate output directory,
753# and if so do:
754# 1) Check that make has not been executed in the kernel src $(srctree)
755# 2) Create the include2 directory, used for the second asm symlink
756
757prepare2:
758ifneq ($(KBUILD_SRC),)
759 @echo ' Using $(srctree) as source for kernel'
754endif # ifdef CONFIG_KALLSYMS
755
756# vmlinux image - including updated kernel symbols
757vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
758 $(call if_changed_rule,vmlinux__)
759
760# The actual objects are generated when descending,
761# make sure no implicit rule kicks in

--- 19 unchanged lines hidden (view full) ---

781# prepare2 is used to check if we are building in a separate output directory,
782# and if so do:
783# 1) Check that make has not been executed in the kernel src $(srctree)
784# 2) Create the include2 directory, used for the second asm symlink
785
786prepare2:
787ifneq ($(KBUILD_SRC),)
788 @echo ' Using $(srctree) as source for kernel'
760 $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \
789 $(Q)if [ -f $(srctree)/.config ]; then \
761 echo " $(srctree) is not clean, please run 'make mrproper'";\
762 echo " in the '$(srctree)' directory.";\
763 /bin/false; \
764 fi;
765 $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
766 $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
767endif
768
769# prepare1 creates a makefile if using a separate output directory
770prepare1: prepare2 outputmakefile
771
790 echo " $(srctree) is not clean, please run 'make mrproper'";\
791 echo " in the '$(srctree)' directory.";\
792 /bin/false; \
793 fi;
794 $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
795 $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
796endif
797
798# prepare1 creates a makefile if using a separate output directory
799prepare1: prepare2 outputmakefile
800
772prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER
801prepare0: prepare1 include/linux/version.h include/asm \
802 include/config/MARKER
773ifneq ($(KBUILD_MODULES),)
774 $(Q)rm -rf $(MODVERDIR)
775 $(Q)mkdir -p $(MODVERDIR)
776endif
777
778# All the preparing..
779prepare-all: prepare0 prepare
780

--- 89 unchanged lines hidden (view full) ---

870modules_prepare: prepare-all scripts
871
872# Target to install modules
873.PHONY: modules_install
874modules_install: _modinst_ _modinst_post
875
876.PHONY: _modinst_
877_modinst_:
803ifneq ($(KBUILD_MODULES),)
804 $(Q)rm -rf $(MODVERDIR)
805 $(Q)mkdir -p $(MODVERDIR)
806endif
807
808# All the preparing..
809prepare-all: prepare0 prepare
810

--- 89 unchanged lines hidden (view full) ---

900modules_prepare: prepare-all scripts
901
902# Target to install modules
903.PHONY: modules_install
904modules_install: _modinst_ _modinst_post
905
906.PHONY: _modinst_
907_modinst_:
878 @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
908 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
879 echo "Warning: you may need to install module-init-tools"; \
880 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
881 sleep 1; \
882 fi
883 @rm -rf $(MODLIB)/kernel
884 @rm -f $(MODLIB)/source
885 @mkdir -p $(MODLIB)/kernel
886 @ln -s $(srctree) $(MODLIB)/source

--- 267 unchanged lines hidden (view full) ---

1154#Adding $(srctree) adds about 20M on i386 to the size of the output file!
1155
1156ifeq ($(src),$(obj))
1157__srctree =
1158else
1159__srctree = $(srctree)/
1160endif
1161
909 echo "Warning: you may need to install module-init-tools"; \
910 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
911 sleep 1; \
912 fi
913 @rm -rf $(MODLIB)/kernel
914 @rm -f $(MODLIB)/source
915 @mkdir -p $(MODLIB)/kernel
916 @ln -s $(srctree) $(MODLIB)/source

--- 267 unchanged lines hidden (view full) ---

1184#Adding $(srctree) adds about 20M on i386 to the size of the output file!
1185
1186ifeq ($(src),$(obj))
1187__srctree =
1188else
1189__srctree = $(srctree)/
1190endif
1191
1192ALLSOURCE_ARCHS := $(ARCH)
1193
1162define all-sources
1163 ( find $(__srctree) $(RCS_FIND_IGNORE) \
1164 \( -name include -o -name arch \) -prune -o \
1165 -name '*.[chS]' -print; \
1194define all-sources
1195 ( find $(__srctree) $(RCS_FIND_IGNORE) \
1196 \( -name include -o -name arch \) -prune -o \
1197 -name '*.[chS]' -print; \
1166 find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \
1167 -name '*.[chS]' -print; \
1198 for ARCH in $(ALLSOURCE_ARCHS) ; do \
1199 find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
1200 -name '*.[chS]' -print; \
1201 done ; \
1168 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
1169 -name '*.[chS]' -print; \
1170 find $(__srctree)include $(RCS_FIND_IGNORE) \
1171 \( -name config -o -name 'asm-*' \) -prune \
1172 -o -name '*.[chS]' -print; \
1202 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
1203 -name '*.[chS]' -print; \
1204 find $(__srctree)include $(RCS_FIND_IGNORE) \
1205 \( -name config -o -name 'asm-*' \) -prune \
1206 -o -name '*.[chS]' -print; \
1173 find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
1174 -name '*.[chS]' -print; \
1207 for ARCH in $(ALLSOURCE_ARCHS) ; do \
1208 find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \
1209 -name '*.[chS]' -print; \
1210 done ; \
1175 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
1176 -name '*.[chS]' -print )
1177endef
1178
1179quiet_cmd_cscope-file = FILELST cscope.files
1211 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
1212 -name '*.[chS]' -print )
1213endef
1214
1215quiet_cmd_cscope-file = FILELST cscope.files
1180 cmd_cscope-file = $(all-sources) > cscope.files
1216 cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files
1181
1182quiet_cmd_cscope = MAKE cscope.out
1217
1218quiet_cmd_cscope = MAKE cscope.out
1183 cmd_cscope = cscope -k -b -q
1219 cmd_cscope = cscope -b
1184
1185cscope: FORCE
1186 $(call cmd,cscope-file)
1187 $(call cmd,cscope)
1188
1189quiet_cmd_TAGS = MAKE $@
1220
1221cscope: FORCE
1222 $(call cmd,cscope-file)
1223 $(call cmd,cscope)
1224
1225quiet_cmd_TAGS = MAKE $@
1190cmd_TAGS = $(all-sources) | etags -
1226define cmd_TAGS
1227 rm -f $@; \
1228 ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
1229 $(all-sources) | xargs etags $$ETAGSF -a
1230endef
1191
1231
1192# Exuberant ctags works better with -I
1232TAGS: FORCE
1233 $(call cmd,TAGS)
1193
1234
1235
1194quiet_cmd_tags = MAKE $@
1195define cmd_tags
1196 rm -f $@; \
1197 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
1198 $(all-sources) | xargs ctags $$CTAGSF -a
1199endef
1200
1236quiet_cmd_tags = MAKE $@
1237define cmd_tags
1238 rm -f $@; \
1239 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
1240 $(all-sources) | xargs ctags $$CTAGSF -a
1241endef
1242
1201TAGS: FORCE
1202 $(call cmd,TAGS)
1203
1204tags: FORCE
1205 $(call cmd,tags)
1206
1207
1208# Scripts to check various things for consistency
1209# ---------------------------------------------------------------------------
1210
1211configcheck:

--- 51 unchanged lines hidden (view full) ---

1263targets := $(wildcard $(sort $(targets)))
1264cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
1265
1266ifneq ($(cmd_files),)
1267 $(cmd_files): ; # Do not try to update included dependency files
1268 include $(cmd_files)
1269endif
1270
1243tags: FORCE
1244 $(call cmd,tags)
1245
1246
1247# Scripts to check various things for consistency
1248# ---------------------------------------------------------------------------
1249
1250configcheck:

--- 51 unchanged lines hidden (view full) ---

1302targets := $(wildcard $(sort $(targets)))
1303cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
1304
1305ifneq ($(cmd_files),)
1306 $(cmd_files): ; # Do not try to update included dependency files
1307 include $(cmd_files)
1308endif
1309
1271# Execute command and generate cmd file
1272if_changed = $(if $(strip $? \
1273 $(filter-out $(cmd_$(1)),$(cmd_$@))\
1274 $(filter-out $(cmd_$@),$(cmd_$(1)))),\
1275 @set -e; \
1276 $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
1277 $(cmd_$(1)); \
1278 echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)
1279
1280
1281# execute the command and also postprocess generated .d dependencies
1282# file
1283if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
1284 $(filter-out $(cmd_$(1)),$(cmd_$@))\
1285 $(filter-out $(cmd_$@),$(cmd_$(1)))),\
1286 $(Q)set -e; \
1287 $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
1288 $(cmd_$(1)); \
1289 scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \
1290 rm -f $(depfile); \
1291 mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
1292
1293# Usage: $(call if_changed_rule,foo)
1294# will check if $(cmd_foo) changed, or any of the prequisites changed,
1295# and if so will execute $(rule_foo)
1296
1297if_changed_rule = $(if $(strip $? \
1298 $(filter-out $(cmd_$(1)),$(cmd_$(@F)))\
1299 $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\
1300 $(Q)$(rule_$(1)))
1301
1302# If quiet is set, only print short version of command
1303
1304cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
1305
1306# filechk is used to check if the content of a generated file is updated.
1307# Sample usage:
1308# define filechk_sample
1309# echo $KERNELRELEASE
1310# endef
1311# version.h : Makefile
1312# $(call filechk,sample)
1313# The rule defined shall write to stdout the content of the new file.
1314# The existing file will be compared with the new one.
1315# - If no file exist it is created
1316# - If the content differ the new file is used
1317# - If they are equal no change, and no timestamp update
1318
1319define filechk
1320 @set -e; \
1321 echo ' CHK $@'; \
1322 mkdir -p $(dir $@); \
1323 $(filechk_$(1)) < $< > $@.tmp; \
1324 if [ -r $@ ] && cmp -s $@ $@.tmp; then \
1325 rm -f $@.tmp; \
1326 else \
1327 echo ' UPD $@'; \
1328 mv -f $@.tmp $@; \
1329 fi
1330endef
1331
1332# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir
1333# Usage:
1334# $(Q)$(MAKE) $(build)=dir
1335build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
1336
1337# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
1338# Usage:
1339# $(Q)$(MAKE) $(clean)=dir
1340clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
1341
1310# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
1311# Usage:
1312# $(Q)$(MAKE) $(clean)=dir
1313clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
1314
1342# $(call descend,<dir>,<target>)
1343# Recursively call a sub-make in <dir> with target <target>
1344# Usage is deprecated, because make does not see this as an invocation of make.
1345descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2)
1346
1347endif # skip-makefile
1348
1349FORCE:
1315endif # skip-makefile
1316
1317FORCE: