# 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
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
@$(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!')
. $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"