Skip to content
Snippets Groups Projects
Commit df403965 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: suppress wmkdep 'No such file' warnings in wmake -silent mode

parent e4bfefa3
Branches
Tags
No related merge requests found
#----------------------------*- makefile-gmake -*------------------------------
WMKDEP_FLAGS := -eWM_PROJECT_DIR -eWM_THIRD_PARTY_DIR
ifneq ("$(WM_QUIET)","")
E=@
define QUIET_MESSAGE
......@@ -7,6 +9,7 @@ ifneq ("$(WM_QUIET)","")
endef
define VERBOSE_MESSAGE
endef
WMKDEP_FLAGS += -q
else
E=
define QUIET_MESSAGE
......@@ -28,7 +31,6 @@ $(OBJECTS_DIR)/%.dep : %
$(call QUIET_MESSAGE,wmkdep,$(<F))
$(call VERBOSE_MESSAGE,Making dependency list for source file,$(<F))
@$(WM_SCRIPTS)/makeTargetDir $@
@$(WMAKE_BIN)/wmkdep -o$@ -I$(*D) $(LIB_HEADER_DIRS) \
-eWM_PROJECT_DIR -eWM_THIRD_PARTY_DIR $<
@$(WMAKE_BIN)/wmkdep $(WMKDEP_FLAGS) -o$@ -I$(*D) $(LIB_HEADER_DIRS) $<
#------------------------------------------------------------------------------
......@@ -36,7 +36,7 @@ Description
which makes this faster than cpp.
Usage
wmkdep [-Idir..] [-iheader...] [-eENV...] [-ofile] filename
wmkdep [-Idir..] [-iheader...] [-eENV...] [-oFile] [-q] filename
\*---------------------------------------------------------------------------*/
/* With cpp:
......@@ -264,6 +264,7 @@ static void print_fileName(const char* fileName)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int optQuiet = 0;
int nDirectories = 0;
char** directories = NULL;
char* sourceFile = NULL;
......@@ -314,18 +315,23 @@ int main(int argc, char* argv[])
fputs
(
"\nUsage: " EXENAME
" [-Idir...] [-iheader...] [-eENV...]"
" [-ofile] filename\n\n"
" [-Idir...] [-iheader...] [-eENV...] [-oFile] [-q]"
" filename\n\n"
" -Idir Directories to be searched for headers.\n"
" -iheader Headers to be ignored.\n"
" -eENV Environment variable path substitutions.\n"
" -ofile Write output to file.\n"
" -oFile Write output to File.\n"
" -q Suppress 'No such file' warnings.\n"
"\nDependency list generator, similar to 'cpp -M'\n\n",
stderr
);
return 0;
break;
case 'q': /* Option: -q (quiet) */
++optQuiet;
break;
case 'I': /* Option: -Idir */
++nDirectories;
break;
......@@ -390,7 +396,7 @@ int main(int argc, char* argv[])
}
else if (!strncmp(argv[i], "-o", 2))
{
/* Option: -ofile */
/* Option: -oFile */
if (optLen > 2)
{
outputFile = (argv[i] + 2);
......@@ -414,6 +420,7 @@ int main(int argc, char* argv[])
EXENAME ": could not open file '%s' for output: %s\n",
outputFile, strerror(errno)
);
fflush(stderr);
return 1;
}
......@@ -427,6 +434,7 @@ int main(int argc, char* argv[])
yylex();
fputs("\n\n", stdout);
fflush(stdout);
for (i = nDirectories-1; i >= 0; --i)
{
......@@ -438,9 +446,6 @@ int main(int argc, char* argv[])
free_hashTable(visitedFiles);
free_envTable();
fflush(stdout);
fflush(stderr);
return 0;
}
......@@ -553,20 +558,23 @@ void nextFile(const char* fileName)
}
}
fprintf
(
stderr,
EXENAME ": could not open file '%s' for source file '%s'",
fileName, sourceFile
);
if (nDirectories)
if (!optQuiet)
{
fprintf(stderr, ": %s", strerror(errno));
fprintf
(
stderr,
EXENAME ": could not open file '%s' for source file '%s'",
fileName, sourceFile
);
if (nDirectories)
{
fprintf(stderr, ": %s", strerror(errno));
}
fputs("\n", stderr);
fflush(stderr);
}
fputs("\n", stderr);
fflush(stdout);
fflush(stderr);
/* Only report the first occurrence */
lookUp(visitedFiles, fileName);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment