build
Revisión | b82999db71809f0296391286b5be6f9014b7ecc8 (tree) |
---|---|
Tiempo | 2017-10-31 17:30:31 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
kernel.mk: avoid conflict with LineageOS's kernel.mk
We defined TARGET_PREBUILT_KERNEL to be equal to INSTALLED_KERNEL_TARGET
but LineageOS's kernel.mk would copy TARGET_PREBUILT_KERNEL to
INSTALLED_KERNEL_TARGET that results in a dependency cycle.
Adjust our definition to avoid that.
@@ -51,9 +51,8 @@ $(KERNEL_DOTCONFIG_FILE): $(KERNEL_CONFIG_FILE) $(wildcard $(TARGET_KERNEL_DIFFC | ||
51 | 51 | BISON := $(HOST_OUT_EXECUTABLES)/bison$(HOST_EXECUTABLE_SUFFIX) |
52 | 52 | |
53 | 53 | BUILT_KERNEL_TARGET := $(KBUILD_OUTPUT)/arch/$(TARGET_ARCH)/boot/$(KERNEL_TARGET) |
54 | -$(INSTALLED_KERNEL_TARGET): $(KERNEL_DOTCONFIG_FILE) | $(ACP) $(BISON) | |
54 | +$(BUILT_KERNEL_TARGET): $(KERNEL_DOTCONFIG_FILE) | $(BISON) | |
55 | 55 | $(mk_kernel) $(KERNEL_TARGET) $(if $(MOD_ENABLED),modules) |
56 | - $(hide) $(ACP) -fp $(BUILT_KERNEL_TARGET) $@ | |
57 | 56 | $(if $(FIRMWARE_ENABLED),$(mk_kernel) INSTALL_MOD_PATH=$(abspath $(TARGET_OUT)) firmware_install) |
58 | 57 | |
59 | 58 | ifneq ($(MOD_ENABLED),) |
@@ -61,12 +60,12 @@ KERNEL_MODULES_DEP := $(firstword $(wildcard $(TARGET_OUT)/lib/modules/*/modules | ||
61 | 60 | KERNEL_MODULES_DEP := $(if $(KERNEL_MODULES_DEP),$(KERNEL_MODULES_DEP),$(TARGET_OUT)/lib/modules) |
62 | 61 | |
63 | 62 | ALL_EXTRA_MODULES := $(patsubst %,$(TARGET_OUT_INTERMEDIATES)/kmodule/%,$(TARGET_EXTRA_KERNEL_MODULES)) |
64 | -$(ALL_EXTRA_MODULES): $(TARGET_OUT_INTERMEDIATES)/kmodule/%: $(INSTALLED_KERNEL_TARGET) | |
63 | +$(ALL_EXTRA_MODULES): $(TARGET_OUT_INTERMEDIATES)/kmodule/%: $(BUILT_KERNEL_TARGET) | |
65 | 64 | @echo Building additional kernel module $* |
66 | 65 | $(hide) mkdir -p $(@D) && $(ACP) -fr $(EXTRA_KERNEL_MODULE_PATH_$*) $(@D) |
67 | 66 | $(mk_kernel) M=$(abspath $@) modules |
68 | 67 | |
69 | -$(KERNEL_MODULES_DEP): $(INSTALLED_KERNEL_TARGET) $(ALL_EXTRA_MODULES) | |
68 | +$(KERNEL_MODULES_DEP): $(BUILT_KERNEL_TARGET) $(ALL_EXTRA_MODULES) | |
70 | 69 | $(hide) rm -rf $(TARGET_OUT)/lib/modules |
71 | 70 | $(mk_kernel) INSTALL_MOD_PATH=$(abspath $(TARGET_OUT)) modules_install |
72 | 71 | $(hide) for kmod in $(TARGET_EXTRA_KERNEL_MODULES) ; do \ |
@@ -88,19 +87,19 @@ endif | ||
88 | 87 | |
89 | 88 | installclean: FILES += $(KBUILD_OUTPUT) $(INSTALLED_KERNEL_TARGET) |
90 | 89 | |
91 | -TARGET_PREBUILT_KERNEL := $(INSTALLED_KERNEL_TARGET) | |
90 | +TARGET_PREBUILT_KERNEL := $(BUILT_KERNEL_TARGET) | |
92 | 91 | |
93 | 92 | .PHONY: kernel $(if $(KERNEL_ARCH_CHANGED),$(KERNEL_HEADERS_COMMON)/linux/binder.h) |
94 | -kernel: $(TARGET_PREBUILT_KERNEL) | |
93 | +kernel: $(INSTALLED_KERNEL_TARGET) | |
95 | 94 | |
96 | -else | |
95 | +endif # TARGET_PREBUILT_KERNEL | |
97 | 96 | |
97 | +ifndef CM_BUILD | |
98 | 98 | $(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP) |
99 | 99 | $(copy-file-to-new-target) |
100 | 100 | ifdef TARGET_PREBUILT_MODULES |
101 | 101 | mkdir -p $(TARGET_OUT)/lib |
102 | 102 | $(hide) cp -r $(TARGET_PREBUILT_MODULES) $(TARGET_OUT)/lib |
103 | 103 | endif |
104 | - | |
105 | -endif # TARGET_PREBUILT_KERNEL | |
104 | +endif # CM_BUILD | |
106 | 105 | endif # KBUILD_OUTPUT |