diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-01-18 08:29:05 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-01-18 08:29:05 +0000 |
commit | 1d10737eb4857cc05007530c28339c29777fa5ff (patch) | |
tree | 772c2d0f2afb4aa89dcc2e1e1ad1d336d95b3b4d /dmake/dmake.c | |
parent | ccbea50cb01ed7f16e03e62ba6e859931469cd87 (diff) |
INTEGRATION: CWS dmake47 (1.8.2); FILE MERGED
2006/12/06 22:09:19 vq 1.8.2.4: #i72337# Make dmake -V tell whether fork/exec or spawn is used.
2006/11/19 05:27:24 vq 1.8.2.3: #i71704# Let the global .SEQUENTIAL attribute implicitely set MAXPROCESS=1
and disallow MAXPROCESS to be changed if the global .SEQUENTIAL is set.
2006/11/12 05:06:38 vq 1.8.2.2: #i71422# Add a new feature: Using @@ as a recipe prefix redirects the
output (stdout and stderr) of a recipe to /dev/null (or NUL on W32)
completely suppressing the output of that recipe to the terminal.
As for the @ prefix this can be disabled using the -v[r] switch.
2006/10/01 19:18:26 vq 1.8.2.1: #i69742# Create Clean_path() function.
Diffstat (limited to 'dmake/dmake.c')
-rw-r--r-- | dmake/dmake.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/dmake/dmake.c b/dmake/dmake.c index 3ffd09f489d4..b38b268bda48 100644 --- a/dmake/dmake.c +++ b/dmake/dmake.c @@ -1,6 +1,6 @@ /* $RCSfile: dmake.c,v $ --- $Revision: 1.8 $ --- last change: $Author: vg $ $Date: 2006-09-25 09:39:05 $ +-- $Revision: 1.9 $ +-- last change: $Author: vg $ $Date: 2007-01-18 09:29:05 $ -- -- SYNOPSIS -- The main program. @@ -135,6 +135,11 @@ char **argv; int ex_val; int m_export; + /* Uncomment the following line to pass commands to the DBUG engine + * before the command line switches (-#..) are evaluated. */ + /* + DB_PUSH("d,path"); + */ DB_ENTER("main"); /* Initialize Global variables to their default values */ @@ -174,6 +179,10 @@ char **argv; Shell_exec_target = NIL(CELL); stdout_redir = NIL(FILE); + /* Get fd for for @@-recipe silencing. */ + if( (zerofd = open(NULLDEV, O_WRONLY)) == -1 ) + Fatal( "Error opening %s !", NULLDEV ); + Verbose = V_NOFLAG; Measure = M_NOFLAG; Transitive = TRUE; @@ -302,7 +311,9 @@ char **argv; case 'P': if( p[1] ) { - Def_macro( "MAXPROCESS", p+1, M_MULTI|M_EXPANDED ); + /* Only set MAXPROCESS if -S flag is *not* used. */ + if( !(Glob_attr & A_SEQ) ) + Def_macro( "MAXPROCESS", p+1, M_MULTI|M_EXPANDED ); p += strlen(p)-1; } else @@ -352,6 +363,7 @@ char **argv; Make_rules(); /* potential targets */ _warn = TRUE; + /* If -r was not given find and parse startup-makefile. */ if( Rules ) { char *fname; @@ -368,6 +380,7 @@ char **argv; if( Get_env == 'E' ) _do_ReadEnvironment(); + /* Search for and parse user makefile. */ if( fil_name != NIL(char) ) mkfil = Openfile( fil_name, FALSE, TRUE ); else { @@ -423,11 +436,14 @@ char **argv; if( Buffer != NIL(char) ) {FREE( Buffer ); Buffer = NIL(char);} if( Trace ) Def_macro(".SEQUENTIAL", "y", M_EXPANDED); - if( Glob_attr & A_SEQ ) Def_macro( "MAXPROCESS", "1", M_EXPANDED|M_FORCE ); ex_val = Make_targets(); Clear_signals(); + + /* Close fd for for @@-recipe silencing. */ + if( close(zerofd) ) + Fatal( "Error closing %s !", NULLDEV ); Epilog(ex_val); /* Does not return -- EVER */ return 0; } @@ -889,5 +905,16 @@ Version() printf("\t%s\n", *p); printf("\n"); -printf("Please read the file readme/read1st.txt for the latest release notes.\n"); + +#if defined(HAVE_SPAWN_H) || defined(__CYGWIN__) + /* Only systems that have spawn ar concerned whether spawn or fork/exec + * are used. */ +#if ENABLE_SPAWN + printf("Subprocesses are executed using: spawn.\n\n"); +#else + printf("Subprocesses are executed using: fork/exec.\n\n"); +#endif +#endif + + printf("Please read the NEWS file for the latest release notes.\n"); } |