Help with some makefile hackery

Patrick Mahan mahan at
Fri Jun 25 16:30:58 UTC 2010

Oy vey!

Good point!  Not something I had considered (but should have).  Is there
a way to propogate that status through the pipe?  I am using 'tee' so
that the master build (which invokes the top-level make) can also see
the make output.  But going back and reading the man page on 'sh' shows
me that on a pipline, the status is the status of the *last* command.

Maybe I should do this instead?

src-kernel: src-kernel-tools
	cd src; ./ 2>&1 > build_amd64_kernel.log; \
		tail -f build_amd64_kernel.log

It is not too clear if the status is the last one in a compound command.

I will give that a try.



Dag-Erling Smørgrav wrote:
> Patrick Mahan <mahan at> writes:
>> In the top-level makefile I have the following label:
>> src-kernel: src-kernel-tools
>> 	cd src; ./ 2>&1 | tee build_amd64_kernel.log
>> If there is a build failure with the kernel, it can be seen in the
>> file 'build_amd64_kernel.log'.  However, the top-level make file just
>> continues on to the next label as if no error occurs.
> Make looks at tee's exit status, not the script's.

More information about the freebsd-hackers mailing list