2 Building Your Program
To compile a new program (say, myprog.cecil) run a make command which specifies the name of your program: Cecil> make myprog.cecil. The make command parses the file named myprog.cecil and any files transitively included by this file, constructs global data structures describing the program (e.g., the object inheritance graph and the table of defined methods), produces Phase-1"compiled" (C++ or assembly) code for the application in the gen directory (which is created if necessary), and then invokes a Phase-2 make*1 to compile the intermediate files into .o files and link the .o files into a target executable, gen/myprog. The generated executable can be run either from a UNIX prompt or by typing run at the Vortex prompt.
Once a program has been compiled, further invocations of the make command (the program name is optional after the first time) incrementally recompile only files that changed (or depend on a changed file).
The save command writes the program checkpoint to a file named program.db. The checkpoint contains a snapshot of the application's source code, the interprocedural information computed by the compiler, and recompilation dependencies, as well as the current settings of the Vortex compiler's options. At this point, it is safe to quit Vortex by typing the quit command. (really_quit skips asking for confirmation.)
To reload a program's checkpoint file, use the load program.db command. The compiler's state is restored to where it was at the point of the previous save, permitting more incremental development to proceed. If you do not load a checkpoint file, the first make command will perform a full non-incremental compilation.
For example, Vortex can compile a program in batch mode when invoked as follows:
2.2.2 Start-up Commands
Upon startup, Vortex searches for a file named .vortexrc first in the current directory, then in the user's home directory. Each line is executed as if it were typed at the Vortex prompt. If the line contains the # symbol, the part of the line between the first # and the end of the line is ignored. For example, if you want Vortex to load the program's checkpoint upon startup, you can create a .vortexrc containing the following lines:
# put this .vortexrc in the directory where you start the compiler
load myprog.db
After .vortexrc is processed (if found), any command-line arguments are processed in order. Each command-line argument is executed as if it were typed at the Cecil> prompt.
% vortex "load myprog.db" make save really_quit
2.2.3 Compiler commands
This section describes the major Vortex compiler commands. The following notation is used:
More commands are described in Sections 2.3, 2.4, and 2.5. You can get a complete list of commands and their brief descriptions by entering the help command. Multiple commands separated by semicolons can be given on the same line.