]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/build.omk
Include __goals.omk.inc only in the approproate subtree
[omk.git] / snippets / build.omk
index 4182342c9834a12e070839893fd9bdeecdb2d686..165f715b7d54629e2132177966791a6a411b9fed 100644 (file)
@@ -16,8 +16,16 @@ $(rule_targets): $(rule_deps) #$(omk_inc_file)
        $(Q)$(rule_cmd)
 endef
 
-# TODO: Include __goals.omk.inc only in the subtree
--include $(shell true; find $(BUILD_OMK_DIR) -name '*.omk.inc') # `true' is a hack for MinGW
+# Goals are included only for this directory and all subdirectories
+# TODO: What if a target depends on a library from different
+# subtree. Then the library would be remade even if it should not
+# because its __goals.omk.inc is not included.
+-include $(shell true; find $(OMK_WORK_DIR) -name '__goals.omk.inc') # `true' is a hack for MinGW
+
+# Definition of rules is included everywhere to allow multi-directory
+# targets. 
+-include $(shell true; find $(BUILD_OMK_DIR) -name '*.omk.inc' -not -name '__goals.omk.inc') # `true' is a hack for MinGW
+
 # FIXME: Disable automatic remake of included files
 
 $(foreach rule,$(prepared_rules),$(eval $(call build_rule,$(rule))))