History

kbuild: move modpost out of 'scripts' target

I am eagar to build under the scripts/ directory only with $(HOSTCC), but scripts/mod/ highly depends on the $(CC) and target arch headers. That it why the 'scripts' target must depend on 'asm-generic', 'gcc-plugins', and $(autoksyms_h). Move it to the 'prepare0' stage. I know this is a cheesy workaround, but better than the current situation.

Masahiro Yamada committed 7 years ago

Commit 60df1ae1 parent 65bba043 files · +3 −5Browse files

Unified · Split

3 files
  1. Makefile +2 −1
  2. scripts/Makefile +1 −2
  3. scripts/mod/Makefile +0 −2
Makefile+2−1
@@ -1075,7 +1075,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE · 1074 unmodified lines
1075# Carefully list dependencies so we do not try to build scripts twice1075# Carefully list dependencies so we do not try to build scripts twice
1076# in parallel1076# in parallel
1077PHONY += scripts1077PHONY += scripts
1078scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h)1078scripts: scripts_basic scripts_dtc
1079 $(Q)$(MAKE) $(build)=$(@)1079 $(Q)$(MAKE) $(build)=$(@)
1080 1080
1081# Things we need to do before we recursively start building the kernel1081# Things we need to do before we recursively start building the kernel
@@ -1113,6 +1113,7 @@ macroprepare: prepare1 archmacros · 31 unmodified lines
1113archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins1113archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins
1114 1114
1115prepare0: archprepare1115prepare0: archprepare
1116 $(Q)$(MAKE) $(build)=scripts/mod
1116 $(Q)$(MAKE) $(build)=.1117 $(Q)$(MAKE) $(build)=.
1117 1118
1118# All the preparing..1119# All the preparing..
scripts/Makefile+1−2
@@ -37,9 +37,8 @@ build_unifdef: $(obj)/unifdef · 36 unmodified lines
37 @:37 @:
38 38
39subdir-$(CONFIG_MODVERSIONS) += genksyms39subdir-$(CONFIG_MODVERSIONS) += genksyms
40subdir-y += mod
41subdir-$(CONFIG_SECURITY_SELINUX) += selinux40subdir-$(CONFIG_SECURITY_SELINUX) += selinux
42subdir-$(CONFIG_GDB_SCRIPTS) += gdb41subdir-$(CONFIG_GDB_SCRIPTS) += gdb
43 42
44# Let clean descend into subdirs43# Let clean descend into subdirs
45subdir- += basic dtc kconfig package gcc-plugins44subdir- += basic dtc kconfig mod package gcc-plugins
scripts/mod/Makefile+0−2
@@ -4,8 +4,6 @@ OBJECT_FILES_NON_STANDARD := y · 3 unmodified lines
4hostprogs-y := modpost mk_elfconfig4hostprogs-y := modpost mk_elfconfig
5always := $(hostprogs-y) empty.o5always := $(hostprogs-y) empty.o
6 6
7CFLAGS_REMOVE_empty.o := $(ASM_MACRO_FLAGS)
8
9modpost-objs := modpost.o file2alias.o sumversion.o7modpost-objs := modpost.o file2alias.o sumversion.o
10 8
11devicetable-offsets-file := devicetable-offsets.h9devicetable-offsets-file := devicetable-offsets.h