diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 43 |
1 files changed, 27 insertions, 16 deletions
@@ -350,12 +350,22 @@ AFLAGS_KERNEL = | |||
350 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | 350 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage |
351 | 351 | ||
352 | 352 | ||
353 | # Use USERINCLUDE when you must reference the UAPI directories only. | ||
354 | USERINCLUDE := \ | ||
355 | -I$(srctree)/arch/$(hdr-arch)/include/uapi \ | ||
356 | -Iarch/$(hdr-arch)/include/generated/uapi \ | ||
357 | -I$(srctree)/include/uapi \ | ||
358 | -Iinclude/generated/uapi \ | ||
359 | -include $(srctree)/include/linux/kconfig.h | ||
360 | |||
353 | # Use LINUXINCLUDE when you must reference the include/ directory. | 361 | # Use LINUXINCLUDE when you must reference the include/ directory. |
354 | # Needed to be compatible with the O= option | 362 | # Needed to be compatible with the O= option |
355 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \ | 363 | LINUXINCLUDE := \ |
356 | -Iarch/$(hdr-arch)/include/generated -Iinclude \ | 364 | -I$(srctree)/arch/$(hdr-arch)/include \ |
357 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ | 365 | -Iarch/$(hdr-arch)/include/generated \ |
358 | -include $(srctree)/include/linux/kconfig.h | 366 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
367 | -Iinclude \ | ||
368 | $(USERINCLUDE) | ||
359 | 369 | ||
360 | KBUILD_CPPFLAGS := -D__KERNEL__ | 370 | KBUILD_CPPFLAGS := -D__KERNEL__ |
361 | 371 | ||
@@ -437,9 +447,11 @@ asm-generic: | |||
437 | # Detect when mixed targets is specified, and make a second invocation | 447 | # Detect when mixed targets is specified, and make a second invocation |
438 | # of make so .config is not included in this case either (for *config). | 448 | # of make so .config is not included in this case either (for *config). |
439 | 449 | ||
450 | version_h := include/generated/uapi/linux/version.h | ||
451 | |||
440 | no-dot-config-targets := clean mrproper distclean \ | 452 | no-dot-config-targets := clean mrproper distclean \ |
441 | cscope gtags TAGS tags help %docs check% coccicheck \ | 453 | cscope gtags TAGS tags help %docs check% coccicheck \ |
442 | include/linux/version.h headers_% archheaders archscripts \ | 454 | $(version_h) headers_% archheaders archscripts \ |
443 | kernelversion %src-pkg | 455 | kernelversion %src-pkg |
444 | 456 | ||
445 | config-targets := 0 | 457 | config-targets := 0 |
@@ -809,7 +821,7 @@ endif | |||
809 | # prepare2 creates a makefile if using a separate output directory | 821 | # prepare2 creates a makefile if using a separate output directory |
810 | prepare2: prepare3 outputmakefile asm-generic | 822 | prepare2: prepare3 outputmakefile asm-generic |
811 | 823 | ||
812 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ | 824 | prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ |
813 | include/config/auto.conf | 825 | include/config/auto.conf |
814 | $(cmd_crmodverdir) | 826 | $(cmd_crmodverdir) |
815 | 827 | ||
@@ -842,7 +854,7 @@ define filechk_version.h | |||
842 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) | 854 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) |
843 | endef | 855 | endef |
844 | 856 | ||
845 | include/linux/version.h: $(srctree)/Makefile FORCE | 857 | $(version_h): $(srctree)/Makefile FORCE |
846 | $(call filechk,version.h) | 858 | $(call filechk,version.h) |
847 | 859 | ||
848 | include/generated/utsrelease.h: include/config/kernel.release FORCE | 860 | include/generated/utsrelease.h: include/config/kernel.release FORCE |
@@ -887,7 +899,7 @@ PHONY += archscripts | |||
887 | archscripts: | 899 | archscripts: |
888 | 900 | ||
889 | PHONY += __headers | 901 | PHONY += __headers |
890 | __headers: include/linux/version.h scripts_basic asm-generic archheaders archscripts FORCE | 902 | __headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE |
891 | $(Q)$(MAKE) $(build)=scripts build_unifdef | 903 | $(Q)$(MAKE) $(build)=scripts build_unifdef |
892 | 904 | ||
893 | PHONY += headers_install_all | 905 | PHONY += headers_install_all |
@@ -896,10 +908,10 @@ headers_install_all: | |||
896 | 908 | ||
897 | PHONY += headers_install | 909 | PHONY += headers_install |
898 | headers_install: __headers | 910 | headers_install: __headers |
899 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \ | 911 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \ |
900 | $(error Headers not exportable for the $(SRCARCH) architecture)) | 912 | $(error Headers not exportable for the $(SRCARCH) architecture)) |
901 | $(Q)$(MAKE) $(hdr-inst)=include | 913 | $(Q)$(MAKE) $(hdr-inst)=include/uapi |
902 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) | 914 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) |
903 | 915 | ||
904 | PHONY += headers_check_all | 916 | PHONY += headers_check_all |
905 | headers_check_all: headers_install_all | 917 | headers_check_all: headers_install_all |
@@ -907,8 +919,8 @@ headers_check_all: headers_install_all | |||
907 | 919 | ||
908 | PHONY += headers_check | 920 | PHONY += headers_check |
909 | headers_check: headers_install | 921 | headers_check: headers_install |
910 | $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 | 922 | $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 |
911 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1 | 923 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1 |
912 | 924 | ||
913 | # --------------------------------------------------------------------------- | 925 | # --------------------------------------------------------------------------- |
914 | # Modules | 926 | # Modules |
@@ -997,8 +1009,7 @@ CLEAN_DIRS += $(MODVERDIR) | |||
997 | # Directories & files removed with 'make mrproper' | 1009 | # Directories & files removed with 'make mrproper' |
998 | MRPROPER_DIRS += include/config usr/include include/generated \ | 1010 | MRPROPER_DIRS += include/config usr/include include/generated \ |
999 | arch/*/include/generated | 1011 | arch/*/include/generated |
1000 | MRPROPER_FILES += .config .config.old .version .old_version \ | 1012 | MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ |
1001 | include/linux/version.h \ | ||
1002 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS | 1013 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS |
1003 | 1014 | ||
1004 | # clean - Delete most, but leave enough to build external modules | 1015 | # clean - Delete most, but leave enough to build external modules |