From: Michal Sojka Date: Thu, 15 Mar 2007 07:27:00 +0000 (+0000) Subject: Fixed bug in $(ALL_OMK_SUBDIRS) - when used with := X-Git-Url: http://rtime.felk.cvut.cz/gitweb/omk/sssa.git/commitdiff_plain/667c7694d39079f56312b3fcef45dbd57986e70f Fixed bug in $(ALL_OMK_SUBDIRS) - when used with := darcs-hash:20070315072721-f2ef6-43659b3a48a7c500972b5cf5f390e20a90bf0f51.gz --- diff --git a/snippets/base b/snippets/base index 271149f..79be91b 100644 --- a/snippets/base +++ b/snippets/base @@ -11,7 +11,6 @@ # W .. whole tree - if set to 1, make is always called from the top-level directory # SUBDIRS .. list of subdirectories intended for make from actual directory # default_CONFIG .. list of default config assignments CONFIG_XXX=y/n ... -# ALL_OMK_SUBDIRS .. Expands to all subdirectories (even linked ones) containing Makefile.omk # We need to ensure definition of sources directory first ifndef SOURCES_DIR @@ -105,6 +104,10 @@ else QUIET_CMD_ECHO = echo endif +# All subdirectories (even linked ones) containing Makefile.omk +# Usage in Makefile.omk: SUBDIRS = $(ALL_OMK_SUBDIRS) +ALL_OMK_SUBDIRS = $(shell find -L $(SOURCES_DIR) -maxdepth 2 -mindepth 2 -name Makefile.omk|sed 's!$(SOURCES_DIR)/\(.*\)/.*!\1!') + # =================================================================== # We have set up all important variables, so we can check and include # real OCERA style Makefile.omk now @@ -172,9 +175,3 @@ default-config-pass-local: @$(foreach x, $(default_CONFIG), echo $(x) | \ sed -e 's/^.*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; ) -# ======================= -# Useful macros - -# All subdirectories (even linked ones) containing Makefile.omk -# Usage in Makefile.omk: SUBDIRS = $(ALL_OMK_SUBDIRS) -ALL_OMK_SUBDIRS = $(shell find -L $(SOURCES_DIR) -maxdepth 2 -mindepth 2 -name Makefile.omk|sed 's!$(SOURCES_DIR)/\(.*\)/.*!\1!') diff --git a/tests/all_omk_subdirs/Makefile.omk b/tests/all_omk_subdirs/Makefile.omk deleted file mode 100644 index 4392cf5..0000000 --- a/tests/all_omk_subdirs/Makefile.omk +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = $(ALL_OMK_SUBDIRS) \ No newline at end of file diff --git a/tests/all_omk_subdirs/runtest-recurs-expanded b/tests/all_omk_subdirs/runtest-recurs-expanded new file mode 100755 index 0000000..6b6aae8 --- /dev/null +++ b/tests/all_omk_subdirs/runtest-recurs-expanded @@ -0,0 +1,4 @@ +#!/bin/sh + +OP="=" +. test.inc diff --git a/tests/all_omk_subdirs/runtest-simply-expanded b/tests/all_omk_subdirs/runtest-simply-expanded new file mode 100755 index 0000000..907198c --- /dev/null +++ b/tests/all_omk_subdirs/runtest-simply-expanded @@ -0,0 +1,4 @@ +#!/bin/sh + +OP=":=" +. test.inc diff --git a/tests/all_omk_subdirs/runtest b/tests/all_omk_subdirs/test.inc similarity index 85% rename from tests/all_omk_subdirs/runtest rename to tests/all_omk_subdirs/test.inc index a83c163..1096426 100755 --- a/tests/all_omk_subdirs/runtest +++ b/tests/all_omk_subdirs/test.inc @@ -3,6 +3,8 @@ . $OMK_TESTSROOT/functions.sh touch config.omk-default +echo "SUBDIRS $OP \$(ALL_OMK_SUBDIRS)" > Makefile.omk + OUTPUT=$(make 2>&1) || canttest echo $OUTPUT | grep make-in-dir1 || error "Make was not called in dir1" echo $OUTPUT | grep make-in-dir2 || error "Make was not called in dir2"