rule FSameTargetWithPrependedGrist { # SameTargetWithPrependedGrist : ; # local target = $(1) ; local gristToPrepend = $(2) ; local grist = $(target:G) ; if $(grist) { grist = $(gristToPrepend)!$(grist) ; } else { grist = $(gristToPrepend) ; } return $(target:G=$(grist)) ; } rule InitScript { # Note: The script must have been LOCATEd before. local script = $(1) ; local initScript = [ FSameTargetWithPrependedGrist $(script) : init-script ] ; if ! [ on $(script) return $(__is_initialized) ] { __is_initialized on $(script) = true ; MakeLocate $(initScript) : [ on $(script) return $(LOCATE) ] ; Always $(initScript) ; Depends $(script) : $(initScript) ; InitScript1 $(initScript) ; } return $(initScript) ; } actions InitScript1 { $(RM) $(1) echo -n > $(1) } rule AddVariableToScript script : variable : value { # AddVariableToScript