]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/Makefile
The original version of Arnaud Westenberg Linux CAN-bus driver
[lincan.git] / lincan / Makefile
diff --git a/lincan/Makefile b/lincan/Makefile
new file mode 100644 (file)
index 0000000..75a1182
--- /dev/null
@@ -0,0 +1,220 @@
+# Makefile for the Linux CAN-bus driver.
+# Written by Arnaud Westenberg email:arnaud@wanadoo.nl
+# This software is released under the GPL-License.
+# Version 0.7  6 Aug 2001
+
+########## The following options can be changed ##########
+
+# Include directory
+INCLUDEDIR = /usr/src/linux/include
+# Compiler
+CC = gcc
+# Enable debugging messages
+DEBUG = y 
+# Enable module version support
+MODVERSIONS = y 
+
+# You can comment out the hardware you don't need. This will result in a smaller
+# driver. By default, all hardware is supported in the driver. See the README 
+# file for a description of the supported hardware.
+PIP = y
+PCCAN = y      # Not to be confused with PCCCAN!!!
+SMARTCAN = y
+NSI = y
+CC104 = y
+AIM104 = y
+PCI03 = y
+PCM3680 = y
+M437 = y
+PCCCAN = y     # Not to be confused with PCCAN!!!
+SSV = y
+TEMPLATE = y
+
+########## Don't change anything under this line please ##########
+
+KERNEL_VERSION := $(shell awk -F\" '/REL/ {print $$2}' \
+       $(INCLUDEDIR)/linux/version.h | awk -F\- '{print $$1}')
+
+PROC_FS := $(shell awk -F\  '/PROC_FS/ {print $$3}' \
+       $(INCLUDEDIR)/linux/autoconf.h)
+
+VPATH = ./src:./include:./utils
+
+CFLAGS = -D__KERNEL__ -DMODULE -O2 -Wall -Wstrict-prototypes \
+       -Wpointer-arith -I $(INCLUDEDIR)
+       
+
+ifdef DEBUG
+       CFLAGS += -DCAN_DEBUG
+endif
+
+ifndef MODVERSIONS
+       CFLAGS += -DNOVER
+endif
+
+ifdef PROC_FS
+       SRCS += proc.c
+       OBJS += proc.o
+endif
+ifdef PIP
+       SRCS += pip.c
+       OBJS += pip.o
+endif
+ifdef PCCAN
+       SRCS += pccan.c
+       OBJS += pccan.o
+endif
+ifdef SMARTCAN
+       SRCS += smartcan.c
+       OBJS += smartcan.o
+endif
+ifdef NSI
+       SRCS += nsi.c
+       OBJS += nsi.o
+endif
+ifdef CC104
+       SRCS += cc_can104.c
+       OBJS += cc_can104.o
+endif
+ifdef PCI03
+       SRCS += pc-i03.c
+       OBJS += pc-i03.o
+endif
+ifdef PCM3680
+       SRCS += pcm3680.c
+       OBJS += pcm3680.o
+endif
+ifdef AIM104
+       SRCS += aim104.c
+       OBJS += aim104.o
+endif
+ifdef M437
+       SRCS += m437.c
+       OBJS += m437.o
+endif
+ifdef PCCCAN
+       SRCS += pcccan.c
+       OBJS += pcccan.o
+endif
+ifdef SSV
+       SRCS += ssv.c
+       OBJS += ssv.o
+endif
+ifdef TEMPLATE
+       SRCS += template.c
+       OBJS += template.o
+endif
+
+SRCS += main.c modparms.c setup.c sja1000.c i82527.c close.c ioctl.c\
+       open.c write.c read.c sja1000p.c irq.c
+
+OBJS += main.o modparms.o setup.o sja1000.o i82527.o close.o ioctl.o\
+       open.o write.o read.o sja1000p.o irq.o
+
+all : mesg main.ver can.o utils
+
+mesg :
+       @echo
+       @echo Compiling for kernel version: $(KERNEL_VERSION)
+ifdef MODVERSIONS
+       @echo Compiling with module version support
+else
+       @echo Compiling without module version support
+endif
+ifdef PROC_FS
+       @echo Compiling with proc filesystem support
+else
+       @echo Compiling without proc filesystem support
+endif
+       @echo
+
+ifdef MODVERSIONS
+main.ver : main.c
+       $(CC) -I $(INCLUDEDIR) -E -O2 -D__GENKSYMS__ $^ | \
+       /sbin/genksyms -k $(KERNEL_VERSION) > ./include/$@
+else
+main.ver:
+endif
+
+can.o : $(OBJS)
+       (cd ./src; ld -o ../can.o $(OBJS) -E -O2 -r)
+
+main.o : main.c main.h proc.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+proc.o : proc.c main.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+modparms.o : modparms.c modparms.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+setup.o : setup.c setup.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+pip.o : pip.c pip.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define PIP 1" >> .support
+pccan.o : pccan.c pccan.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define PCCAN 1" >> .support
+smartcan.o : smartcan.c smartcan.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define SMARTCAN 1" >> .support
+nsi.o : nsi.c nsi.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define NSI 1" >> .support
+cc_can104.o : cc_can104.c cc_can104.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define CC104 1" >> .support
+aim104.o : aim104.c aim104.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define AIM104 1" >> .support
+pc-i03.o : pc-i03.c pc-i03.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define PCI03 1" >> .support
+pcm3680.o : pcm3680.c pcm3680.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define PCM3680 1" >> .support
+m437.o : m437.c m437.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define M437 1" >> .support
+pcccan.o : pcccan.c pcccan.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define PCCCAN 1" >> .support
+ssv.o : ssv.c ssv.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define SSV 1" >> .support
+template.o : template.c template.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+       @echo "#define TEMPLATE 1" >> .support
+open.o : open.c open.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+i82527.o : i82527.c i82527.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+close.o : close.c close.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+read.o : read.c read.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+irq.o : irq.c irq.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+ioctl.o : ioctl.c ioctl.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+write.o : write.c write.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+sja1000.o : sja1000.c sja1000.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+sja1000p.o : sja1000p.c sja1000p.h
+       $(CC) -c -o $(<D)/$@ $< $(CFLAGS)
+
+utils : rxtx sendburst readburst
+
+rxtx : rxtx.c
+       $(CC) -o $(<D)/$@ $< -Wall
+sendburst : sendburst.c
+       $(CC) -o $(<D)/$@ $< -Wall
+readburst : readburst.c
+       $(CC) -o $(<D)/$@ $< -Wall
+
+
+clean :
+       rm -f *.o
+       rm -f .support
+       (cd src; rm -f *.o)
+       (cd include; rm -f *.ver)
+       (cd utils; rm -f rxtx sendburst readburst)