Koala C
XT -- A Bundle of Program Transformation Tools
The tool
koala-c
translates the bindings defined in a Koala composition to C. The program takes as input a Koala composition and produces as output a set of .c/.h files, and a Makefile. This tool corresponds to the combination of
koala
/
koalamaker
tools of the original Philips Koala compiler.
The generated files will be stored in the directory specified with the '-d' command line switch (defaults to current working directory).
koala-c -I <directory with Koala components> \
-i <top-level component> \
-d <output-dir>
The C-source source files can now be compiled into an executable program
a.out
by running
make
in the output directory:
cd <output-dir>
make
./a.out
All non-generated compilation units (i.e., all source files corresponding to Koala modules), should be stored in the same location as the corresponding component definition file. This is how
koala-c
knows where source files can be located and how source files are referenced in generated Makefiles. This is
based on Philips' Koala implementation.
The name of the output program (i.e., the result of running
make
), can be specified with the '-p' switch:
koala-c -I <directory with Koala components> \
-i <top-level component> \
-d <output-dir> \
-p hello-world
The name of the generated Makefile can be specified with the '-m-' switch:
koala-c -I <directory with Koala components> \
-i <top-level component> \
-d <output-dir> \
-p hello-world \
-m Mymake
Compiling and running the resulting program can now be performed as follows:
cd <output-dir>
make -f Mymake
./hello-world
The generated Makefile contains two additional targets. These are:
- clean to remove files generated during the invocation of =make
- allclean to also remove the files generated by
koala-c
The directory
demos/koala-c
in the source distribution of
KoalaCompiler (see
HowToObtainKoalaCompiler) contains examples of
koala-c
--
MerijnDeJonge - 22 Dec 2004