summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--idlc/inc/idlc/options.hxx4
-rw-r--r--idlc/source/idlcmain.cxx31
-rw-r--r--idlc/source/options.cxx18
-rw-r--r--offapi/util/makefile.mk12
-rw-r--r--offapi/util/target.pmk4
-rw-r--r--udkapi/util/target.pmk4
6 files changed, 51 insertions, 22 deletions
diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index e55dc961903b..11bc0fe4d657 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -69,11 +69,15 @@ public:
const StringVector& getInputFiles() const { return m_inputFiles; }
bool readStdin() const { return m_stdin; }
+ bool verbose() const { return m_verbose; }
+ bool quiet() const { return m_quiet; }
protected:
::rtl::OString m_program;
StringVector m_inputFiles;
bool m_stdin;
+ bool m_verbose;
+ bool m_quiet;
OptionMap m_options;
};
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx
index 1ce3a9fa05b0..68c1ae7cf5a5 100644
--- a/idlc/source/idlcmain.cxx
+++ b/idlc/source/idlcmain.cxx
@@ -56,11 +56,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
sal_Int32 nErrors = 0;
if (options.readStdin()) {
- fprintf(
- stdout, "%s: compile stdin...\n",
- options.getProgramName().getStr());
+ if ( !options.quiet() )
+ fprintf(
+ stdout, "%s: Compiling stdin\n",
+ options.getProgramName().getStr());
nErrors = compileFile(0);
- if (idlc()->getWarningCount() > 0) {
+ if ( ( idlc()->getWarningCount() > 0 ) && !options.quiet() ) {
fprintf(
stdout, "%s: detected %lu warnings compiling stdin\n",
options.getProgramName().getStr(),
@@ -85,16 +86,23 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
idlc()->reset();
}
StringVector const & files = options.getInputFiles();
+ if ( options.verbose() )
+ {
+ fprintf( stdout, "%s: compiling %i source files ... \n",
+ options.getProgramName().getStr(), (int)files.size() );
+ fflush( stdout );
+ }
for (StringVector::const_iterator i(files.begin());
i != files.end() && nErrors == 0; ++i)
{
OString sysFileName( convertToAbsoluteSystemPath(*i) );
- fprintf(stdout, "%s: compile '%s' ... \n",
- options.getProgramName().getStr(), (*i).getStr());
+ if ( !options.quiet() )
+ fprintf(stdout, "Compiling: %s\n",
+ (*i).getStr());
nErrors = compileFile(&sysFileName);
- if ( idlc()->getWarningCount() )
+ if ( idlc()->getWarningCount() && !options.quiet() )
fprintf(stdout, "%s: detected %lu warnings compiling file '%s'\n",
options.getProgramName().getStr(),
sal::static_int_cast< unsigned long >(
@@ -128,15 +136,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if ( nErrors > 0 )
{
- fprintf(stdout, "%s: detected %ld errors%s",
+ fprintf(stderr, "%s: detected %ld errors%s",
options.getProgramName().getStr(),
sal::static_int_cast< long >(nErrors),
options.prepareVersion().getStr());
} else
{
- fprintf(stdout, "%s: returned successful%s",
- options.getProgramName().getStr(),
- options.prepareVersion().getStr());
+ if ( options.verbose() )
+ fprintf(stdout, "%s: returned successful%s",
+ options.getProgramName().getStr(),
+ options.prepareVersion().getStr());
}
return nErrors;
}
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index 6bfbcc9e443e..963ddafda8d0 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -37,7 +37,7 @@
using namespace rtl;
-Options::Options(): m_stdin(false)
+Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false)
{
}
@@ -190,6 +190,22 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile)
} else
throw IllegalArgument(OString(av[j]) + ", please check your input");
break;
+ case 'v':
+ if ( 0 == strcmp( &av[j][1], "verbose" ) )
+ {
+ m_verbose = true;
+ }
+ else
+ throw IllegalArgument(OString(av[j]) + ", please check your input");
+ break;
+ case 'q':
+ if ( 0 == strcmp( &av[j][1], "quiet" ) )
+ {
+ m_quiet = true;
+ }
+ else
+ throw IllegalArgument(OString(av[j]) + ", please check your input");
+ break;
case 'w':
if (av[j][2] == 'e' && av[j][3] == '\0') {
if (m_options.count("-we") == 0)
diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk
index b0fa7a30cf46..d3157dac31df 100644
--- a/offapi/util/makefile.mk
+++ b/offapi/util/makefile.mk
@@ -164,14 +164,14 @@ ALLTAR : $(UCR)$/types.db \
$(UNOTYPE_STATISTICS)
$(UCR)$/types.db : $(UCR)$/offapi.db $(SOLARBINDIR)$/udkapi.rdb
- -$(RM) $(REGISTRYCHECKFLAG)
- $(GNUCOPY) -f $(UCR)$/offapi.db $@
- $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb
+ @-$(RM) $(REGISTRYCHECKFLAG)
+ @$(GNUCOPY) -f $(UCR)$/offapi.db $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb
$(OUT)$/ucrdoc$/types_doc.db : $(OUT)$/ucrdoc$/offapi_doc.db $(SOLARBINDIR)$/udkapi_doc.rdb
- -$(RM) $(REGISTRYCHECKFLAG)
- $(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@
- $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb
+ @-$(RM) $(REGISTRYCHECKFLAG)
+ @$(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb
#JSC: The type library has changed, all temporary not checked types are removed
# and will be check from now on.
diff --git a/offapi/util/target.pmk b/offapi/util/target.pmk
index 08912b011857..63804f3e554a 100644
--- a/offapi/util/target.pmk
+++ b/offapi/util/target.pmk
@@ -30,8 +30,8 @@
#*************************************************************************
$(OUT)$/misc$/$(TARGET).idls: makefile.mk
- -$(RM) $@
- $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
ALLTAR: $(OUT)$/misc$/$(TARGET).idls
diff --git a/udkapi/util/target.pmk b/udkapi/util/target.pmk
index f6e7bc9beb3c..2a01738e7eb7 100644
--- a/udkapi/util/target.pmk
+++ b/udkapi/util/target.pmk
@@ -30,8 +30,8 @@
#*************************************************************************
$(OUT)$/misc$/$(TARGET).idls: makefile.mk
- -$(RM) $@
- $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
ALLTAR: $(OUT)$/misc$/$(TARGET).idls