Thanks, Paul! Hmm ... I see. How about a way to call "system" without catching stdout, let stdout be copied as is to the child process? The return value could be the status of the command, so let's call it status
$(status command) Evaluates the command in sub-shell and returns the exit status. Then what I wanted would be done simply $(status perl -e 'return (-t STDOUT)' ) Sounds generic enough, no? Regards, MST Paul D. Smith wrote: >%% mst <[EMAIL PROTECTED]> writes: > > m> It turns out that there's no easy way, now, to determine inside the > m> makefile whether the output is to tty or now. > > m> the simple $(shell perl -e 'print 1 if (-t STDOUT)') > m> does not work, since anything inside a shell is sending output > m> to shell and not to tty! > m> I ended up doing this: > m> .PHONE: isatty.mak > m> include isatty.mak > m> isatty.mak: > m> @perl -e 'print "isatty:=",(-t STDOUT),"\n"' > $@ > > m> and this works but it forces an extra evaluation of makefile > m> and seems too complicated for a simple thing like that ... > > m> How about a nwe function $(isatty [n]) - like isatty on file n? > >Hmm. This is an extremely rare situation--I think this is the first >time anyone has asked for it. > >Unfortunately I don't think this is appropriate for a new function in >GNU make: it's too rarely needed and it's _very_ system specific (what >would that function do on a VMS system, or an Amiga system?) > >In the future we will be integrating a scripting language with GNU make, >to provide a much richer set of function capabilities (this is one main >reason I don't want to add too many new functions). Hopefully that >language will have facilities for testing this. > > >Thanks for the request... > > > _______________________________________________ Bug-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-make