- Change some /./ to $(opfx).
authorMatt McCutchen <hashproduct@gmail.com>
Fri, 8 Jun 2007 19:02:52 +0000 (15:02 -0400)
committerMatt McCutchen <hashproduct@gmail.com>
Fri, 8 Jun 2007 19:02:52 +0000 (15:02 -0400)
- Rename scout-oid -> mg-scout-oid.  I'm planning to name all variables/functions
  specific to Mage (as opposed to one of its sub-libraries) beginning with mg- .
- Fix name mg-rule in comment for mg-define-rule.

src/mage.mk

index 0b1c564..b86983a 100644 (file)
@@ -95,7 +95,7 @@ define mg-translate-cmd
 $(subst $$@,$$(mg@),$(subst $$<,$$(mg<),$(subst $$^,$$(mg^),$(subst $$+,$$(mg+),$1))))
 endef
 
-# $(call mg-rule,target,prerequisite,cmd)
+# $(call mg-define-rule,target,prerequisite,cmd)
 # Defines a rule.
 # If cmd uses $@, quote if necessary so this function sees $@, etc.
 # 
@@ -110,7 +110,7 @@ endef
 # - bar is unmanaged => warn about override 
 MG-FORCE:
 .PHONY: MG-FORCE
-scout-oid:=$(newoid)
+mg-scout-oid:=$(newoid)
 define mg-define-rule
 $(eval 
 
@@ -119,8 +119,8 @@ $(eval
 $1.g: target = $$(@:.g=)
 $1.g: cmd = $(call mg-translate-cmd,$3)
 $1.g: mg@ = $$(target).tmp
-$1.g: mg^ = $$(filter-out MG-% /./%,$$^)
-$1.g: mg+ = $$(filter-out MG-% /./%,$$+)
+$1.g: mg^ = $$(filter-out MG-% $$(opfx)%,$$^)
+$1.g: mg+ = $$(filter-out MG-% $$(opfx)%,$$+)
 $1.g: mg< = $$(firstword $$(mg^))
 
 # Rule for the genfile.  Evidently all the prerequisites we want second-expanded
@@ -143,7 +143,7 @@ endef
 
 # If the target is unmanaged, we must run the rule; we'll see that the
 # obfuscated target is in $? and complain.
-mg-scout-target=$(if $(wildcard $(target)),$(scout-oid)$(aname)$(target),)
+mg-scout-target=$(if $(wildcard $(target)),$(mg-scout-oid)$(aname)$(target),)
 
 # If the command changed, we must regenerate.
 mg-check-cmd=$(if $(call streq,$(cmd),$($(target)@cmd)),,x)
@@ -179,7 +179,7 @@ endef
 #        from before the removal. (trap EXIT)
 define mg-generate
        $(call gload,$(target))\
-       $(if $(filter $(scout-oid)$(aname)$(target),$?),\
+       $(if $(filter $(mg-scout-oid)$(aname)$(target),$?),\
                $(info mage: warning: Manually created/modified file at $(target) overrides rule.)\
                $(eval $(target)@cmd:=)$(eval $(target)@warnings:=)$(eval $(target)@deps:=)\
        ,\