Merge: LinCAN partial update of thread helper support for 2.6.27+ kernels.
[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 gensja1000io pikronisa eb8245 \
3                 kv_pcican msmcan oscar adlink7841 pcan_pci esdpci200 unican virtual template
4
5 lincan_morecards_NAMES = hms30c7202_can ns_dev_can ipci165 pimx1 tscan1 nsi_canpci sh7760
6
7 default_CONFIG = CONFIG_OC_LINCAN=y CONFIG_OC_LINCANRTL=n CONFIG_OC_LINCANVME=n
8 default_CONFIG += CONFIG_OC_LINCAN_PORTIO_ONLY=n CONFIG_OC_LINCAN_MEMIO_ONLY=n
9 default_CONFIG += CONFIG_OC_LINCAN_DETAILED_ERRORS=y
10 default_CONFIG += $(foreach n, $(lincan_cards_NAMES), CONFIG_OC_LINCAN_CARD_$(n)=y)
11 default_CONFIG += $(foreach n, $(lincan_morecards_NAMES), CONFIG_OC_LINCAN_CARD_$(n)=n)
12
13
14 lincan_cards_SELECTED = $(filter %.y, $(foreach x, $(lincan_cards_NAMES) $(lincan_morecards_NAMES), $(x).$(CONFIG_OC_LINCAN_CARD_$(x))))
15 lincan_cards_SELECTED := $(lincan_cards_SELECTED:%.y=%)
16
17 LOCAL_CONFIG_H = lincan_config.h
18
19 ifeq ($(CONFIG_OC_LINCAN),y)
20
21 rtlinux_INCLUDES = -I $(srcdir)/../include -I .
22 kernel_INCLUDES = -I $(srcdir)/../include -I .
23 #kernel_INCLUDES += -DCAN_DEBUG
24 kernel_INCLUDES += -DWITH_DEVFS_FS
25
26 lincan_cards_SOURCES = $(lincan_cards_SELECTED:%=%.c)
27
28 ifeq ($(CONFIG_OC_LINCAN_CARD_unican),y)
29 lincan_cards_SOURCES += unican_cl2.c
30 endif
31
32 ifeq ($(CONFIG_OC_LINCAN_CARD_ipci165),y)
33 lincan_cards_SOURCES += ipci165_fw.c kthread.c
34 endif
35
36 ifeq ($(CONFIG_OC_LINCAN_CARD_sh7760),y)
37 lincan_cards_SOURCES += sh7760.c
38 endif
39
40 ifneq ($(filter hms30c7202_can ns_dev_can,$(lincan_cards_SELECTED)),)
41 $(warning Not finished C_CAN support requested)
42 lincan_cards_SOURCES += c_can.c c_can_irq.c
43 endif
44
45 ifneq ($(CONFIG_OC_LINCANRTL),y)
46
47 kernel_MODULES = lincan
48
49 else #CONFIG_OC_LINCANRTL
50
51 rtlinux_MODULES = lincan
52
53 rtlinux_INCLUDES +=  -DCAN_WITH_RTL
54 lincan_rtl_SOURCES = open_rtl.c close_rtl.c read_rtl.c write_rtl.c ioctl_rtl.c \
55                 can_quertl.c can_devrtl.c
56 endif #CONFIG_OC_LINCANRTL
57
58 lincan_SOURCES = can_queue.c can_quekern.c main.c modparms.c \
59                 devcommon.c setup.c finish.c irq.c sysdep_lnx.c boardlist.c \
60                 sja1000p.c sja1000.c i82527.c hcan2.c \
61                 open.c close.c read.c write.c ioctl.c select.c fasync.c \
62                 proc.c ioctl_query.c ioctl_remote.c \
63                 $(lincan_cards_SOURCES) $(lincan_rtl_SOURCES)
64
65 endif #CONFIG_OC_LINCAN