]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/base
CFLAGS and CXXFLAGS can be overridden in config.omk.
[omk.git] / snippets / base
index 271149f3238b768bb1ff47f0eaae7063a196eb9a..4a96af4122f3d10849d3393fbd2f97becbe716b8 100644 (file)
@@ -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 = $(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
@@ -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!')