diff options
author | Michi Henning <michi@zeroc.com> | 2004-06-08 04:22:20 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-06-08 04:22:20 +0000 |
commit | d3131d028152bd4380e35df1e30b198d89033d01 (patch) | |
tree | 1aa6a6f13ffcfb59682c2d2ad4a726dc5834eea6 /cpp/src | |
parent | Did a make depend. (diff) | |
download | ice-d3131d028152bd4380e35df1e30b198d89033d01.tar.bz2 ice-d3131d028152bd4380e35df1e30b198d89033d01.tar.xz ice-d3131d028152bd4380e35df1e30b198d89033d01.zip |
Put --depend option back for slice2java after I realized that this broke
the and build. But --depend now at least prints "x.java: x.ice" instead
of "x.cpp: x.ice".
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/slice2java/Main.cpp | 81 |
1 files changed, 50 insertions, 31 deletions
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp index 4c52aa01f3c..227652a4abc 100644 --- a/cpp/src/slice2java/Main.cpp +++ b/cpp/src/slice2java/Main.cpp @@ -29,6 +29,7 @@ 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" ; @@ -47,6 +48,7 @@ main(int argc, char* argv[]) bool debug = false; bool ice = false; bool caseSensitive = false; + bool depend = false; int idx = 1; while(idx < argc) @@ -164,6 +166,15 @@ 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] << "'" @@ -195,50 +206,58 @@ main(int argc, char* argv[]) for(idx = 1 ; idx < argc ; ++idx) { - 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) + if(depend) { - status = EXIT_FAILURE; + Preprocessor icecpp(argv[0], argv[idx], cppArgs); + icecpp.printMakefileDependencies(".java"); } else { - Gen gen(argv[0], icecpp.getBaseName(), includePaths, output); - if(!gen) + Preprocessor icecpp(argv[0], argv[idx], cppArgs); + FILE* cppHandle = icecpp.preprocess(false); + + if(cppHandle == 0) { - p->destroy(); return EXIT_FAILURE; } - gen.generate(p); - if(tie) + + UnitPtr p = Unit::createUnit(false, false, ice, caseSensitive); + int parseStatus = p->parse(cppHandle, debug); + + if(!icecpp.close()) { - gen.generateTie(p); - } - if(impl) + return EXIT_FAILURE; + } + + if(parseStatus == EXIT_FAILURE) { - gen.generateImpl(p); + status = EXIT_FAILURE; } - if(implTie) + else { - gen.generateImplTie(p); + 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); + } } - } - p->destroy(); + p->destroy(); + } } return status; |