#*********************************************************************************
|
# Copyright: (C) 2021 LingYun IoT System Studio <www.weike-iot.com>
|
# All rights reserved.
|
#
|
# Filename: Makefile
|
# Description: This Makefile used to compile all the drivers here
|
#
|
# Version: 1.0.0(18/12/2021~)
|
# Author: Guo Wenxue <guowenxue@gmail.com>
|
# ChangeLog: 1, Release initial version on "18/12/2021 01:29:33 PM"
|
#
|
#********************************************************************************/
|
|
ARCH ?= arm
|
CROSS_COMPILE ?= /opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
|
|
LINUX_SRC ?= ${shell pwd}/../../../kernel/linux-imx/
|
DRV_PATH ?= ${shell pwd}/../../../kernel/install/
|
|
EXTRA_INSTPATH=/tftp
|
|
PWD := $(shell pwd)
|
|
obj-m += hello.o
|
|
modules:
|
@echo ${LINUX_SRC}
|
@make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(LINUX_SRC) M=$(PWD) modules
|
@make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(LINUX_SRC) M=$(PWD) modules_install INSTALL_MOD_PATH=${DRV_PATH} INSTALL_MOD_STRIP=1
|
@make clear
|
|
install:
|
cp -af *.ko ${EXTRA_INSTPATH}
|
|
clear:
|
@rm -f *.o *.mod* .*.cmd *.symvers *.order
|
|
clean: clear
|
@rm -f *.ko
|