修改makefile 即可,默认改为arm构架
或者使用
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16
gg@ubuntu:~/linux_mx6ull/LINUX_drv/01_chrdevbase$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16
make -C /home/gg/linux_mx6ull/LINUX_drv/linux-imx-4.1.15-2.1.0 M=/home/gg/linux_mx6ull/LINUX_drv/01_chrdevbase modules
make[1]: 进入目录“/home/gg/linux_mx6ull/LINUX_drv/linux-imx-4.1.15-2.1.0”
CC [M] /home/gg/linux_mx6ull/LINUX_drv/01_chrdevbase/chrdevbase.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/gg/linux_mx6ull/LINUX_drv/01_chrdevbase/chrdevbase.mod.o
LD [M] /home/gg/linux_mx6ull/LINUX_drv/01_chrdevbase/chrdevbase.ko
make[1]: 离开目录“/home/gg/linux_mx6ull/LINUX_drv/linux-imx-4.1.15-2.1.0”
gg@ubuntu:~/linux_mx6ull/LINUX_drv/01_chrdevbase$ ls1_chrdevbase.code-workspace chrdevbase.c chrdevbase.mod.c chrdevbase.o modules.order
chrdevbaseApp.c chrdevbase.ko chrdevbase.mod.o Makefile Module.symvers
gg@ubuntu:~/linux_mx6ull/LINUX_drv/01_chrdevbase$