aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg2011-04-27 15:29:49 -0500
committerMichal Marek2011-04-28 11:01:41 -0500
commitd8ecc5cd8e227bc318513b5306ae88a474b8886d (patch)
treef05fe662c000b8219923b8c464c9c186b599190e /Makefile
parent28bc20dccadc610c56e27255aeef2938141a0cd3 (diff)
downloadkernel-audio-d8ecc5cd8e227bc318513b5306ae88a474b8886d.tar.gz
kernel-audio-d8ecc5cd8e227bc318513b5306ae88a474b8886d.tar.xz
kernel-audio-d8ecc5cd8e227bc318513b5306ae88a474b8886d.zip
kbuild: asm-generic support
There is an increasing amount of header files shared between individual architectures in asm-generic. To avoid a lot of dummy wrapper files that just include the corresponding file in asm-generic provide some basic support in kbuild for this. With the following patch an architecture can maintain a list of files in the file arch/$(ARCH)/include/asm/Kbuild To use a generic file just add: generic-y += <name-of-header-file.h> For each file listed kbuild will generate the necessary wrapper in arch/$(ARCH)/include/generated/asm. When installing userspace headers a wrapper is likewise created. The original inspiration for this came from the unicore32 patchset - although a different method is used. The patch includes several improvements from Arnd Bergmann. Michael Marek contributed Makefile.asm-generic. Remis Baima did an intial implementation along to achive the same - see https://patchwork.kernel.org/patch/13352/ Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Guan Xuetao <guanxuetao@mprc.pku.edu.cn> Tested-by: Guan Xuetao <guanxuetao@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Remis Lima Baima <remis.developer@googlemail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index d43429f4ced8..e509cc704968 100644
--- a/Makefile
+++ b/Makefile
@@ -349,7 +349,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
349 349
350# Use LINUXINCLUDE when you must reference the include/ directory. 350# Use LINUXINCLUDE when you must reference the include/ directory.
351# Needed to be compatible with the O= option 351# Needed to be compatible with the O= option
352LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ 352LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \
353 -Iarch/$(hdr-arch)/include/generated -Iinclude \
353 $(if $(KBUILD_SRC), -I$(srctree)/include) \ 354 $(if $(KBUILD_SRC), -I$(srctree)/include) \
354 -include include/generated/autoconf.h 355 -include include/generated/autoconf.h
355 356
@@ -417,6 +418,12 @@ ifneq ($(KBUILD_SRC),)
417 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) 418 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
418endif 419endif
419 420
421# Support for using generic headers in asm-generic
422PHONY += asm-generic
423asm-generic:
424 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
425 obj=arch/$(SRCARCH)/include/generated/asm
426
420# To make sure we do not include .config for any of the *config targets 427# To make sure we do not include .config for any of the *config targets
421# catch them early, and hand them over to scripts/kconfig/Makefile 428# catch them early, and hand them over to scripts/kconfig/Makefile
422# It is allowed to specify more targets when calling make, including 429# It is allowed to specify more targets when calling make, including
@@ -954,7 +961,7 @@ ifneq ($(KBUILD_SRC),)
954endif 961endif
955 962
956# prepare2 creates a makefile if using a separate output directory 963# prepare2 creates a makefile if using a separate output directory
957prepare2: prepare3 outputmakefile 964prepare2: prepare3 outputmakefile asm-generic
958 965
959prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ 966prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
960 include/config/auto.conf 967 include/config/auto.conf
@@ -1028,7 +1035,7 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
1028hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) 1035hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
1029 1036
1030PHONY += __headers 1037PHONY += __headers
1031__headers: include/linux/version.h scripts_basic FORCE 1038__headers: include/linux/version.h scripts_basic asm-generic FORCE
1032 $(Q)$(MAKE) $(build)=scripts build_unifdef 1039 $(Q)$(MAKE) $(build)=scripts build_unifdef
1033 1040
1034PHONY += headers_install_all 1041PHONY += headers_install_all
@@ -1143,7 +1150,8 @@ CLEAN_FILES += vmlinux System.map \
1143 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1150 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
1144 1151
1145# Directories & files removed with 'make mrproper' 1152# Directories & files removed with 'make mrproper'
1146MRPROPER_DIRS += include/config usr/include include/generated 1153MRPROPER_DIRS += include/config usr/include include/generated \
1154 arch/*/include/generated
1147MRPROPER_FILES += .config .config.old .version .old_version \ 1155MRPROPER_FILES += .config .config.old .version .old_version \
1148 include/linux/version.h \ 1156 include/linux/version.h \
1149 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS 1157 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS