}
function assert_not_saw {
if ! grep -q "$@" mgear.log; then
- echo "Good, saw '${@:$#}' in build log."
+ echo "Good, didn't see '${@:$#}' in build log."
else
echo "Did not expect '${@:$#}' in build log but saw it!"
fail
.SECONDARY:
include hc-rule.mk
-$(call mg-define-rule,%,%.ssc,sleep 1 && grep 'warn' $$< && sed -e 's_//.*$$$$__' $$< >$$t)
-$(call mg-define-rule,index,index.in,sort $$< >$$t)
+cmd-ssc=sleep 1 && grep 'warn' $< && sed -e 's_//.*$$__' $< >$@
+$(call mg-define-rule,%,%.ssc,cmd-ssc)
+cmd-index=sort $< >$@
+$(call mg-define-rule,index,index.in,cmd-index)
clean:
$(call mg-clean-cmd,.)
EOF
cat >hc-rule.mk <<'EOF'
-$(call mg-define-rule,%,%.hc,sed -e 's_#.*$$$$__' $$< >$$t)
+cmd-hc=sed -e 's_$(hash).*$$__' $< >$@
+$(call mg-define-rule,%,%.hc,cmd-hc)
EOF
# Input files.
# Change the rule for # comments to strip spaces before a #.
# Make sure foo is updated properly.
+# Also, make sure commas in commands work properly.
start_section "Command change for % <- %.hc"
cat >hc-rule.mk <<'EOF'
-$(call mg-define-rule,%,%.hc,sed -e 's_ *#.*$$$$__' $$< >$$t)
+cmd-hc=sed -e 's, *$(hash).*$$,,' $< >$@
+$(call mg-define-rule,%,%.hc,cmd-hc)
EOF
do_mgear foo