]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Include __goals.omk.inc only in the approproate subtree
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 18 Jan 2009 20:35:22 +0000 (21:35 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 18 Jan 2009 20:35:22 +0000 (21:35 +0100)
snippets/build.omk
snippets/include.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))))
index df6d775c9bf5d76e3f01bf0d06d769564614e61d..b5ed4906923c78b4014ec676922c774f9533c856 100644 (file)
@@ -35,3 +35,6 @@ prepare-pass::
           cmp --quiet TODO_BUILD_DIR/$$$${srcfname} $(1)/$$$${destfname} \
           || ( mkdir -p `dirname $(1)/$$$${destfname}` && $$(call cp_cmd,TODO_BUILD_DIR/$$$${srcfname},$(1)/$$$${destfname}) ) || exit 1 ; )
 endef
+
+# TODO: *_GEN_HEADERS should be copied by normal rules during build
+# phase because they are generated by another rule.