1 # Makefile for the Linux CAN-bus driver.
2 # Written by Arnaud Westenberg email:arnaud@wanadoo.nl
3 # This software is released under the GPL-License.
4 # Version 0.7 6 Aug 2001
6 ########## The following options can be changed ##########
9 INCLUDEDIR = /usr/src/linux/include
12 # Enable debugging messages
14 # Enable module version support
17 # You can comment out the hardware you don't need. This will result in a smaller
18 # driver. By default, all hardware is supported in the driver. See the README
19 # file for a description of the supported hardware.
21 PCCAN = y # Not to be confused with PCCCAN!!!
29 PCCCAN = y # Not to be confused with PCCAN!!!
33 ########## Don't change anything under this line please ##########
35 KERNEL_VERSION := $(shell awk -F\" '/REL/ {print $$2}' \
36 $(INCLUDEDIR)/linux/version.h | awk -F\- '{print $$1}')
38 PROC_FS := $(shell awk -F\ '/PROC_FS/ {print $$3}' \
39 $(INCLUDEDIR)/linux/autoconf.h)
41 VPATH = ./src:./include:./utils
43 CFLAGS = -D__KERNEL__ -DMODULE -O2 -Wall -Wstrict-prototypes \
44 -Wpointer-arith -I $(INCLUDEDIR)
108 SRCS += main.c modparms.c setup.c sja1000.c i82527.c close.c ioctl.c\
109 open.c write.c read.c sja1000p.c irq.c
111 OBJS += main.o modparms.o setup.o sja1000.o i82527.o close.o ioctl.o\
112 open.o write.o read.o sja1000p.o irq.o
114 all : mesg main.ver can.o utils
118 @echo Compiling for kernel version: $(KERNEL_VERSION)
120 @echo Compiling with module version support
122 @echo Compiling without module version support
125 @echo Compiling with proc filesystem support
127 @echo Compiling without proc filesystem support
133 $(CC) -I $(INCLUDEDIR) -E -O2 -D__GENKSYMS__ $^ | \
134 /sbin/genksyms -k $(KERNEL_VERSION) > ./include/$@
140 (cd ./src; ld -o ../can.o $(OBJS) -E -O2 -r)
142 main.o : main.c main.h proc.h
143 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
144 proc.o : proc.c main.h
145 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
146 modparms.o : modparms.c modparms.h
147 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
148 setup.o : setup.c setup.h
149 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
151 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
152 @echo "#define PIP 1" >> .support
153 pccan.o : pccan.c pccan.h
154 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
155 @echo "#define PCCAN 1" >> .support
156 smartcan.o : smartcan.c smartcan.h
157 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
158 @echo "#define SMARTCAN 1" >> .support
160 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
161 @echo "#define NSI 1" >> .support
162 cc_can104.o : cc_can104.c cc_can104.h
163 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
164 @echo "#define CC104 1" >> .support
165 aim104.o : aim104.c aim104.h
166 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
167 @echo "#define AIM104 1" >> .support
168 pc-i03.o : pc-i03.c pc-i03.h
169 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
170 @echo "#define PCI03 1" >> .support
171 pcm3680.o : pcm3680.c pcm3680.h
172 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
173 @echo "#define PCM3680 1" >> .support
174 m437.o : m437.c m437.h
175 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
176 @echo "#define M437 1" >> .support
177 pcccan.o : pcccan.c pcccan.h
178 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
179 @echo "#define PCCCAN 1" >> .support
181 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
182 @echo "#define SSV 1" >> .support
183 template.o : template.c template.h
184 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
185 @echo "#define TEMPLATE 1" >> .support
186 open.o : open.c open.h
187 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
188 i82527.o : i82527.c i82527.h
189 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
190 close.o : close.c close.h
191 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
192 read.o : read.c read.h
193 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
195 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
196 ioctl.o : ioctl.c ioctl.h
197 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
198 write.o : write.c write.h
199 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
200 sja1000.o : sja1000.c sja1000.h
201 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
202 sja1000p.o : sja1000p.c sja1000p.h
203 $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
205 utils : rxtx sendburst readburst
208 $(CC) -o $(<D)/$@ $< -Wall
209 sendburst : sendburst.c
210 $(CC) -o $(<D)/$@ $< -Wall
211 readburst : readburst.c
212 $(CC) -o $(<D)/$@ $< -Wall
219 (cd include; rm -f *.ver)
220 (cd utils; rm -f rxtx sendburst readburst)