Tycho includes facilities to compile C and Java files and load them back
into Tycho.
Other Tycho Pages
Compile Class structure
The following classes are used to implement the Compiler interface:
-
Compile
- The base class that the other Compiler classes inherit from.
-
CompileC
- This class compiles and loads a C file into the itkwish that is
running Tycho.
-
CompileJava
- This class compiles and loads a Java file into the java interpreter
that is running Tycho.
Note that the binary that is actually running Tycho could be either
itkwish
or the java interpreter.
The CompileJava
class probably
won't work if the binary that is running Tycho is itkwish
.
The CompileJava
class will probably only work if Tycho
was started up with tycho -java
.
Steps to Compile and Load a file
- Check the file for necessary features.
Exactly what happens depends on what language is being compiled.
For example, when a C file is loaded into Tcl, an initialization
procedure with a specific name is called.
- Determine the name of the makefile.
The current directory is searched for the following files:
-
makefile
-
Makefile
- A file with the same base as the file being evaluated and
a
.mk
extension. For example, if the file being
evaluated is named myTclCommands.c
, then we look for
myTclCommands.mk
If none of the above makefiles are found, then we create a makefile
with the same basename. The way the makefile is created depends
on whether we are compiling C or Java
- Compile the file.
Usually, make
is called via the
Exec
class.
- Load the results of the compilation back into Tycho.
Exactly what happens depends on the language being compiled.
Interactivity
If the user is compiling and loading many files, then they probably
don't want to hit 'Ok' for every file to be loaded. However, if a
file fails to compile, the user may want to retry the compilation
after modifying something else.
Tycho Home Page
Copyright © 1996-1998, The Regents of the University of California.
All rights reserved.
Last updated: 05/12/98,
comments to: cxh@eecs.berkeley.edu