touch -t 200001010101 $(KERN_LIB_DIR)/kernel.mk ; \
fi
-default: extra-rules-subdirs include-pass library-pass binary-pass
+include-pass-submakes: extra-rules-subdirs
+default: include-pass library-pass binary-pass
ifndef OMIT_KERNEL_PASSES
# Also make kernel passes if not disabled
default: kernel-lib-pass kernel-pass
-SUBDIRS=subdir
-EXTRA_RULES_SUBDIRS = tools
-
+SUBDIRS=subdir subdir2
touch default-config
cp Makefile.rules tools/
-make -k
+make -k | tee make.log
+
+grep 'Extra rules goal:' make.log || error "Extra rules was not called"
+grep 'Main rules goal:' make.log || error "Main rules was not called"
--- /dev/null
+EXTRA_RULES_SUBDIRS=tools
--- /dev/null
+# Generic directory or leaf node makefile for OCERA make framework
+
+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
+
--- /dev/null
+$(info Extra rules goal: $(MAKECMDGOALS))
+
+bin_PROGRAMS = test
+test_SOURCES = test.c
+++ /dev/null
-$(warning Extra rules goal: $(MAKECMDGOALS))
-
-bin_PROGRAMS = test
-
-test_SOURCES = test.c
\ No newline at end of file