mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-06 14:41:02 +00:00
Introduce --timelog=FILE flag to GNU Make
This commit is contained in:
parent
edb03b89d8
commit
c2db3b703a
7 changed files with 214 additions and 0 deletions
8
third_party/make/main.c
vendored
8
third_party/make/main.c
vendored
|
@ -27,6 +27,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
|
|||
#include "getopt.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "shuffle.h"
|
||||
#include "timelog.h"
|
||||
|
||||
#include <assert.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
|
@ -374,6 +375,8 @@ static const char *const usage[] =
|
|||
N_("\
|
||||
--trace Print tracing information.\n"),
|
||||
N_("\
|
||||
-T FILE, --time-log=FILE Log command invocation microseconds to FILE.\n"),
|
||||
N_("\
|
||||
-v, --version Print the version number of make and exit.\n"),
|
||||
N_("\
|
||||
-w, --print-directory Print the current directory.\n"),
|
||||
|
@ -471,6 +474,7 @@ static struct command_switch switches[] =
|
|||
{ 'o', filename, &old_files, 0, 0, 0, 0, 0, 0, "old-file", 0 },
|
||||
{ 'O', string, &output_sync_option, 1, 1, 0, 0, "target", 0, "output-sync", 0 },
|
||||
{ 'W', filename, &new_files, 0, 0, 0, 0, 0, 0, "what-if", 0 },
|
||||
{ 'T', string, &timelog_path, 0, 0, 0, 0, 0, 0, "timelog", 0 }, // [jart]
|
||||
|
||||
/* These are long-style options. */
|
||||
{ CHAR_MAX+1, strlist, &db_flags, 1, 1, 0, 0, "basic", 0, "debug", 0 },
|
||||
|
@ -2258,6 +2262,10 @@ main (int argc, char **argv, char **envp)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* [jart] Setup command latency log. */
|
||||
|
||||
timelog_init ();
|
||||
|
||||
/* Set up MAKEFLAGS and MFLAGS again, so they will be right. */
|
||||
|
||||
define_makeflags (0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue