aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-09 23:44:52 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-09 23:44:52 -0500
commitb639f01294f8c528ad0597a179f7e426bccdfb80 (patch)
treeee312fb40488ff5bcaf43ded30b4eae21655630a
parentb83221f422721410d365a9e35b88810d6daae744 (diff)
Removing some dead code
-rw-r--r--Makefile12
-rw-r--r--README.md25
-rw-r--r--builtins/types.h1
-rw-r--r--tomo.h14
4 files changed, 34 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 4d3d3617..671e17b3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
PREFIX=/usr/local
-VERSION=0.12.1
+VERSION=0.0.1
CCONFIG=-std=c11 -Werror -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -fPIC -I. \
-fsanitize=signed-integer-overflow -fno-sanitize-recover -fvisibility=hidden -fdollars-in-identifiers
LTO=-flto=auto -fno-fat-lto-objects -Wl,-flto
@@ -49,4 +49,14 @@ clean:
%.1: %.1.md
pandoc --lua-filter=.pandoc/bold-code.lua -s $< -t man -o $@
+install: tomo libtomo.so
+ mkdir -p -m 755 "$(PREFIX)/man/man1" "$(PREFIX)/bin" "$(PREFIX)/lib" "$(PREFIX)/share/tomo/modules"
+ cp -v tomo.h "$(PREFIX)/include/"
+ cp -v libtomo.so "$(PREFIX)/lib/"
+ rm -f "$(PREFIX)/bin/tomo"
+ cp -v tomo "$(PREFIX)/bin/"
+
+uninstall:
+ rm -rvf "$(PREFIX)/bin/tomo" "$(PREFIX)/lib/libtomo.so" "$(PREFIX)/share/tomo"; \
+
.PHONY: all clean install uninstall test tags
diff --git a/README.md b/README.md
index 950dff41..0a6d729b 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,25 @@ Check out the [test/](test/) folder to see some examples.
## Dependencies
-Tomo uses the [Boehm garbage collector](https://www.hboehm.info/gc/) for
-runtime garbage collection (which is available from your package manager of
-choice, for example: `pacman -S gc`).
+Tomo has a very small set of dependencies:
+
+- The [Boehm garbage collector](https://www.hboehm.info/gc/) for runtime
+ garbage collection.
+- [libunistring](https://www.gnu.org/software/libunistring/) for unicode
+ string support.
+- a C compiler
+- and libc/libm, which should definitely already be installed.
+
+Both of which should be available on your package manager of choice (for
+example, `pacman -S gc libunistring`).
+
+## Building
+
+The Tomo compiler can be compiled with either GCC or Clang by running `make`.
+
+## Running
+
+You can run a Tomo program by running `./tomo program.tm`. By default, this
+will use your environment's `$CC` variable to select which C compiler to use.
+If no C compiler is specified, it will default to `tcc` (Tiny C Compiler),
+which is exceptionally fast.
diff --git a/builtins/types.h b/builtins/types.h
index d26c86be..f62e37e0 100644
--- a/builtins/types.h
+++ b/builtins/types.h
@@ -63,6 +63,7 @@ typedef struct TypeInfo {
extern const TypeInfo TypeInfo_info;
extern const TypeInfo Void;
extern const TypeInfo Abort;
+#define Void_t void
CORD Type__as_text(const void *typeinfo, bool colorize, const TypeInfo *type);
CORD Func__as_text(const void *fn, bool colorize, const TypeInfo *type);
diff --git a/tomo.h b/tomo.h
index 9337d744..7f4a6254 100644
--- a/tomo.h
+++ b/tomo.h
@@ -26,20 +26,6 @@
#include "builtins/text.h"
#include "builtins/types.h"
-#define Void_t void
-
-CORD as_cord(void *x, bool use_color, const char *fmt, ...);
-
-#define StrF(...) ({ CORD $c; CORD_sprintf(&$c, __VA_ARGS__); $c; })
-#define $var(var, val) __typeof(val) var = val
-#define $cord(x) _Generic(x, bool: x ? "yes" : "no", \
- int8_t: StrF("%d", x), \
- int16_t: StrF("%d", x), \
- int32_t: StrF("%d", x), int64_t: StrF("%ld", x), \
- double: StrF("%g", x), float: StrF("%g", x), \
- CORD: x, \
- array_t: as_cord($stack(x), false, "[ ]"), \
- default: "???")
#define $heap(x) (__typeof(x)*)memcpy(GC_MALLOC(sizeof(x)), (__typeof(x)[1]){x}, sizeof(x))
#define $stack(x) (__typeof(x)*)((__typeof(x)[1]){x})
#define $tagged(obj_expr, type_name, tag_name) ({ __typeof(obj_expr) $obj = obj_expr; \