help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

double-space


From: William Pursell
Subject: double-space
Date: Sat, 16 Aug 2008 23:04:02 +0100
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)


I often find that it is difficult to visually
distinguish command output from make.  This
patch adds a --double-space option that appends
a newline to each command (useful with automake
when commands are often 6 or more lines long.)
Is there already a (better) way to do this?


diff --git a/job.c b/job.c
index a81cd81..c548702 100644
--- a/job.c
+++ b/job.c
@@ -1083,7 +1083,7 @@ start_job_command (struct child *child)
     appear.  */

message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
-          ? "%s" : (char *) 0, p);
+          ? "%s%s" : (char *) 0, p, double_space ? "\n" : "" );

  /* Tell update_goal_chain that a command has been started on behalf of
     this target.  It is important that this happens here and not in
diff --git a/main.c b/main.c
index 483babf..b56704c 100644
--- a/main.c
+++ b/main.c
@@ -267,6 +267,10 @@ static int print_usage_flag = 0;

int warn_undefined_variables_flag;

+/* If nonzero, append an additional newline to all commands. */
+
+int double_space = 0;
+
/* If nonzero, always build all targets, regardless of whether
   they appear out of date or not.  */

@@ -416,6 +420,8 @@ static const struct command_switch switches[] =
    { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0, "what-if" },
{ CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
      "warn-undefined-variables" },
+    { CHAR_MAX+5, flag, (char *) &double_space, 1, 1, 0, 0, 0,
+      "double-space" },
    { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
  };


diff --git a/make.h b/make.h
index 994f4f2..73238f9 100644
--- a/make.h
+++ b/make.h
@@ -507,6 +507,7 @@ extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
extern int print_version_flag, print_directory_flag, check_symlink_flag;
extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
extern int second_expansion, clock_skew_detected, rebuilding_makefiles;
+extern int double_space;

/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;







reply via email to

[Prev in Thread] Current Thread [Next in Thread]