guowenxue
2024-06-02 eaa90c75a6b4981dbbb15e3ebf851c056bf015c9
commit | author | age
256f95 1 #*********************************************************************************
G 2 #      Copyright:  (C) 2021 LingYun IoT System Studio <www.weike-iot.com>
3 #                  All rights reserved.
4 #
5 #       Filename:  Makefile
6 #    Description:  This Makefile used to compile all the drivers here
7 #
8 #        Version:  1.0.0(18/12/2021~)
9 #                  Author:  Guo Wenxue <guowenxue@gmail.com>
10 #      ChangeLog:  1, Release initial version on "18/12/2021 01:29:33 PM"
11 #
12 #********************************************************************************/
13
14 ARCH ?= arm
15 CROSS_COMPILE ?= /opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
16
17 LINUX_SRC ?= ${shell pwd}/../../../kernel/linux-imx/
18 DRV_PATH ?= ${shell pwd}/../../../kernel/install/
19
20 EXTRA_INSTPATH=/tftp
21
22 PWD := $(shell pwd)
23
24 obj-m += hello.o
25
26 modules:
27     @echo ${LINUX_SRC}
28     @make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(LINUX_SRC) M=$(PWD) modules
29     @make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(LINUX_SRC) M=$(PWD) modules_install INSTALL_MOD_PATH=${DRV_PATH} INSTALL_MOD_STRIP=1
30     @make clear
31
32 install:
33     cp -af *.ko ${EXTRA_INSTPATH}
34
35 clear:
36     @rm -f *.o *.mod* .*.cmd *.symvers *.order
37
38 clean: clear
39     @rm -f  *.ko
40