$1.g: $2 $$$$(mg-scout-target) MG-FORCE
$$(mg-generate)
+$(mg-file-from-genfile)
+)
+endef
+
+define mg-file-from-genfile
# If the file was regenerated, load the new genfile.
# If not, replay any warnings.
-## We don't have to worry about .DELETE_ON_ERROR deleting the target because
-## it is only touched if we *successfully* regenerate it.
-# - No longer applies because we don't remember errors.
# HMMM Maybe errors should go to stderr???
$1: MG-FORCE | $1.g
$$(call gload,$$@)
$$(if $$($$@@warnings),$$(if $$($$@@built),,$$(info $$($$@@cmd) # warning replay)$$(info $$($$@@warnings))),)
-)
endef
# If the target is unmanaged, we must run the rule; we'll see that the
mg-check-cmd=$(if $(call streq,$(cmd),$($(target)@cmd)),,x)
# Just add additional prerequisites.
-# I don't think this works for implicit rules.
+# I don't think this can add patterns to implicit rules, but it should be able
+# to add specific prerequisites to uses of implicit rules.
define mg-define-prereq
$(eval
$1.g: $2