]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/Makefile
CAN driver infrastructure redesign to LinCAN-0.2 version
[lincan.git] / lincan / src / Makefile
index b83aa6dd039a539215b8e2a5cc26bd7e16e466d7..8f5cfa29f7e164c417dc5bd60b502d4b98909fff 100644 (file)
@@ -1,7 +1,7 @@
 # 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
@@ -33,6 +29,10 @@ SUPPORTED_CARDS = pip pccan smartcan nsi cc_can104 \
                  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
@@ -91,7 +91,8 @@ O_TARGET     = can.o
 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      = 
@@ -111,12 +112,18 @@ can-objs := $(O_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
 
@@ -133,17 +140,16 @@ make_this_module: .supported_cards.h
        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