diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1374,7 +1374,6 @@ main (int argc, char **argv, char **envp) #endif /* Decode the switches. */ - decode_env_switches (STRING_SIZE_TUPLE ("GNUMAKEFLAGS")); /* Clear GNUMAKEFLAGS to avoid duplication. */ @@ -1398,6 +1397,17 @@ main (int argc, char **argv, char **envp) decode_switches (argc, (const char **)argv, 0); + /* Set a variable specifying whether stdout/stdin is hooked to a TTY. */ +#ifdef HAVE_ISATTY + if (isatty (fileno (stdout))) + define_variable_cname ("MAKE_TTYOUT", TTYNAME (fileno (stdout)), + o_default, 0)->export = v_export; + + if (isatty (fileno (stderr))) + define_variable_cname ("MAKE_TTYERR", TTYNAME (fileno (stderr)), + o_default, 0)->export = v_export; +#endif + /* Reset in case the switches changed our minds. */ syncing = (output_sync == OUTPUT_SYNC_LINE || output_sync == OUTPUT_SYNC_TARGET); |