diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2020-08-25 19:57:50 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2020-08-25 19:57:50 +0800 |
commit | 33d4b7f884500689a297df156b1c0a29e1c525da (patch) | |
tree | 37c6c7bee9c130c8ae4ac7dc7b584d0a62c49c55 | |
parent | fbb69690ccf3dd94d8f0cd5400589ee1e81fa367 (diff) | |
download | hikey-modules-android-5.4.tar.gz |
Kbuild & Makefile: fixe the problem of generating object files under the source treeandroid-5.4
by setting to use the $(M) passed from build/build.sh which is a path
relative to the kernel source tree.
And update to use $(srctree) to specify absolute paths
for the -I ccflags options to workaround local header files not found problem
Test: with command BUILD_CONFIG=common/build.config.hikey960 ./build/build.sh
and no object files generated under the modules source directory
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Change-Id: Ia772f5234d36cd4bf711cbff077e0355a2ac1489
-rw-r--r-- | midgard/Kbuild | 12 | ||||
-rw-r--r-- | midgard/Makefile | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/midgard/Kbuild b/midgard/Kbuild index 1b0438e..bb1eddc 100644 --- a/midgard/Kbuild +++ b/midgard/Kbuild @@ -70,14 +70,14 @@ ifeq ($(KBUILD_EXTMOD),) DEFINES +=-DMALI_KBASE_PLATFORM_PATH=../../$(src)/platform/$(CONFIG_MALI_PLATFORM_NAME) else # out-of-tree -DEFINES +=-DMALI_KBASE_PLATFORM_PATH=$(src)/platform/$(CONFIG_MALI_PLATFORM_NAME) +DEFINES +=-DMALI_KBASE_PLATFORM_PATH=$(srctree)/$(src)/platform/$(CONFIG_MALI_PLATFORM_NAME) endif DEFINES += -I$(srctree)/drivers/staging/android # Use our defines when compiling -ccflags-y += $(DEFINES) -I$(KBASE_PATH) -I$(KBASE_PLATFORM_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux -subdir-ccflags-y += $(DEFINES) -I$(KBASE_PATH) -I$(KBASE_PLATFORM_PATH) -I$(OSK_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux +ccflags-y += $(DEFINES) -I$(srctree)/$(KBASE_PATH) -I$(srctree)/$(KBASE_PLATFORM_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux +subdir-ccflags-y += $(DEFINES) -I$(srctree)/$(KBASE_PATH) -I$(srctree)/$(KBASE_PLATFORM_PATH) -I$(OSK_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux SRC := \ mali_kbase_device.c \ @@ -147,7 +147,7 @@ mali_kbase-y := $(SRC:.c=.o) # Kconfig passes in the name with quotes for in-tree builds - remove them. platform_name := $(shell echo $(CONFIG_MALI_PLATFORM_NAME)) MALI_PLATFORM_DIR := platform/$(platform_name) -ccflags-y += -I$(src)/$(MALI_PLATFORM_DIR) +ccflags-y += -I$(srctree)/$(src)/$(MALI_PLATFORM_DIR) include $(src)/$(MALI_PLATFORM_DIR)/Kbuild ifeq ($(CONFIG_MALI_DEVFREQ),y) @@ -177,8 +177,8 @@ include $(src)/backend/gpu/Kbuild mali_kbase-y += $(BACKEND:.c=.o) -ccflags-y += -I$(src)/backend/gpu -subdir-ccflags-y += -I$(src)/backend/gpu +ccflags-y += -I$(srctree)/$(src)/backend/gpu +subdir-ccflags-y += -I$(srctree)/$(src)/backend/gpu # For kutf and mali_kutf_irq_latency_test #obj-$(CONFIG_MALI_KUTF) += tests/ diff --git a/midgard/Makefile b/midgard/Makefile index 2df7502..8a3494d 100644 --- a/midgard/Makefile +++ b/midgard/Makefile @@ -47,10 +47,10 @@ endif # we get the symbols from modules using KBUILD_EXTRA_SYMBOLS to prevent warnings about unknown functions all: - $(MAKE) -C $(KERNEL_SRC) M=$(CURDIR) EXTRA_CFLAGS="-I$(CURDIR) -I$(CURDIR)/../../../../include -I$(CURDIR)/../../../../tests/include $(SCONS_CFLAGS)" $(SCONS_CONFIGS) KBUILD_EXTRA_SYMBOLS="$(EXTRA_SYMBOLS)" modules $(KBUILD_OPTIONS) + $(MAKE) -C $(KERNEL_SRC) M=$(M) EXTRA_CFLAGS="-I$(CURDIR) -I$(CURDIR)/../../../../include -I$(CURDIR)/../../../../tests/include $(SCONS_CFLAGS)" $(SCONS_CONFIGS) KBUILD_EXTRA_SYMBOLS="$(EXTRA_SYMBOLS)" modules $(KBUILD_OPTIONS) modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(CURDIR) modules_install + $(MAKE) -C $(KERNEL_SRC) M=$(M) modules_install clean: - $(MAKE) -C $(KERNEL_SRC) M=$(CURDIR) clean + $(MAKE) -C $(KERNEL_SRC) M=$(M) clean |