Add -o option to specify executable name

This commit is contained in:
Wilson Snyder
2010-01-30 09:42:44 -05:00
parent c49e0ac5c8
commit 7fd6ddc25b
5 changed files with 15 additions and 3 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ public:
of.puts("\n");
if (v3Global.opt.exe()) {
of.puts("default: "+v3Global.opt.prefix()+"\n");
of.puts("default: "+v3Global.opt.exeName()+"\n");
} else {
of.puts("default: "+v3Global.opt.prefix()+"__ALL.a\n");
}
@@ -205,7 +205,7 @@ public:
}
of.puts("\n### Link rules... (from --exe)\n");
of.puts(v3Global.opt.prefix()+": $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a\n");
of.puts(v3Global.opt.exeName()+": $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a\n");
of.puts("\t$(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) $(SC_LIBS) 2>&1 | c++filt\n");
of.puts("\n");
}
+3
View File
@@ -750,6 +750,9 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) {
shift; m_makeDir = argv[i];
addIncDir (string (m_makeDir)); // Need to find generated files there too
}
else if ( !strcmp (sw, "-o") && (i+1)<argc ) {
shift; m_exeName = argv[i];
}
else if ( !strncmp (sw, "-U", 2)) {
V3PreShell::undef (string (sw+strlen("-U")));
}
+2
View File
@@ -138,6 +138,7 @@ class V3Options {
int m_compLimitParens; // compiler selection options
string m_bin; // main switch: --bin {binary}
string m_exeName; // main switch: -o {name}
string m_flags; // main switch: -f {name}
string m_makeDir; // main switch: -Mdir
string m_modPrefix; // main switch: --mod-prefix
@@ -251,6 +252,7 @@ class V3Options {
int compLimitBlocks() const { return m_compLimitBlocks; }
int compLimitParens() const { return m_compLimitParens; }
string exeName() const { return m_exeName!="" ? m_exeName : prefix(); }
string makeDir() const { return m_makeDir; }
string modPrefix() const { return m_modPrefix; }
string pipeFilter() const { return m_pipeFilter; }