# 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
+# Version lincan-0.2 9 Aug 2003
#
# This version is adapted from uLan Communication driver
# (C) Copyright 1999 by Pavel Pisa pisa@cmp.felk.cvut.cz
#KERNEL_LOCATION=/usr/src/linux
#KERNEL_LOCATION=/usr/src/linux-2.2.19
#KERNEL_LOCATION=/usr/src/linux-2.2.22
-#KERNEL_LOCATION=/usr/src/linux-2.5.47
-
-# Comment-out next two lines, if you do not build driver
-# in the OCERA source tree
-TOP=../../../../..
-KERNEL_LOCATION=$(TOP)/kernel/linux
+#KERNEL_LOCATION=/usr/src/linux-2.5.69
+#KERNEL_LOCATION=/home/cvs/ocera/ocera-build/kernel/linux
# Enable debugging messages
DEBUG = y
pc_i03 pcm3680 aim104 m437 pcccan ssv \
bfadcan pikronisa template
+#SUPPORTED_CARDS = pcm3680 bfadcan pikronisa template
+
+#SUPPORTED_CARDS = pikronisa
+
########## Don't change anything under this line ################
# currently running kernel
endif
# Regular object files
O_OBJS += $(SUPPORTED_CARDS:%=%.o)
-O_OBJS += main.o modparms.o setup.o sja1000.o i82527.o close.o ioctl.o \
+O_OBJS += can_queue.o devcommon.o main.o modparms.o setup.o \
+ sja1000.o i82527.o close.o ioctl.o \
open.o write.o read.o sja1000p.o irq.o select.o
# Objects with exported symbols (-DEXPORT_SYMTAB)
OX_OBJS =
obj-y := $(O_OBJS)
obj-m := can.o
+ifndef KERNEL_MODULE_V26
+FINAL_MODULE_OBJS=$(obj-m)
+else
+FINAL_MODULE_OBJS=$(obj-m:%.o=%.ko)
+endif
+
########## Source/target independent buil of module #############
all : default
default : make_this_module
- cp can.o ../can.o
+ cp $(FINAL_MODULE_OBJS) ../$(FINAL_MODULE_OBJS)
dep: make_this_module_dep
echo Module target $(obj-m)
echo Module objects $(can-objs)
DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules)
- for f in $(obj-m:%.o=%) ; do if [ -f $$f.ko ] ; then cp -u $$f.ko $$f.o ; fi ; done
make_this_module_dep:
DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR dep)
install_this_module: make_this_module
- su -c "mkdir -v -p $(MODULE_CHAR_LOC); cp -v $(obj-m) $(MODULE_CHAR_LOC)"
+ su -c "mkdir -v -p $(MODULE_CHAR_LOC) && cp -v $(FINAL_MODULE_OBJS) $(MODULE_CHAR_LOC)"
clean:
rm -f $(M_OBJS) $(MX_OBJS) $(O_OBJS) $(OX_OBJS) $(obj-m) $(obj-m:%.o=%.ko) \
- .*.o.flags .*.o.cmd .depend .supported_cards.h *~
+ .*.o.flags .*.o.cmd .*.ko.cmd .depend .supported_cards.h *~
ifndef KERNEL_MODULE_V26
include $(KERNEL_LOCATION)/Rules.make