其他分享
首页 > 其他分享> > Makefile

Makefile

作者:互联网

 

ROOTFS_DIR = /opt/4412/rootfs

MODULE_NAME = led_drv
APP_NAME = led_test

CROSS_COMPILE = /home/george/Linux_4412/toolchain/gcc-4.6.4/bin/arm-none-linux-gnueabi-
CC = $(CROSS_COMPILE)gcc

ifeq ($(KERNELRELEASE), )

KERNEL_DIR = /home/george/Linux_4412/kernel/linux-3.14
CUR_DIR = $(shell pwd)

all :
make -C $(KERNEL_DIR) M=$(CUR_DIR) modules
$(CC) $(APP_NAME).c -o $(APP_NAME)

clean :
make -C $(KERNEL_DIR) M=$(CUR_DIR) clean
rm -rf $(APP_NAME)

install:
cp -raf *.ko $(APP_NAME) $(ROOTFS_DIR)/drv_module


else

obj-m += $(MODULE_NAME).o


endif

标签:KERNEL,NAME,APP,Makefile,4412,DIR,CUR
来源: https://www.cnblogs.com/thismajor/p/16197243.html