1 Executable Programs {#estexec}
6 See @subpage estmanuals
for more information
8 # Building your own executable programs {#estexecbuilding}
10 A simple mechanism is provided
for doing all the configuration needed
11 to build a executable program which uses the speech tools library.
13 First, make a directory which will hold your program. To make a program called
"do_stuff", type
17 if you haven
't got the EST bin directory in your path you will have
18 to add the path explicitly, e.g.
20 speech_tools/bin/est_program do_stuff
23 This will create a Makefile and a .cc file called
24 *do_stuff_main.cc*, which will look something like
29 #include "EST_types.h"
30 #include "EST_error.h"
32 int main(int argc, char *argv[])
34 EST_StrList files; // the list of input files will go here
35 EST_Option cmd_line; // the parsed list of command line arguments
38 // This bit parses the command line args and puts them into
42 EST_String("[OPTIONS] [files...]\n")+
43 "Summary; DO SOMETHING\n"+
44 "-o [ofile] Ouptut file\n",
47 EST_String out_file; // the name of the output file
49 // If a output file has been specified using -o, put it in out_file
50 if (cmd_line.present("-o"))
51 out_file = cmd_line.val("-o");
53 EST_error("No output file specified");
55 // declare EST_StrList iterator
56 EST_StrList::Entries fs;
58 // iterate through files and do something.
59 for(fs.begin(files); fs; ++fs)
61 EST_String file = *fs;
70 You can now add any C++ code to this, and compile by typing *make*.
72 If you want to create a second program in the same directory, type the
75 speech_tools/bin/est_program do_more_stuff
77 This time, *do_more_stuff_main.cc* will be created and the
78 appropriate build commands added to the extisting Makefile. If you
79 wish to add an extra .cc file to particular program, simply edit the
80 Makefile and add it on the line:
82 do_stuff_CXXSRC= do_stuff.cc extra.cc