X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/4cf24de229090b1ab6279570a564d224e13dd706..1d20caee804d28a792dcacbf8424dc23b80c6370:/lincan/Makefile diff --git a/lincan/Makefile b/lincan/Makefile index 75a1182..f595272 100644 --- a/lincan/Makefile +++ b/lincan/Makefile @@ -1,220 +1,14 @@ -# 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 +# Generic directory or leaf node makefile for OCERA make framework -########## 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 +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) 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 +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules 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 $(> .support -pccan.o : pccan.c pccan.h - $(CC) -c -o $(> .support -smartcan.o : smartcan.c smartcan.h - $(CC) -c -o $(> .support -nsi.o : nsi.c nsi.h - $(CC) -c -o $(> .support -cc_can104.o : cc_can104.c cc_can104.h - $(CC) -c -o $(> .support -aim104.o : aim104.c aim104.h - $(CC) -c -o $(> .support -pc-i03.o : pc-i03.c pc-i03.h - $(CC) -c -o $(> .support -pcm3680.o : pcm3680.c pcm3680.h - $(CC) -c -o $(> .support -m437.o : m437.c m437.h - $(CC) -c -o $(> .support -pcccan.o : pcccan.c pcccan.h - $(CC) -c -o $(> .support -ssv.o : ssv.c ssv.h - $(CC) -c -o $(> .support -template.o : template.c template.h - $(CC) -c -o $(> .support -open.o : open.c open.h - $(CC) -c -o $(