]> rtime.felk.cvut.cz Git - omk/sssa.git/commitdiff
Fix for EXTRA_RULES_SUBDIR bug reported by Petr Smolik
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 14 Jul 2008 15:33:00 +0000 (15:33 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 14 Jul 2008 15:33:00 +0000 (15:33 +0000)
The bug was that EXTRA_RULES_SUBDIR was ignored when declared in
different directory than the one where make was invoked.

darcs-hash:20080714153345-f2ef6-be7789b580d8736c0440ab71634f429de71a9cc7.gz

snippets/linux
tests/extra_rules_subdirs/Makefile.omk
tests/extra_rules_subdirs/runtest
tests/extra_rules_subdirs/subdir2/Makefile [moved from tests/extra_rules_subdirs/tools/Makefile with 100% similarity]
tests/extra_rules_subdirs/subdir2/Makefile.omk [new file with mode: 0644]
tests/extra_rules_subdirs/subdir2/tools/Makefile [new file with mode: 0644]
tests/extra_rules_subdirs/subdir2/tools/Makefile.omk [new file with mode: 0644]
tests/extra_rules_subdirs/subdir2/tools/test.c [moved from tests/extra_rules_subdirs/tools/test.c with 100% similarity]
tests/extra_rules_subdirs/tools/Makefile.omk [deleted file]

index b077e30a0161a548e9a5f373c848facda43eec3c..901155a5ece0fe5db73b37f3f6c3d22b17552982 100644 (file)
@@ -753,7 +753,8 @@ clean-local: clean-custom
            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
index 6f1fea009fd9f31aaf41a8488d07091e7a5763cd..90af6b988d38f15b235ffd7955a300d555492b5d 100644 (file)
@@ -1,3 +1 @@
-SUBDIRS=subdir
-EXTRA_RULES_SUBDIRS = tools
-
+SUBDIRS=subdir subdir2
index 953ea3b30cb0846a6c05c2c2149c98f56db6e131..4a804894f07ac2aadc3d329adde853b8692f138f 100755 (executable)
@@ -5,5 +5,8 @@ source ../functions.sh
 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"
 
diff --git a/tests/extra_rules_subdirs/subdir2/Makefile.omk b/tests/extra_rules_subdirs/subdir2/Makefile.omk
new file mode 100644 (file)
index 0000000..a9b6339
--- /dev/null
@@ -0,0 +1 @@
+EXTRA_RULES_SUBDIRS=tools
diff --git a/tests/extra_rules_subdirs/subdir2/tools/Makefile b/tests/extra_rules_subdirs/subdir2/tools/Makefile
new file mode 100644 (file)
index 0000000..b22a357
--- /dev/null
@@ -0,0 +1,14 @@
+# 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
+
diff --git a/tests/extra_rules_subdirs/subdir2/tools/Makefile.omk b/tests/extra_rules_subdirs/subdir2/tools/Makefile.omk
new file mode 100644 (file)
index 0000000..5f36f44
--- /dev/null
@@ -0,0 +1,4 @@
+$(info Extra rules goal: $(MAKECMDGOALS))
+
+bin_PROGRAMS = test
+test_SOURCES = test.c
diff --git a/tests/extra_rules_subdirs/tools/Makefile.omk b/tests/extra_rules_subdirs/tools/Makefile.omk
deleted file mode 100644 (file)
index 0a29372..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-$(warning Extra rules goal: $(MAKECMDGOALS))
-
-bin_PROGRAMS = test
-
-test_SOURCES = test.c
\ No newline at end of file