diff options
author | Michi Henning <michi@zeroc.com> | 2004-06-07 05:35:03 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-06-07 05:35:03 +0000 |
commit | dd5f0732236493306c97a701dec357353b450dbc (patch) | |
tree | fa874eefeaf5c997a76b1f6439624b055c3d0aea /cpp/src/slice2java | |
parent | Fix (diff) | |
download | ice-dd5f0732236493306c97a701dec357353b450dbc.tar.bz2 ice-dd5f0732236493306c97a701dec357353b450dbc.tar.xz ice-dd5f0732236493306c97a701dec357353b450dbc.zip |
Removed --depend option from slice2java (because it was meaningless) and
changed preprocessor to be able to generate dependecies for C#
makefiles.
Diffstat (limited to 'cpp/src/slice2java')
-rw-r--r-- | cpp/src/slice2java/Main.cpp | 81 |
1 files changed, 31 insertions, 50 deletions
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp index 1e5d888b23e..4c52aa01f3c 100644 --- a/cpp/src/slice2java/Main.cpp +++ b/cpp/src/slice2java/Main.cpp @@ -29,7 +29,6 @@ usage(const char* n) "--tie Generate TIE classes.\n" "--impl Generate sample implementations.\n" "--impl-tie Generate sample TIE implementations.\n" - "--depend Generate Makefile dependencies.\n" "-d, --debug Print debug messages.\n" "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; @@ -48,7 +47,6 @@ main(int argc, char* argv[]) bool debug = false; bool ice = false; bool caseSensitive = false; - bool depend = false; int idx = 1; while(idx < argc) @@ -166,15 +164,6 @@ main(int argc, char* argv[]) } --argc; } - else if(strcmp(argv[idx], "--depend") == 0) - { - depend = true; - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } else if(argv[idx][0] == '-') { cerr << argv[0] << ": unknown option `" << argv[idx] << "'" @@ -206,58 +195,50 @@ main(int argc, char* argv[]) for(idx = 1 ; idx < argc ; ++idx) { - if(depend) + Preprocessor icecpp(argv[0], argv[idx], cppArgs); + FILE* cppHandle = icecpp.preprocess(false); + + if(cppHandle == 0) + { + return EXIT_FAILURE; + } + + UnitPtr p = Unit::createUnit(false, false, ice, caseSensitive); + int parseStatus = p->parse(cppHandle, debug); + + if(!icecpp.close()) + { + return EXIT_FAILURE; + } + + if(parseStatus == EXIT_FAILURE) { - Preprocessor icecpp(argv[0], argv[idx], cppArgs); - icecpp.printMakefileDependencies(); + status = EXIT_FAILURE; } else { - Preprocessor icecpp(argv[0], argv[idx], cppArgs); - FILE* cppHandle = icecpp.preprocess(false); - - if(cppHandle == 0) + Gen gen(argv[0], icecpp.getBaseName(), includePaths, output); + if(!gen) { + p->destroy(); return EXIT_FAILURE; } - - UnitPtr p = Unit::createUnit(false, false, ice, caseSensitive); - int parseStatus = p->parse(cppHandle, debug); - - if(!icecpp.close()) + gen.generate(p); + if(tie) { - return EXIT_FAILURE; - } - - if(parseStatus == EXIT_FAILURE) + gen.generateTie(p); + } + if(impl) { - status = EXIT_FAILURE; + gen.generateImpl(p); } - else + if(implTie) { - Gen gen(argv[0], icecpp.getBaseName(), includePaths, output); - if(!gen) - { - p->destroy(); - return EXIT_FAILURE; - } - gen.generate(p); - if(tie) - { - gen.generateTie(p); - } - if(impl) - { - gen.generateImpl(p); - } - if(implTie) - { - gen.generateImplTie(p); - } + gen.generateImplTie(p); } - - p->destroy(); } + + p->destroy(); } return status; |