commit - 64cf3b3c40b18d83801e4e7b16cadc09546f9951
commit + 18c95f58993a1dde81a9221b99c08ed65c2ab0c7
blob - 27f7a1d3fe9582cd9a72355c915ab67f2928c823
blob + 7ded115b6ab788205cd8f96db53d22881aa5f243
--- make/make.c
+++ make/make.c
#define MAKEFILE "MyMakefile"
#define SHELL "sh"
-// #define MAKE_DEBUG 1
-
static struct macro m_shell = {
.next = NULL,
.enext = NULL,
};
static struct macro *globals = &m_make;
+static int verbose = 0;
// MISC
struct dep *dep;
char **s;
-#if MAKE_DEBUG
- printf ("dir %s", path_to_str (prefix));
- if (name)
- printf (" (%s)", name);
- printf (" ...\n");
-#endif
+ if (verbose) {
+ printf ("dir %s", path_to_str (prefix));
+ if (name)
+ printf (" (%s)", name);
+ printf (" ...\n");
+ }
switch (sc->type) {
case SC_DIR:
usage ()
{
- fprintf (stderr, "usage: %s [-p] [target...]\n", m_make.value);
+ fprintf (stderr, "usage: %s [-pv] [target...]\n", m_make.value);
return 1;
}
m_make.value = argv[0];
- while ((option = getopt (argc, argv, "p")) != -1) {
+ while ((option = getopt (argc, argv, "pv")) != -1) {
switch (option) {
case 'p':
pr = 1;
break;
+ case 'v':
+ verbose = 1;
+ break;
case '?':
return usage ();
default: