]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Update of Makefiles to support "Standalone" compilation.
authorppisa <ppisa>
Fri, 19 Sep 2003 19:44:31 +0000 (19:44 +0000)
committerppisa <ppisa>
Fri, 19 Sep 2003 19:44:31 +0000 (19:44 +0000)
If file "lincan/Standalone.mk" is found, the driver does not
require OCERA framework. The compile for 2.2.19, 2.4.19,
2.6.0-t4 and OCERA target tested.

lincan/Makefile
lincan/TODO
lincan/src/Makefile

index 8978872505887a53fbcd92a003ce64b84451d31b..60ca0a662e1b9f2f34ee378541a9d91786cdf524 100644 (file)
@@ -9,14 +9,32 @@
 #
 ########## The following options can be changed ##########
 
-TOPDIR = $(LINUX_DIR)
-
 SUBDIRS = src utils
 
+ifneq ($(wildcard ./Standalone.mk),)
+# Standalone make outside of OCERA framework
+
+all: default
+
+.PHONY: dep default subdirs clean cleandepend
+
+dirs = src utils
+
+default dep clean install:
+       $(foreach dir, $(dirs), $(MAKE) -C $(dir) $@ ; )
+
+else
+# Build in structure of OCERA framework
+
+TOPDIR = $(LINUX_DIR)
+
 ifneq ($(wildcard ../../../../ocera.mk),)
 include ../../../../ocera.mk
 else
 all: 
-       @echo -e "You should go to the ocera/ directory and do 'make' to generate the ocera.mk file first.\nThanks."
+       @echo -e "\nTo build LinCAN driver for OCERA framework, ocera.mk file have"
+       @echo -e "to be generated first. Go to ocera/ directory and do 'make', please."
+       @echo -e "If standalone build is required, mark lincan/ by 'touch ./Standalone.mk'.\n"
+endif
 endif
 
index d2a99aae2fd795ad8a0706016e31600f1888841a..9406e948724d13ef8206de9ba0227573ff4643a8 100644 (file)
@@ -4,11 +4,11 @@ This software is released under the GPL-License.
 Version 0.7  6 Aug 2001
 
 + Poll/select
++ Add proper comment to the code
++ Get rid of CLI and STI, they are not longer supported
+  in 2.5.xx kernels
 
-- Add proper comment to the code
 - Error handling/reporting
 - Proc directory
 - Lot of ioctl's
 
-+ Get rid of CLI and STI, they are not longer supported
-  in 2.5.xx kernels
index 7f2b82077b5b1cf7ea321a30d67e90e99ef938fd..1b1f8ef394f3ebcc8ad3b67058ee260f338d9dbb 100644 (file)
@@ -3,14 +3,22 @@
 # This software is released under the GPL-License.
 # Version lincan-0.2  9 Aug 2003
 #
-# This version is adapted from uLan Communication driver
+# This Makefile version is adapted from uLan Communication driver
 # (C) Copyright 1999 by Pavel Pisa pisa@cmp.felk.cvut.cz
 #
 #*****************************************************************
 
+# Begin of OCERA framework header
 ifdef SUBDIRS
 SUBDIRS =
 endif
+ifneq ($(wildcard ../Standalone.mk),)
+# Standalone make outside of OCERA framework
+
+all : default
+
+else
+# Build in structure of OCERA framework
 
 ifneq ($(wildcard ../../../../../ocera.mk),)
 ifndef TOPDIR
@@ -19,10 +27,16 @@ else
 LINUX_DIR = ../../../../../kernel/linux/
 endif
 else
-OCERA_NOTDEF = 1
 all: 
-       @echo -e "You should go to the ocera/ directory and do 'make' to generate the ocera.mk file first.\nThanks."
+       @echo -e "\nTo build LinCAN driver for OCERA framework, ocera.mk file have"
+       @echo -e "to be generated first. Go to ocera/ directory and do 'make', please."
+       @echo -e "If standalone build is required, mark lincan/ by 'touch ../Standalone.mk'.\n"
 endif
+ifdef LINUX_DIR
+KERNEL_LOCATION = $(LINUX_DIR)
+endif
+endif
+# End of OCERA framework header
 
 # Where to look for kernel
 # if not defined, sources of current running kernel are found
@@ -32,9 +46,6 @@ endif
 #KERNEL_LOCATION=/usr/src/linux-2.6.0-test4
 #KERNEL_LOCATION=/home/cvs/ocera/ocera-build/kernel/linux
 
-ifdef LINUX_DIR
-KERNEL_LOCATION = $(LINUX_DIR)
-endif
 
 # Enable debugging messages
 #DEBUG = y
@@ -51,7 +62,7 @@ SUPPORTED_CARDS = pip pccan smartcan nsi cc_can104 \
 
 #SUPPORTED_CARDS = pcm3680 bfadcan pikronisa template
 
-#SUPPORTED_CARDS = pikronisa
+#SUPPORTED_CARDS = virtual
 
 ########## Don't change anything under this line ################
 
@@ -130,7 +141,7 @@ LX_OBJS      =
 # Additional CFLAGS
 EXTRA_CFLAGS +=
 
-# Linux 2.4.2 build system needs next
+# Linux 2.4.2 and newer build system needs next
 can-objs = $(O_OBJS)
 obj-y = $(O_OBJS)
 obj-m = can.o
@@ -141,11 +152,7 @@ else
 FINAL_MODULE_OBJS=$(obj-m:%.o=%.ko)
 endif
 
-########## Source/target independent buil of module #############
-
-#ifndef OCERA_NOTDEF
-all : default
-#endif
+########## Source/target independent build of module #############
 
 default : make_this_module
        cp $(FINAL_MODULE_OBJS) ../$(FINAL_MODULE_OBJS)
@@ -172,20 +179,15 @@ make_this_module_dep:
 install_this_module: make_this_module
        su -c "mkdir -v -p $(MODULE_CHAR_LOC) && cp -v $(FINAL_MODULE_OBJS) $(MODULE_CHAR_LOC)"
 
-ifndef KERNEL_MODULE_V26
-include $(KERNEL_LOCATION)/Rules.make
 clean:
        rm -f $(M_OBJS) $(MX_OBJS) $(O_OBJS) $(OX_OBJS) $(obj-m) \
              .*.o.flags .*.o.cmd .*.ko.cmd .depend .supported_cards.h *~ \
-             ../$(FINAL_MODULE_OBJS)
+             $(obj-m:%.o=%.mod.o) $(FINAL_MODULE_OBJS) ../$(FINAL_MODULE_OBJS)
 
 distclean: clean
-else
-clean:
-       rm -f $(M_OBJS) $(MX_OBJS) $(O_OBJS) $(OX_OBJS) $(obj-m:%.o=%.ko) \
-             $(obj-m:%.o=%.mod.o) .*.o.flags .*.o.cmd .*.ko.cmd .depend .supported_cards.h *~ \
-             ../$(FINAL_MODULE_OBJS)
 
-distclean: clean
+
+ifndef KERNEL_MODULE_V26
+include $(KERNEL_LOCATION)/Rules.make
 endif