MA-18757 Fix build issue when build mxmwifi from other folder

When we build mxmwifi from other folders, like AOSP kernel
build repo to collect symbols used by imx drivers,
it will meet below build error:
  make -C common M=/home/ssd-2/jindong/android/gki-imx ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules
  make[1]: *** common: No such file or directory.  Stop.

Use KERNEL_SRC to hold kernel directory, which can be passed
from AOSP kernel build repo.

Add a new target modules_install.

Change-Id: I344b0984317ae477b6961ab05eb73bf0a6c97e50
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
This commit is contained in:
Jindong Yue 2021-12-10 14:20:40 +08:00
parent 75a3d35433
commit 8d12052fe9
2 changed files with 8 additions and 4 deletions

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
KERNEL_DIR := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_SRC := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
TARGET_ARCH := $(TARGET_KERNEL_ARCH)
MXMWIFI_CROSS_COMPILE := aarch64-linux-gnu-
@ -25,7 +25,7 @@ ARCH ?= $(TARGET_ARCH)
MXMWIFI_KERNELENVSH := $(MXMWIFI_OUT)/kernelenv.sh
$(MXMWIFI_KERNELENVSH):
mkdir -p $(MXMWIFI_OUT)
echo 'export KERNEL_DIR=$(KERNEL_DIR)' > $(MXMWIFI_KERNELENVSH)
echo 'export KERNEL_SRC=$(KERNEL_SRC)' > $(MXMWIFI_KERNELENVSH)
echo 'export CROSS_COMPILE=$(MXMWIFI_CROSS_COMPILE)' >> $(MXMWIFI_KERNELENVSH)
echo 'export ARCH=$(ARCH)' >> $(MXMWIFI_KERNELENVSH)
@ -35,7 +35,6 @@ mxmwifi: $(MXMWIFI_KERNELENVSH) $(MXMWIFI_SRC_PATH)
fi
@ . $(MXMWIFI_KERNELENVSH); $(kernel_build_shell_env) \
$(MAKE) -C $(MXMWIFI_SRC_PATH) ANDROID=yes \
PWD=$(ANDROID_BUILD_TOP)/vendor/nxp-opensource/nxp-mwifiex/mxm_wifiex/wlan_src \
$(CLANG_TO_COMPILE) \
$(KERNEL_CFLAGS) \
ARCH=$(ARCH) \

View file

@ -27,6 +27,7 @@ endif
LD ?= $(CROSS_COMPILE)ld
BACKUP= /root/backup
YMD= `date +%Y%m%d%H%M`
PWD := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
#############################################################################
# Configuration Options
@ -121,7 +122,7 @@ MODEXT = ko
ccflags-y += -I$(M)/mlan
ccflags-y += -DLINUX
KERNELDIR ?= $(KERNEL_DIR)
KERNELDIR ?= $(KERNEL_SRC)
ARCH ?= arm64
CONFIG_IMX_SUPPORT=y
ifeq ($(CONFIG_IMX_SUPPORT),y)
@ -562,6 +563,10 @@ else
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules_install
endif
###############################################################