]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/Makefile
Structured comments updated.
[lincan.git] / lincan / Makefile
index 60ca0a662e1b9f2f34ee378541a9d91786cdf524..f595272447ee336c2773b8736d60ee6e88cf5189 100644 (file)
@@ -1,40 +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
-#
-# Changes made by Pavel Pisa pisa@cmp.felk.cvut.cz as preliminary
-# study for OCERA Real Time CAN/CANOpen project ORTCAN
-#
-########## The following options can be changed ##########
+# Generic directory or leaf node makefile for OCERA make framework
 
-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 "\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"
+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
+
+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