From ab8b4d58035f4d3093b1df7c25c227e15b673f42 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 28 Jul 2023 09:16:16 +0900 Subject: build: Support --verbose option for mkheader. * src/mkheader.c (include_file): Only emit the notification when invoked with --verbose. (main): Add --verbose handling. -- Signed-off-by: NIIBE Yutaka --- src/mkheader.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/mkheader.c b/src/mkheader.c index cc0eaa3..2d7298c 100644 --- a/src/mkheader.c +++ b/src/mkheader.c @@ -28,6 +28,7 @@ static char *srcdir; static const char *hdr_version; static const char *hdr_version_number; static int cross_building; /* Command line flag. */ +static int verbose; /* Values take from the supplied config.h. */ static int have_stdint_h; @@ -427,7 +428,7 @@ include_file (const char *fname, int lnr, const char *name, void (*outf)(char*)) exit (1); } - if (repl_flag) + if (repl_flag && verbose) fprintf (stderr,"%s:%d: note: including '%s'\n", fname, lnr, incfname); @@ -648,6 +649,12 @@ main (int argc, char **argv) cross_building = 1; argc--; argv++; } + if (!strcmp (*argv, "--verbose")) + { + verbose = 1; + argc--; argv++; + } + if (argc == 1) { @@ -660,10 +667,14 @@ main (int argc, char **argv) ; /* Standard operation. */ else { - fputs ("usage: " PGM + fputs ("usage: " PGM " [options]" " host_triplet template.h config.h version version_number\n" - " " PGM - " host_triplet\n", + " " PGM " [options]" + " host_triplet\n" + "\n" + "Options:\n" + " --cross Specify cross building\n" + " --verbose Show what is going on\n", stderr); return 1; } -- cgit v1.2.3