]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/Makefile.std
LinCAN version and documentation updated to 0.3.5 and build portability fixes.
[lincan.git] / lincan / src / Makefile.std
index f7405048fa700d4569e3b53d8466c9c58031ff68..49c49563bc54247625678d29940f76671e00d136 100644 (file)
@@ -48,6 +48,7 @@ endif
 #KERNEL_LOCATION=/usr/src/linux-2.2.19
 #KERNEL_LOCATION=/usr/src/linux-2.2.22
 #KERNEL_LOCATION=/usr/src/linux-2.6.0
+#KERNEL_LOCATION=/usr/src/linux-2.6.18-rc4/_build/arm
 #KERNEL_LOCATION=/home/cvs/ocera/ocera-build/kernel/linux
 
 
@@ -62,9 +63,13 @@ endif
 
 SUPPORTED_CARDS = pip pccan smartcan nsi cc_can104 \
                  pc_i03 pcm3680 aim104 m437 pcccan ssv \
-                 bfadcan pikronisa kv_pcican msmcan virtual template
+                 bfadcan gensja1000mm gensja1000io kv_pcican msmcan virtual template \
+                 unican unican_cl2 ems_cpcpci adlink7841 oscar \
+                 pcan_pci esdpci200
+#                hms30c7202_can c_can c_can_irq tscan1
+#                pcan_dongle
 
-#SUPPORTED_CARDS = pcm3680 bfadcan pikronisa template
+#SUPPORTED_CARDS = pcm3680 bfadcan template
 
 #SUPPORTED_CARDS = virtual
 
@@ -94,6 +99,17 @@ CONFIG_SHELL = TOPDIR=$(TOPDIR)
 KERNEL_VERSION := $(shell awk -F\" '/REL/ {print $$2}' \
        $(KERNEL_LOCATION)/include/linux/version.h | awk -F\- '{print $$1}')
 
+ifeq ($(KERNEL_VERSION),)
+KERNEL_VERSION=$(shell grep UTS_RELEASE ${KERNEL_LOCATION}/include/linux/utsrelease.h | \
+                 sed 's/[^"]*"\(.*\)\{1\}"/\1/')
+endif
+ifeq ($(KERNEL_VERSION),)
+KERNEL_VERSION=$(shell grep UTS_RELEASE ${KERNEL_LOCATION}/include/generated/utsrelease.h | \
+                 sed 's/[^"]*"\(.*\)\{1\}"/\1/')
+endif
+
+#$(warning KERNEL_VERSION = $(KERNEL_VERSION))
+
 PROC_FS := $(shell awk -F\  '/PROC_FS/ {print $$3}' \
        $(KERNEL_LOCATION)/include/linux/autoconf.h)
 
@@ -122,18 +138,24 @@ ifdef PROC_FS
        O_OBJS += proc.o
 endif
 
+ifdef SUBDIRS
+EXTRA_CFLAGS += -I $(SUBDIRS)
+else
+EXTRA_CFLAGS += -I .
+endif
+
 # Target object file if any
 # this must be undefined for 2.5.xx kernels
 ifndef KERNEL_MODULE_V26
-O_TARGET     = can.o
+O_TARGET     = lincan.o
 endif
 # Regular object files
 O_OBJS      += $(SUPPORTED_CARDS:%=%.o)
 O_OBJS       += can_queue.o can_quekern.o devcommon.o main.o modparms.o \
-               setup.o finish.o irq.o boardlist.o \
+               setup.o finish.o irq.o sysdep_lnx.o boardlist.o \
                sja1000p.o sja1000.o i82527.o  \
                open.o proc.o close.o write.o read.o \
-               ioctl.o ioctl_query.o select.o fasync.o
+               ioctl.o ioctl_query.o ioctl_remote.o select.o fasync.o
 # Objects with exported symbols (-DEXPORT_SYMTAB)
 OX_OBJS      = 
 # Module objects 
@@ -145,12 +167,14 @@ L_OBJS       =
 # Kernel only objects with exported symbols (-DEXPORT_SYMTAB)
 LX_OBJS      = 
 # Additional CFLAGS
-EXTRA_CFLAGS += -I .
+EXTRA_CFLAGS +=
 
 # Linux 2.4.2 and newer build system needs next
-can-objs = $(O_OBJS)
+lincan-objs = $(O_OBJS)
+ifndef KERNEL_MODULE_V26
 obj-y = $(O_OBJS)
-obj-m = can.o
+endif
+obj-m = lincan.o
 
 ifndef KERNEL_MODULE_V26
 FINAL_MODULE_OBJS=$(obj-m)
@@ -171,13 +195,13 @@ lincan_config.h: Makefile
        echo >lincan_config.h
        $(foreach card, $(SUPPORTED_CARDS), \
          echo \#define CONFIG_OC_LINCAN_CARD_$(card) 1 >>lincan_config.h ;)
-       
+
 make_this_module: lincan_config.h
        echo Linux kernel version $(KERNEL_VERSION)
        echo Linux kernel sources $(KERNEL_LOCATION)
        echo Module target $(obj-m)
-       echo Module objects $(can-objs)
-       DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules)
+       echo Module objects $(lincan-objs)
+       DIR=`pwd`; (cd $(KERNEL_LOCATION); make M=$$DIR SUBDIRS=$$DIR modules)
 
 make_this_module_dep:
        DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR dep)
@@ -188,7 +212,8 @@ install_this_module: make_this_module
 clean:
        rm -f $(M_OBJS) $(MX_OBJS) $(O_OBJS) $(OX_OBJS) $(obj-m) \
              .*.o.flags .*.o.cmd .*.ko.cmd .depend lincan_config.h *~ \
-             $(obj-m:%.o=%.mod.o) $(FINAL_MODULE_OBJS) ../$(FINAL_MODULE_OBJS)
+             $(obj-m:%.o=%.mod.o) $(obj-m:%.o=%.mod.c) \
+             $(FINAL_MODULE_OBJS) ../$(FINAL_MODULE_OBJS)
 
 distclean: clean