863cfdc81936bebaac35c335e59ee2ba5cd3493b
[lincan.git] / lincan / src / Makefile.omk
1 lincan_cards_NAMES = pip pccan smartcan nsi cc_can104 ems_cpcpci \
2                 pc_i03 pcm3680 aim104 m437 pcccan ssv bfadcan pikronisa \
3                 kv_pcican msmcan oscar unican virtual template
4
5 default_CONFIG = CONFIG_OC_LINCAN=y CONFIG_OC_LINCANRTL=n CONFIG_OC_LINCANVME=n
6 default_CONFIG += CONFIG_OC_LINCAN_PORTIO_ONLY=n CONFIG_OC_LINCAN_MEMIO_ONLY=n
7 default_CONFIG += $(foreach n, $(lincan_cards_NAMES), CONFIG_OC_LINCAN_CARD_$(n)=y)
8
9
10 lincan_cards_SELECTED = $(filter %.y, $(foreach x, $(lincan_cards_NAMES), $(x).$(CONFIG_OC_LINCAN_CARD_$(x))))
11 lincan_cards_SELECTED := $(lincan_cards_SELECTED:%.y=%)
12
13
14 LOCAL_CONFIG_H = lincan_config.h
15
16 ifeq ($(CONFIG_OC_LINCAN),y)
17
18 rtlinux_INCLUDES = -I $(srcdir)/../include -I .
19 kernel_INCLUDES = -I $(srcdir)/../include -I .
20 #kernel_INCLUDES += -DCAN_DEBUG
21 kernel_INCLUDES += -DWITH_DEVFS_FS
22
23 lincan_cards_SOURCES = $(lincan_cards_SELECTED:%=%.c)
24
25 ifeq ($(CONFIG_OC_LINCAN_CARD_unican),y)
26 lincan_cards_SOURCES += unican_cl2.c
27 endif
28
29 ifneq ($(CONFIG_OC_LINCANRTL),y)
30
31 kernel_MODULES = lincan
32
33 else #CONFIG_OC_LINCANRTL
34
35 rtlinux_MODULES = lincan
36
37 rtlinux_INCLUDES +=  -DCAN_WITH_RTL
38 lincan_rtl_SOURCES = open_rtl.c close_rtl.c read_rtl.c write_rtl.c ioctl_rtl.c \
39                 can_quertl.c can_devrtl.c
40 endif #CONFIG_OC_LINCANRTL
41
42 lincan_SOURCES = can_queue.c can_quekern.c main.c modparms.c \
43                 devcommon.c setup.c finish.c irq.c boardlist.c \
44                 sja1000p.c sja1000.c i82527.c  \
45                 open.c close.c read.c write.c ioctl.c select.c fasync.c \
46                 proc.c ioctl_query.c $(lincan_cards_SOURCES) $(lincan_rtl_SOURCES)
47                 
48 endif #CONFIG_OC_LINCAN