I have a makefile I am using to compile and test programs.
If there are problems with the output, I want diff to report them, and
exit the makefile.
Right now I say something like
diff foo bar
in the makefile, and if there are differences, they are printed out, and
the makefile exits.
Sometimes, diff will spew thousands of lines, since there are lots of
differences. I would
like diff to shut up after 10 lines or so, and still exit the makefile.
I tried
diff foo bar | head -10
but that took the exit status of head (which was ok), and make continued
on.
I tried
(diff foo bar | head -10)
but that didn't help either.
I even tried
$(shell diff foo bar | head -10)
but that seemd to execute diff, and the head part disappeared.
I have read the gnu info about make, but I can't figure how to propogate
the exit status of diff.
If I were using csh, I know that
(diff foo bar | head -10)
would work fine.
How do I make this work from inside of a makefile?
--