makefile

来自「canpie 一个can bus的协议栈 - CAN interface fo」· 代码 · 共 107 行

TXT
107
字号
#=============================================================================## Makefile for Linux CANpie kernel drivers and user space lib                 ##                                                                             ##=============================================================================##----------------------------------------------------------# Compile CANpie driver as module (m)#CONFIG_CANPIE             = mCONFIG_CP_DRV_LOOP        = mCONFIG_CP_DRV_MC_PCMCIA   = n CONFIG_CP_DRV_MC_PCI      = n#----------------------------------------------------------# Compile for code debugging:# set symbol CONFIG_CP_DEBUG to 'y'#CONFIG_CP_DEBUG = y#----------------------------------------------------------# configure with the old-style /dev/can interface#CONFIG_CP_DEV = n#----------------------------------------------------------# configure with the new-style socket interface#CONFIG_CP_SOCKET = y#----------------------------------------------------------# configure maximum number of physical CAN interfaces#CONFIG_CP_PHYIF = 16#----------------------------------------------------------# Use RTAI for the driver:# set symbol CONFIG_CP_RTAI to 'y'CONFIG_CP_RTAI = n#----------------------------------------------------------# Include directories# INC_LINUX  - the Linux kernel includes# INC_CANPIE - the CANpie includes# INC_RTAI   - RTAI includes#INC_LINUX  = /usr/src/linux/includeINC_RTAI   = /usr/src/rtai/includeKERNEL_VER = $(shell awk -F\" '/REL/ {print $$2}' $(INC_LINUX)/linux/version.h)#----------------------------------------------------------# Define the targets#ifeq ($(KERNELRELEASE),)	KERNELDIR = /usr/src/linuxPWD       = $(shell pwd)	default:	$(MAKE) -C $(KERNELDIR) M=$(PWD) modulesclean:	$(MAKE) -C $(KERNELDIR) M=$(PWD) cleanelseifneq ($(KBUILD_EXTMOD),)	EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)	EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/../../include	EXTRA_CFLAGS += -Wno-parenthesesendif			#--- CANpie kernel module -----------------obj-$(CONFIG_CANPIE)			:= canpie.o#----------------------------------------------------------# Define the dependence#canpie-y := canpie_hal.o canpie_fifo.o canpie_proc.o canpie-$(CONFIG_CP_SOCKET) += af_can.o#----------------------------------------------------------# Flags for compiler#EXTRA_CFLAGS 	+= -DCP_CHANNEL_MAX=$(CONFIG_CP_PHYIF) -WallEXTRA_CFLAGS 	+= -DCP_CAN_MSG_MACRO -DCP_TARGET=CP_CC_LINUXifeq ($(CONFIG_CP_DEBUG), y)   	EXTRA_CFLAGS += -DCP_DEBUGendififeq ($(CP_USE_RTAI), y)	EXTRA_CFLAGS += -I$(INC_RTAI) -DCP_USE_RTAI=1endififeq ($(CONFIG_CP_DEV), y)	EXTRA_CFLAGS += -DCP_CONFIG_DEV=1endififeq ($(CONFIG_CP_SOCKET), y)	EXTRA_CFLAGS += -DCP_CONFIG_SOCKET=1endifendif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?