|
@@ -11,12 +11,28 @@ There are three binaries in the toolchain:
|
|
|
- The virtual machine "civvm", which runs one or more object files, one of
|
|
- The virtual machine "civvm", which runs one or more object files, one of
|
|
|
which should export a "main" function.
|
|
which should export a "main" function.
|
|
|
|
|
|
|
|
-Additionally, there is a run script "run.sh" which takes one file name argument
|
|
|
|
|
|
|
+Additionally, there is a run script "civrun" which takes one file name argument
|
|
|
and runs it through the entire pipeline, deleting intermediate files
|
|
and runs it through the entire pipeline, deleting intermediate files
|
|
|
afterwards. E.g. for the first assignment you may want to run:
|
|
afterwards. E.g. for the first assignment you may want to run:
|
|
|
-$ bin/run.sh euclid.cvc
|
|
|
|
|
-<output of your main function>
|
|
|
|
|
|
|
+$ bin/civrun euclid.cvc
|
|
|
|
|
+Please enter an integer value: 60
|
|
|
|
|
+Please enter an integer value: 45
|
|
|
|
|
+15
|
|
|
|
|
|
|
|
|
|
+Or even:
|
|
|
|
|
+$ echo 60 45 | bin/civrun euclid.cvc 2>&1
|
|
|
|
|
+15
|
|
|
|
|
+
|
|
|
|
|
+The toolchain also contains the file "civic.h" which defines the CiviC standard
|
|
|
|
|
+library supported by the VM. It is practical to keep this in the same directory
|
|
|
|
|
+as the reference compiler binary, because the compiler adds the folder in which
|
|
|
|
|
+it resides in to the include directories of the C preprocessor (along with the
|
|
|
|
|
+current working directory).
|
|
|
|
|
+
|
|
|
|
|
+You may want to add the toolchain directory to your $PATH so you can run the
|
|
|
|
|
+tools without having to prefix "<...>/bin/" every time when using the
|
|
|
|
|
+toolchain. E.g. add to your ~/.bashrc:
|
|
|
|
|
+export PATH=$PATH:<directory_where_you_unpacked_the_toolchain>/bin
|
|
|
|
|
|
|
|
Reference compiler usage
|
|
Reference compiler usage
|
|
|
========================
|
|
========================
|