-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-mmc
92 lines (76 loc) · 2.3 KB
/
Makefile-mmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# can4linux -- LINUX device driver Makefile
# Copyright (c) 2008 port GmbH Halle/Saale
# Used release tag for this software version
include $(PWD)/version.inc
#
# The driver major device number
# The new linux/Documentation/devices.txt defines major=91 for CAN
CAN_MAJOR= 91
CAN_MODULE = can4linux
TARGET=MMC_SJA1000
# location of the compiled objects and the final driver module
OBJDIR = obj
# Debugging Code within the driver
# to use the Debugging option
# and the Debugging control via /proc/sys/dev/Can/DbgMask
# the Makefile in subdir Can must called with the DEBUG set to
# DEBUG=1
# else
# NODEBUG
# doesn't compile any debug code into the driver
DEBUG=NODEBUG
DEBUG=DEBUG=1
# all definitions for compiling the sources
# CAN_PORT_IO - use port I/O instead of memory I/O
# CAN_INDEXED_PORT_IO - CAN registers adressed by a pair of registers
# one is selcting the register the other one does i/O
# used eg. on Elan CPUs
# CAN4LINUX_PCI
# IODEBUG - all register write accesses are logged
# CONFIG_TIME_MEASURE=1 - enable Time measurement at parallel port
#
# MAX_CHANNELS - max number of minor inodes supported
#
# CAN_MAX_OPEN - the driver can be opened more than once
# the number specifies the number of possible
# different process, the number of RX queues
# the driver has to handle
#
# Weidmüller MMC
# using adress/data multiplexed SJA1000 PeliCAN ISA
DEFS = -D$(TARGET) -D$(DEBUG) -DDEFAULT_DEBUG -DCAN_MAJOR=$(CAN_MAJOR) \
-DCAN_INDEXED_MEM_IO \
-DCAN_SYSCLK=5 \
-DMAX_CHANNELS=3 -DCAN_MAX_OPEN=2\
-Wno-undef
#-DCONFIG_TIME_MEASURE=1
EXTRA_CFLAGS = $(DEFS) -DVERSION=\"$(DVERSION)_$(TARGET)\"
PWD := $(shell pwd)
obj-m := $(CAN_MODULE).o
# add other object modules here
$(CAN_MODULE)-objs:= core.o \
open.o \
read.o \
write.o \
ioctl.o \
select.o \
debug.o \
util.o \
sysctl.o \
async.o \
close.o \
mmc.o \
sja1000funcs.o \
.PHONY: all
all:
@echo "CURDIR = $(CURDIR)"
@echo "CC = $(CC)"
test ! -d $(KDIR) || $(MAKE) -C $(KDIR) M=$(PWD) TARGET=$(TARGET) modules
clean:
test ! -d $(KDIR) || $(MAKE) -C $(KDIR) M=$(PWD) TARGET=$(TARGET) clean
#install:
# cp can.ko
# -mknod /dev/can0 c $(CAN_MAJOR) 0
# chmod 666 /dev/can0
inode:
@ echo "mknod /dev/can0 c 91 0"