diff options
| author | Sam Ravnborg <sam@ravnborg.org> | 2011-04-27 16:29:49 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2011-04-28 12:01:41 -0400 |
| commit | d8ecc5cd8e227bc318513b5306ae88a474b8886d (patch) | |
| tree | f05fe662c000b8219923b8c464c9c186b599190e /Makefile | |
| parent | 28bc20dccadc610c56e27255aeef2938141a0cd3 (diff) | |
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-- | Makefile | 16 |
1 files changed, 12 insertions, 4 deletions
| @@ -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 |
| 352 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ | 352 | LINUXINCLUDE := -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) |
| 418 | endif | 419 | endif |
| 419 | 420 | ||
| 421 | # Support for using generic headers in asm-generic | ||
| 422 | PHONY += asm-generic | ||
| 423 | asm-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),) | |||
| 954 | endif | 961 | endif |
| 955 | 962 | ||
| 956 | # prepare2 creates a makefile if using a separate output directory | 963 | # prepare2 creates a makefile if using a separate output directory |
| 957 | prepare2: prepare3 outputmakefile | 964 | prepare2: prepare3 outputmakefile asm-generic |
| 958 | 965 | ||
| 959 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ | 966 | prepare1: 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 | |||
| 1028 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) | 1035 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) |
| 1029 | 1036 | ||
| 1030 | PHONY += __headers | 1037 | PHONY += __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 | ||
| 1034 | PHONY += headers_install_all | 1041 | PHONY += 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' |
| 1146 | MRPROPER_DIRS += include/config usr/include include/generated | 1153 | MRPROPER_DIRS += include/config usr/include include/generated \ |
| 1154 | arch/*/include/generated | ||
| 1147 | MRPROPER_FILES += .config .config.old .version .old_version \ | 1155 | MRPROPER_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 |
