.SECONDARY: foo.x.h: cmd-xgrep = grep 'X' '$<' >'$@' %.x: % $(cmd-xgrep) cmd-addheader = echo 'Header:' | cat - '$<' >'$@' %.h: % $(cmd-addheader)