summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-11-27 18:49:42 -0500
committerAdrian Thurston <thurston@complang.org>2015-11-27 18:49:42 -0500
commit3b91ea314d5b96f48955430b09d5bb072f7c1ef1 (patch)
tree0094ab71cb4a43ca4f9376938140431c87e294bb /src/main.cc
parent255a339bf052fbc2a2412fd88b89936c95c7db33 (diff)
downloadcolm-3b91ea314d5b96f48955430b09d5bb072f7c1ef1.tar.gz
added an option, -b, for specifying the name of the program object
This also triggers the omission of C adapter funcs, which need to be present only once in a binary that includes a colm code.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc
index 6f8a28b9..e8fba5ca 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -84,7 +84,9 @@ const char *binaryFn = 0;
const char *exportHeaderFn = 0;
const char *exportCodeFn = 0;
const char *commitCodeFn = 0;
+const char *objectName = "colm_object";
bool exportCode = false;
+bool hostAdapters = true;
bool generateGraphviz = false;
bool verbose = false;
@@ -509,7 +511,7 @@ bool inSourceTree( const char *argv0 )
void processArgs( int argc, const char **argv )
{
- ParamCheck pc( "cD:e:x:I:vdlio:S:M:vHh?-:sVa:m:", argc, argv );
+ ParamCheck pc( "cD:e:x:I:vdlio:S:M:vHh?-:sVa:m:b:", argc, argv );
while ( pc.check() ) {
switch ( pc.state ) {
@@ -531,8 +533,8 @@ void processArgs( int argc, const char **argv )
case 'i':
branchPointInfo = true;
break;
- /* Output. */
case 'o':
+ /* Output. */
if ( *pc.parameterArg == 0 )
error() << "a zero length output file name was given" << endl;
else if ( outputFn != 0 )
@@ -543,6 +545,17 @@ void processArgs( int argc, const char **argv )
}
break;
+ case 'b':
+ /* object name. */
+ if ( *pc.parameterArg == 0 )
+ error() << "a zero length object name was given" << endl;
+ else {
+ /* Ok, remember the output file name. */
+ objectName = pc.parameterArg;
+ hostAdapters = false;
+ }
+ break;
+
case 'H': case 'h': case '?':
usage();
exit(0);