aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-15 18:22:07 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-15 18:22:07 -0400
commit5846f9dd9c80cc1db52984323d445874c69fb766 (patch)
treead1f3f9fc08be89af931bd96f44c8f74fc7f8832 /README.md
parent6d68174bdd5bcd1a7e1a6161b578cd39eaf03bef (diff)
Change compilation configuration so Tomo is fully capable of running
locally from the build directory, including with TCC.
Diffstat (limited to 'README.md')
-rw-r--r--README.md54
1 files changed, 40 insertions, 14 deletions
diff --git a/README.md b/README.md
index f8c07433..4b761f48 100644
--- a/README.md
+++ b/README.md
@@ -103,42 +103,68 @@ success.
## Building
The Tomo compiler can be compiled with either GCC or Clang by running `make`.
-The resulting compiler and shared library will be put into `./build/`.
+The first time you build, you will need to specify the Tomo installation
+location (the place where the installer will put the `tomo` binary, the shared
+library, and the header files), the Tomo home directory (where Tomo libraries
+will be installed), and the default C compiler for Tomo to use when compiling
+and running your programs. The answers you give will be saved in `config.mk`,
+which you can edit at any time.
-## Usage
+Once the configuration options have been set, `make` will continue along with
+building `tomo`. The resulting compiler and shared library will be put into
+`./build/`.
-Run Tomo interactively as a REPL (limited functionality):
+You can run `make test` to verify that everything works correctly.
+
+## Running Locally
+
+To run Tomo locally (without installing), you can use the script
+`./local-tomo`, which sets some environment variables and runs the version
+of Tomo that you have built in this directory.
+
+You can run a program like this:
-```bash
-tomo
-# Starts a REPL session
```
+./local-tomo my-program.tm
+```
+
+## Installing
-Run a Tomo file directly:
+To install Tomo, run:
+
+```
+make install
+```
+
+This will install it to the location you gave during initial configuration.
+After this point, you can now run `tomo` to invoke the compiler and run your
+Tomo programs.
+
+## Usage
+
+To run a Tomo file directly:
```bash
tomo foo.tm
-# Runs the program
```
-Compile a Tomo file into an object file:
+To compile a Tomo file into an object file:
```bash
tomo -c foo.tm
# Output: .build/foo.tm.o
```
-Transpile a Tomo file into a C header and source file:
+To transpile a Tomo file into a C header and source file:
+
```bash
tomo -t foo.tm
# Outputs: .build/foo.tm.h .build/foo.tm.c
```
-## Installing
+You can see the full list of compiler options by running `man tomo` or `tomo
+--help`.
-```
-make && sudo make install
-```
## License