# 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
@echo "# Config for $(RELATIVE_DIR)" >> "$(CONFIG_FILE)-default"
@$(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.
# -*- makefile -*-
-# All subdirectories (even linked) with Makefile.omk
-SUBDIRS := $(shell find -L $(SOURCES_DIR) -maxdepth 2 -mindepth 2 -name Makefile.omk|sed 's!$(SOURCES_DIR)/\(.*\)/.*!\1!')
+SUBDIRS := $(ALL_OMK_SUBDIRS)
# -*- makefile -*-
-# All subdirectories (even linked) with Makefile.omk
-SUBDIRS := $(shell find -L $(SOURCES_DIR) -maxdepth 2 -mindepth 2 -name Makefile.omk|sed 's!$(SOURCES_DIR)/\(.*\)/.*!\1!')
+SUBDIRS := $(ALL_OMK_SUBDIRS)