# 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
# LOCAL_CONFIG_H .. name of local config.h file generated from values #OMK@config_h
# of options defined in the current directory
# config_include_HEADERS .. names of global config files (possibly
QUIET_CMD_ECHO = echo
endif
+# All subdirectories (even linked ones) containing Makefile.omk
+# Usage in Makefile.omk: SUBDIRS = $(ALL_OMK_SUBDIRS)
+ALL_OMK_SUBDIRS = $(patsubst %/Makefile.omk,%,$(patsubst $(SOURCES_DIR)/%,%,$(wildcard $(SOURCES_DIR)/*/Makefile.omk)))
+
# ===================================================================
# 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@gcc
# Rules for compilation of C, C++ and assembler sources using GNU
# toolchain.