From 3f083c05e749aa67606693525ebf8a6b9b007232 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 14 Jul 2008 15:33:00 +0000 Subject: [PATCH] Fix for EXTRA_RULES_SUBDIR bug reported by Petr Smolik 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 | 3 ++- tests/extra_rules_subdirs/Makefile.omk | 4 +--- tests/extra_rules_subdirs/runtest | 5 ++++- .../{tools => subdir2}/Makefile | 0 tests/extra_rules_subdirs/subdir2/Makefile.omk | 1 + tests/extra_rules_subdirs/subdir2/tools/Makefile | 14 ++++++++++++++ .../extra_rules_subdirs/subdir2/tools/Makefile.omk | 4 ++++ .../extra_rules_subdirs/{ => subdir2}/tools/test.c | 0 tests/extra_rules_subdirs/tools/Makefile.omk | 5 ----- 9 files changed, 26 insertions(+), 10 deletions(-) rename tests/extra_rules_subdirs/{tools => subdir2}/Makefile (100%) create mode 100644 tests/extra_rules_subdirs/subdir2/Makefile.omk create mode 100644 tests/extra_rules_subdirs/subdir2/tools/Makefile create mode 100644 tests/extra_rules_subdirs/subdir2/tools/Makefile.omk rename tests/extra_rules_subdirs/{ => subdir2}/tools/test.c (100%) delete mode 100644 tests/extra_rules_subdirs/tools/Makefile.omk diff --git a/snippets/linux b/snippets/linux index b077e30..901155a 100644 --- a/snippets/linux +++ b/snippets/linux @@ -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 diff --git a/tests/extra_rules_subdirs/Makefile.omk b/tests/extra_rules_subdirs/Makefile.omk index 6f1fea0..90af6b9 100644 --- a/tests/extra_rules_subdirs/Makefile.omk +++ b/tests/extra_rules_subdirs/Makefile.omk @@ -1,3 +1 @@ -SUBDIRS=subdir -EXTRA_RULES_SUBDIRS = tools - +SUBDIRS=subdir subdir2 diff --git a/tests/extra_rules_subdirs/runtest b/tests/extra_rules_subdirs/runtest index 953ea3b..4a80489 100755 --- a/tests/extra_rules_subdirs/runtest +++ b/tests/extra_rules_subdirs/runtest @@ -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/tools/Makefile b/tests/extra_rules_subdirs/subdir2/Makefile similarity index 100% rename from tests/extra_rules_subdirs/tools/Makefile rename to tests/extra_rules_subdirs/subdir2/Makefile diff --git a/tests/extra_rules_subdirs/subdir2/Makefile.omk b/tests/extra_rules_subdirs/subdir2/Makefile.omk new file mode 100644 index 0000000..a9b6339 --- /dev/null +++ b/tests/extra_rules_subdirs/subdir2/Makefile.omk @@ -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 index 0000000..b22a357 --- /dev/null +++ b/tests/extra_rules_subdirs/subdir2/tools/Makefile @@ -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 index 0000000..5f36f44 --- /dev/null +++ b/tests/extra_rules_subdirs/subdir2/tools/Makefile.omk @@ -0,0 +1,4 @@ +$(info Extra rules goal: $(MAKECMDGOALS)) + +bin_PROGRAMS = test +test_SOURCES = test.c diff --git a/tests/extra_rules_subdirs/tools/test.c b/tests/extra_rules_subdirs/subdir2/tools/test.c similarity index 100% rename from tests/extra_rules_subdirs/tools/test.c rename to tests/extra_rules_subdirs/subdir2/tools/test.c diff --git a/tests/extra_rules_subdirs/tools/Makefile.omk b/tests/extra_rules_subdirs/tools/Makefile.omk deleted file mode 100644 index 0a29372..0000000 --- a/tests/extra_rules_subdirs/tools/Makefile.omk +++ /dev/null @@ -1,5 +0,0 @@ -$(warning Extra rules goal: $(MAKECMDGOALS)) - -bin_PROGRAMS = test - -test_SOURCES = test.c \ No newline at end of file -- 2.39.2