ODIN
genmakefile.cpp
1 #include <odinseq/seqmakefile.h>
2 
8 void usage() {
9  STD_cout << "genmakefile: Generates a Makefile for ODIN methods" << STD_endl;
10  STD_cout << configInfo() << STD_endl;
11  STD_cout << STD_endl;
12  STD_cout << "Usage: genmakefile [options] <method-label>" << STD_endl;
13  STD_cout << "Options:" << STD_endl;
14  STD_cout << "\t" << LogBase::get_usage() << STD_endl;
15  STD_cout << "\t" << helpUsage() << STD_endl;
16 }
17 
18 int main(int argc, char* argv[]) {
19  LogBase::set_log_levels(argc,argv);
20  if(hasHelpOption(argc,argv)) {usage(); return 0;}
21 
22  char buff[ODIN_MAXCHAR];
23 
24  if(argc<=1) {usage(); exit(0);}
25 
26  STD_string methlabel;
27  if(getLastArgument(argc,argv,buff,ODIN_MAXCHAR)) {
28  methlabel=buff;
29  }
30 
31  SeqMakefile mf(methlabel,INSTALL_PREFIX);
32  STD_cout << mf.get_Makefile(".") << STD_endl;
33 
34  return 0;
35 }
static bool set_log_levels(int argc, char *argv[], bool trigger_error=true)
static STD_string get_usage()
const char * configInfo()
int hasHelpOption(int argc, char *argv[])
const char * helpUsage()
int getLastArgument(int argc, char *argv[], char *returnvalue, int maxchar, bool modify=true)