int
main(int argc, char* argv[])
{
- if (argc != 4) {
- std::cerr << "Usage: " << argv[0] << " export-file gccxml-file default-group" << std::endl;
+ if (argc < 4) {
+ std::cerr << "Usage: " << argv[0] << " export-file default-group gccxml-file1 gccxml-file2 ... " << std::endl;
return 1;
}
try{
std::string exportfile(argv[1]);
- std::string xmlfile(argv[2]);
- std::string group(argv[3]);
+ std::string group(argv[2]);
+ std::list<std::string> xmlfiles;
+ for (unsigned i=3;i<argc;++i)
+ xmlfiles.push_back(argv[i]);
+
std::string prefix=group+"_";
std::list<std::string> includes(get_includes(exportfile));
remove_if(includes.begin(), includes.end(), RemoveGenerated(prefix));
//paste_includes(std::cerr, includes);
- Parser parser(xmlfile, group);
- std::list<t2n_procedure> procedures(parser.get_procedures());
+ std::list<t2n_procedure> procedures;
+ for (std::list<std::string>::iterator it=xmlfiles.begin();it!=xmlfiles.end();++it) {
+ Parser parser(*it, group);
+ const std::list<t2n_procedure> &p(parser.get_procedures());
+ std::copy(p.begin(), p.end(), std::back_inserter(procedures));
+ }
std::cerr << "Procedures:" << std::endl;
for (std::list<t2n_procedure>::const_iterator it=procedures.begin();it!=procedures.end();++it)
CMDGROUPS = default other
+# unfortunately we can't set those from variables
+# because they are parsed by automake
+
libdefault_la_SOURCES = default_client.cpp
libother_la_SOURCES = other_client.cpp
noinst_LTLIBRARIES = libdefault.la libother.la
# todo use tmp file for xml file
for i in $(CMDGROUPS); do \
gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i}.cpp -fxml=$${i}.xml; \
- $(top_builddir)/codegen/codegen $${i}.cpp $${i}.xml $${i}; \
+ $(top_builddir)/codegen/codegen $${i}.cpp $${i} $${i}.xml; \
done; touch $@
# assuming we have gnu make?
at the moment we use the second solution
-- perhaps generate header containing only declarations of server functions
- (hmm this conflicts with the current include file handling)
+- make distcheck
+- .pc file
+- make install (in this example the "other" client lib would have to install foo.hxx)
+- test using valgrind