Add -MP option

git-svn-id: file://localhost/svn/verilator/trunk/verilator@772 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder
2006-08-31 15:29:15 +00:00
parent 764e067c84
commit fe99abeccc
8 changed files with 36 additions and 16 deletions
+1
View File
@@ -65,6 +65,7 @@ CPPFLAGSNOWALL += -DYYDEBUG # Required to get nice error messages
CPPFLAGSNOWALL += $(COPT)
CPPFLAGS = $(CPPFLAGSNOWALL)
ifeq ($(VERILATOR_AUTHOR_SITE),1) # Local... Else don't burden users
CPPFLAGSNOWALL += -MP # Only works on recent GCC versions
CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror
#CPPFLAGS += -pedantic-errors
endif
+11
View File
@@ -122,7 +122,18 @@ inline void V3FileDependImp::writeDepend(const string& filename) {
*ofp<<iter->filename()<<" ";
}
}
*ofp<<endl;
if (v3Global.opt.makePhony()) {
*ofp<<endl;
for (set<DependFile>::iterator iter=m_filenameList.begin();
iter!=m_filenameList.end(); ++iter) {
if (!iter->target()) {
*ofp<<iter->filename()<<":"<<endl;
}
}
}
}
inline void V3FileDependImp::writeTimes(const string& filename, const string& cmdlineIn) {
+4 -2
View File
@@ -358,7 +358,8 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) {
}
// Single switches
else if ( !strcmp (sw, "-E") ) { m_preprocOnly = true; }
else if ( onoff (sw, "-MMD", flag/*ref*/) ) { m_depend = flag; }
else if ( onoff (sw, "-MMD", flag/*ref*/) ) { m_makeDepend = flag; }
else if ( onoff (sw, "-MP", flag/*ref*/) ) { m_makePhony = flag; }
else if ( onoff (sw, "-assert", flag/*ref*/) ) { m_assert = flag; m_psl = flag; }
else if ( !strcmp (sw, "-cc") ) { m_outFormatOk = true; m_systemC = false; m_systemPerl = false; }
else if ( onoff (sw, "-coverage", flag/*ref*/) ) { coverage(flag); }
@@ -556,11 +557,12 @@ V3Options::V3Options() {
m_coverageLine = false;
m_coverageUser = false;
m_depend = true;
m_dumpTree = false;
m_exe = false;
m_ignc = false;
m_l2Name = true;
m_makeDepend = true;
m_makePhony = false;
m_outFormatOk = false;
m_pins64 = false;
m_profileCFuncs = false;
+4 -2
View File
@@ -44,7 +44,8 @@ class V3Options {
V3StringSet m_libraryFiles; // Verilog -v files
bool m_preprocOnly; // main switch: -E
bool m_depend; // main switch: -MMD
bool m_makeDepend; // main switch: -MMD
bool m_makePhony; // main switch: -MP
bool m_assert; // main switch: --assert
bool m_coverageLine; // main switch: --coverage-block
bool m_coverageUser; // main switch: --coverage-func
@@ -120,7 +121,8 @@ class V3Options {
// ACCESSORS (options)
const string& top() const { return m_top; }
bool preprocOnly() const { return m_preprocOnly; }
bool depend() const { return m_depend; }
bool makeDepend() const { return m_makeDepend; }
bool makePhony() const { return m_makePhony; }
bool underlineZero() const { return m_underlineZero; }
string bin() const { return m_bin; }
string flags() const { return m_flags; }
+2 -2
View File
@@ -503,10 +503,10 @@ int main(int argc, char** argv, char** env) {
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree",99));
V3Error::abortIfErrors();
if (v3Global.opt.depend()) {
if (v3Global.opt.makeDepend()) {
V3File::writeDepend(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__ver.d");
}
if (v3Global.opt.skipIdentical() || v3Global.opt.depend()) {
if (v3Global.opt.skipIdentical() || v3Global.opt.makeDepend()) {
V3File::writeTimes(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__verFiles.dat", argString);
}