aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rw-r--r--src/stdlib/README.md (renamed from stdlib/README.md)0
-rw-r--r--src/stdlib/arrays.c (renamed from stdlib/arrays.c)0
-rw-r--r--src/stdlib/arrays.h (renamed from stdlib/arrays.h)0
-rw-r--r--src/stdlib/bools.c (renamed from stdlib/bools.c)0
-rw-r--r--src/stdlib/bools.h (renamed from stdlib/bools.h)0
-rw-r--r--src/stdlib/bytes.c (renamed from stdlib/bytes.c)0
-rw-r--r--src/stdlib/bytes.h (renamed from stdlib/bytes.h)0
-rw-r--r--src/stdlib/c_strings.c (renamed from stdlib/c_strings.c)0
-rw-r--r--src/stdlib/c_strings.h (renamed from stdlib/c_strings.h)0
-rw-r--r--src/stdlib/chacha.h (renamed from stdlib/chacha.h)0
-rw-r--r--src/stdlib/datatypes.h (renamed from stdlib/datatypes.h)0
-rw-r--r--src/stdlib/enums.c (renamed from stdlib/enums.c)0
-rw-r--r--src/stdlib/enums.h (renamed from stdlib/enums.h)0
-rw-r--r--src/stdlib/files.c (renamed from stdlib/files.c)0
-rw-r--r--src/stdlib/files.h (renamed from stdlib/files.h)0
-rw-r--r--src/stdlib/functiontype.c (renamed from stdlib/functiontype.c)0
-rw-r--r--src/stdlib/functiontype.h (renamed from stdlib/functiontype.h)0
-rw-r--r--src/stdlib/integers.c (renamed from stdlib/integers.c)0
-rw-r--r--src/stdlib/integers.h (renamed from stdlib/integers.h)0
-rw-r--r--src/stdlib/memory.c (renamed from stdlib/memory.c)0
-rw-r--r--src/stdlib/memory.h (renamed from stdlib/memory.h)0
-rw-r--r--src/stdlib/metamethods.c (renamed from stdlib/metamethods.c)0
-rw-r--r--src/stdlib/metamethods.h (renamed from stdlib/metamethods.h)0
-rw-r--r--src/stdlib/moments.c (renamed from stdlib/moments.c)0
-rw-r--r--src/stdlib/moments.h (renamed from stdlib/moments.h)0
-rw-r--r--src/stdlib/mutexeddata.c (renamed from stdlib/mutexeddata.c)0
-rw-r--r--src/stdlib/mutexeddata.h (renamed from stdlib/mutexeddata.h)0
-rw-r--r--src/stdlib/nums.c (renamed from stdlib/nums.c)0
-rw-r--r--src/stdlib/nums.h (renamed from stdlib/nums.h)0
-rw-r--r--src/stdlib/optionals.c (renamed from stdlib/optionals.c)0
-rw-r--r--src/stdlib/optionals.h (renamed from stdlib/optionals.h)0
-rw-r--r--src/stdlib/paths.c (renamed from stdlib/paths.c)0
-rw-r--r--src/stdlib/paths.h (renamed from stdlib/paths.h)0
-rw-r--r--src/stdlib/patterns.c (renamed from stdlib/patterns.c)0
-rw-r--r--src/stdlib/patterns.h (renamed from stdlib/patterns.h)0
-rw-r--r--src/stdlib/pointers.c (renamed from stdlib/pointers.c)0
-rw-r--r--src/stdlib/pointers.h (renamed from stdlib/pointers.h)0
-rw-r--r--src/stdlib/rng.c (renamed from stdlib/rng.c)0
-rw-r--r--src/stdlib/rng.h (renamed from stdlib/rng.h)0
-rw-r--r--src/stdlib/siphash-internals.h (renamed from stdlib/siphash-internals.h)0
-rw-r--r--src/stdlib/siphash.c (renamed from stdlib/siphash.c)0
-rw-r--r--src/stdlib/siphash.h (renamed from stdlib/siphash.h)0
-rw-r--r--src/stdlib/stdlib.c (renamed from stdlib/stdlib.c)0
-rw-r--r--src/stdlib/stdlib.h (renamed from stdlib/stdlib.h)0
-rw-r--r--src/stdlib/structs.c (renamed from stdlib/structs.c)0
-rw-r--r--src/stdlib/structs.h (renamed from stdlib/structs.h)0
-rw-r--r--src/stdlib/tables.c (renamed from stdlib/tables.c)0
-rw-r--r--src/stdlib/tables.h (renamed from stdlib/tables.h)0
-rw-r--r--src/stdlib/text.c (renamed from stdlib/text.c)0
-rw-r--r--src/stdlib/text.h (renamed from stdlib/text.h)0
-rw-r--r--src/stdlib/threads.c (renamed from stdlib/threads.c)0
-rw-r--r--src/stdlib/threads.h (renamed from stdlib/threads.h)0
-rw-r--r--src/stdlib/tomo.h (renamed from stdlib/tomo.h)0
-rw-r--r--src/stdlib/types.c (renamed from stdlib/types.c)0
-rw-r--r--src/stdlib/types.h (renamed from stdlib/types.h)0
-rw-r--r--src/stdlib/util.c (renamed from stdlib/util.c)0
-rw-r--r--src/stdlib/util.h (renamed from stdlib/util.h)0
58 files changed, 6 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 76438980..a2dd5111 100644
--- a/Makefile
+++ b/Makefile
@@ -31,21 +31,18 @@ O=-Og
CFLAGS=$(CCONFIG) $(EXTRA) $(CWARN) $(G) $(O) $(OSFLAGS) $(LTO)
CFLAGS_PLACEHOLDER="$$(echo -e '\033[2m<flags...>\033[m')"
LDLIBS=-lgc -lcord -lm -lunistring -lgmp -ldl
-BUILTIN_OBJS=stdlib/siphash.o stdlib/arrays.o stdlib/bools.o stdlib/bytes.o stdlib/nums.o stdlib/integers.o \
- stdlib/pointers.o stdlib/memory.o stdlib/text.o stdlib/threads.o stdlib/c_strings.o stdlib/tables.o \
- stdlib/types.o stdlib/util.o stdlib/files.o stdlib/paths.o stdlib/rng.o \
- stdlib/optionals.o stdlib/patterns.o stdlib/metamethods.o stdlib/functiontype.o stdlib/stdlib.o \
- stdlib/structs.o stdlib/enums.o stdlib/moments.o stdlib/mutexeddata.o
+COMPILER_OBJS=$(patsubst %.c,%.o,$(wildcard src/*.c))
+STDLIB_OBJS=$(patsubst %.c,%.o,$(wildcard src/stdlib/*.c))
TESTS=$(patsubst %.tm,%.tm.testresult,$(wildcard test/*.tm))
all: build/libtomo.so build/tomo
-build/tomo: src/tomo.o $(BUILTIN_OBJS) src/ast.o src/parse.o src/environment.o src/types.o src/typecheck.o src/structs.o src/enums.o src/compile.o src/repl.o src/cordhelpers.o
+build/tomo: $(STDLIB_OBJS) $(COMPILER_OBJS)
@mkdir -p build
@echo $(CC) $(CFLAGS_PLACEHOLDER) $(LDFLAGS) $^ $(LDLIBS) -o $@
@$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
-build/libtomo.so: $(BUILTIN_OBJS)
+build/libtomo.so: $(STDLIB_OBJS)
@mkdir -p build
@echo $(CC) $^ $(CFLAGS_PLACEHOLDER) $(OSFLAGS) -lgc -lcord -lm -lunistring -lgmp -ldl -Wl,-soname,libtomo.so -shared -o $@
@$(CC) $^ $(CFLAGS) $(OSFLAGS) -lgc -lcord -lm -lunistring -lgmp -ldl -Wl,-soname,libtomo.so -shared -o $@
@@ -72,7 +69,7 @@ test: $(TESTS)
@echo -e '\x1b[32;7m ALL TESTS PASSED! \x1b[m'
clean:
- rm -rf build/* *.o stdlib/*.o test/*.tm.testresult test/.build examples/.build examples/*/.build
+ rm -rf build/* $(COMPILER_OBJS) $(STDLIB_OBJS) test/*.tm.testresult test/.build examples/.build examples/*/.build
%: %.md
pandoc --lua-filter=.pandoc/bold-code.lua -s $< -t man -o $@
@@ -85,7 +82,7 @@ examples: examples/commands/commands examples/base64/base64 examples/ini/ini exa
install: build/tomo build/libtomo.so
mkdir -p -m 755 "$(PREFIX)/man/man1" "$(PREFIX)/bin" "$(PREFIX)/include/tomo" "$(PREFIX)/lib" "$(PREFIX)/share/tomo/modules"
- cp -v stdlib/*.h "$(PREFIX)/include/tomo/"
+ cp -v src/stdlib/*.h "$(PREFIX)/include/tomo/"
cp -v build/libtomo.so "$(PREFIX)/lib/"
rm -f "$(PREFIX)/bin/tomo"
cp -v build/tomo "$(PREFIX)/bin/"
diff --git a/stdlib/README.md b/src/stdlib/README.md
index ba47dd0a..ba47dd0a 100644
--- a/stdlib/README.md
+++ b/src/stdlib/README.md
diff --git a/stdlib/arrays.c b/src/stdlib/arrays.c
index cd403c5f..cd403c5f 100644
--- a/stdlib/arrays.c
+++ b/src/stdlib/arrays.c
diff --git a/stdlib/arrays.h b/src/stdlib/arrays.h
index dc7efee6..dc7efee6 100644
--- a/stdlib/arrays.h
+++ b/src/stdlib/arrays.h
diff --git a/stdlib/bools.c b/src/stdlib/bools.c
index bf820664..bf820664 100644
--- a/stdlib/bools.c
+++ b/src/stdlib/bools.c
diff --git a/stdlib/bools.h b/src/stdlib/bools.h
index 6d0300d5..6d0300d5 100644
--- a/stdlib/bools.h
+++ b/src/stdlib/bools.h
diff --git a/stdlib/bytes.c b/src/stdlib/bytes.c
index b24a721b..b24a721b 100644
--- a/stdlib/bytes.c
+++ b/src/stdlib/bytes.c
diff --git a/stdlib/bytes.h b/src/stdlib/bytes.h
index ac1b61a3..ac1b61a3 100644
--- a/stdlib/bytes.h
+++ b/src/stdlib/bytes.h
diff --git a/stdlib/c_strings.c b/src/stdlib/c_strings.c
index 7987a234..7987a234 100644
--- a/stdlib/c_strings.c
+++ b/src/stdlib/c_strings.c
diff --git a/stdlib/c_strings.h b/src/stdlib/c_strings.h
index 24cf99da..24cf99da 100644
--- a/stdlib/c_strings.h
+++ b/src/stdlib/c_strings.h
diff --git a/stdlib/chacha.h b/src/stdlib/chacha.h
index 69d79ea3..69d79ea3 100644
--- a/stdlib/chacha.h
+++ b/src/stdlib/chacha.h
diff --git a/stdlib/datatypes.h b/src/stdlib/datatypes.h
index b81ff741..b81ff741 100644
--- a/stdlib/datatypes.h
+++ b/src/stdlib/datatypes.h
diff --git a/stdlib/enums.c b/src/stdlib/enums.c
index b66a1711..b66a1711 100644
--- a/stdlib/enums.c
+++ b/src/stdlib/enums.c
diff --git a/stdlib/enums.h b/src/stdlib/enums.h
index b5427711..b5427711 100644
--- a/stdlib/enums.h
+++ b/src/stdlib/enums.h
diff --git a/stdlib/files.c b/src/stdlib/files.c
index cf777689..cf777689 100644
--- a/stdlib/files.c
+++ b/src/stdlib/files.c
diff --git a/stdlib/files.h b/src/stdlib/files.h
index 68827c2a..68827c2a 100644
--- a/stdlib/files.h
+++ b/src/stdlib/files.h
diff --git a/stdlib/functiontype.c b/src/stdlib/functiontype.c
index b02739a2..b02739a2 100644
--- a/stdlib/functiontype.c
+++ b/src/stdlib/functiontype.c
diff --git a/stdlib/functiontype.h b/src/stdlib/functiontype.h
index d308be96..d308be96 100644
--- a/stdlib/functiontype.h
+++ b/src/stdlib/functiontype.h
diff --git a/stdlib/integers.c b/src/stdlib/integers.c
index 4d5d0a80..4d5d0a80 100644
--- a/stdlib/integers.c
+++ b/src/stdlib/integers.c
diff --git a/stdlib/integers.h b/src/stdlib/integers.h
index e0586882..e0586882 100644
--- a/stdlib/integers.h
+++ b/src/stdlib/integers.h
diff --git a/stdlib/memory.c b/src/stdlib/memory.c
index 1805fb6f..1805fb6f 100644
--- a/stdlib/memory.c
+++ b/src/stdlib/memory.c
diff --git a/stdlib/memory.h b/src/stdlib/memory.h
index e03d5931..e03d5931 100644
--- a/stdlib/memory.h
+++ b/src/stdlib/memory.h
diff --git a/stdlib/metamethods.c b/src/stdlib/metamethods.c
index c0e11cfc..c0e11cfc 100644
--- a/stdlib/metamethods.c
+++ b/src/stdlib/metamethods.c
diff --git a/stdlib/metamethods.h b/src/stdlib/metamethods.h
index a75fcf7f..a75fcf7f 100644
--- a/stdlib/metamethods.h
+++ b/src/stdlib/metamethods.h
diff --git a/stdlib/moments.c b/src/stdlib/moments.c
index bb3d70a9..bb3d70a9 100644
--- a/stdlib/moments.c
+++ b/src/stdlib/moments.c
diff --git a/stdlib/moments.h b/src/stdlib/moments.h
index ff6d4119..ff6d4119 100644
--- a/stdlib/moments.h
+++ b/src/stdlib/moments.h
diff --git a/stdlib/mutexeddata.c b/src/stdlib/mutexeddata.c
index f47adfc1..f47adfc1 100644
--- a/stdlib/mutexeddata.c
+++ b/src/stdlib/mutexeddata.c
diff --git a/stdlib/mutexeddata.h b/src/stdlib/mutexeddata.h
index 47686195..47686195 100644
--- a/stdlib/mutexeddata.h
+++ b/src/stdlib/mutexeddata.h
diff --git a/stdlib/nums.c b/src/stdlib/nums.c
index 98f7b509..98f7b509 100644
--- a/stdlib/nums.c
+++ b/src/stdlib/nums.c
diff --git a/stdlib/nums.h b/src/stdlib/nums.h
index af0e895b..af0e895b 100644
--- a/stdlib/nums.h
+++ b/src/stdlib/nums.h
diff --git a/stdlib/optionals.c b/src/stdlib/optionals.c
index d91ebffc..d91ebffc 100644
--- a/stdlib/optionals.c
+++ b/src/stdlib/optionals.c
diff --git a/stdlib/optionals.h b/src/stdlib/optionals.h
index ccf1b963..ccf1b963 100644
--- a/stdlib/optionals.h
+++ b/src/stdlib/optionals.h
diff --git a/stdlib/paths.c b/src/stdlib/paths.c
index c7743759..c7743759 100644
--- a/stdlib/paths.c
+++ b/src/stdlib/paths.c
diff --git a/stdlib/paths.h b/src/stdlib/paths.h
index 6c6cebd3..6c6cebd3 100644
--- a/stdlib/paths.h
+++ b/src/stdlib/paths.h
diff --git a/stdlib/patterns.c b/src/stdlib/patterns.c
index 7f7d711b..7f7d711b 100644
--- a/stdlib/patterns.c
+++ b/src/stdlib/patterns.c
diff --git a/stdlib/patterns.h b/src/stdlib/patterns.h
index 53db0978..53db0978 100644
--- a/stdlib/patterns.h
+++ b/src/stdlib/patterns.h
diff --git a/stdlib/pointers.c b/src/stdlib/pointers.c
index 76e882ec..76e882ec 100644
--- a/stdlib/pointers.c
+++ b/src/stdlib/pointers.c
diff --git a/stdlib/pointers.h b/src/stdlib/pointers.h
index 165a5184..165a5184 100644
--- a/stdlib/pointers.h
+++ b/src/stdlib/pointers.h
diff --git a/stdlib/rng.c b/src/stdlib/rng.c
index 07b2f36c..07b2f36c 100644
--- a/stdlib/rng.c
+++ b/src/stdlib/rng.c
diff --git a/stdlib/rng.h b/src/stdlib/rng.h
index 5bc4794f..5bc4794f 100644
--- a/stdlib/rng.h
+++ b/src/stdlib/rng.h
diff --git a/stdlib/siphash-internals.h b/src/stdlib/siphash-internals.h
index b359cea7..b359cea7 100644
--- a/stdlib/siphash-internals.h
+++ b/src/stdlib/siphash-internals.h
diff --git a/stdlib/siphash.c b/src/stdlib/siphash.c
index 44e8b6eb..44e8b6eb 100644
--- a/stdlib/siphash.c
+++ b/src/stdlib/siphash.c
diff --git a/stdlib/siphash.h b/src/stdlib/siphash.h
index 67bad582..67bad582 100644
--- a/stdlib/siphash.h
+++ b/src/stdlib/siphash.h
diff --git a/stdlib/stdlib.c b/src/stdlib/stdlib.c
index 819414fa..819414fa 100644
--- a/stdlib/stdlib.c
+++ b/src/stdlib/stdlib.c
diff --git a/stdlib/stdlib.h b/src/stdlib/stdlib.h
index 1b633dff..1b633dff 100644
--- a/stdlib/stdlib.h
+++ b/src/stdlib/stdlib.h
diff --git a/stdlib/structs.c b/src/stdlib/structs.c
index ca88262c..ca88262c 100644
--- a/stdlib/structs.c
+++ b/src/stdlib/structs.c
diff --git a/stdlib/structs.h b/src/stdlib/structs.h
index bab702cd..bab702cd 100644
--- a/stdlib/structs.h
+++ b/src/stdlib/structs.h
diff --git a/stdlib/tables.c b/src/stdlib/tables.c
index 97419327..97419327 100644
--- a/stdlib/tables.c
+++ b/src/stdlib/tables.c
diff --git a/stdlib/tables.h b/src/stdlib/tables.h
index 979da5e7..979da5e7 100644
--- a/stdlib/tables.h
+++ b/src/stdlib/tables.h
diff --git a/stdlib/text.c b/src/stdlib/text.c
index bfaa0581..bfaa0581 100644
--- a/stdlib/text.c
+++ b/src/stdlib/text.c
diff --git a/stdlib/text.h b/src/stdlib/text.h
index 0a44f4e4..0a44f4e4 100644
--- a/stdlib/text.h
+++ b/src/stdlib/text.h
diff --git a/stdlib/threads.c b/src/stdlib/threads.c
index 9ad68c81..9ad68c81 100644
--- a/stdlib/threads.c
+++ b/src/stdlib/threads.c
diff --git a/stdlib/threads.h b/src/stdlib/threads.h
index 9f1c3d33..9f1c3d33 100644
--- a/stdlib/threads.h
+++ b/src/stdlib/threads.h
diff --git a/stdlib/tomo.h b/src/stdlib/tomo.h
index 61dba404..61dba404 100644
--- a/stdlib/tomo.h
+++ b/src/stdlib/tomo.h
diff --git a/stdlib/types.c b/src/stdlib/types.c
index 8ced9051..8ced9051 100644
--- a/stdlib/types.c
+++ b/src/stdlib/types.c
diff --git a/stdlib/types.h b/src/stdlib/types.h
index c7b938a0..c7b938a0 100644
--- a/stdlib/types.h
+++ b/src/stdlib/types.h
diff --git a/stdlib/util.c b/src/stdlib/util.c
index 1fe33dfa..1fe33dfa 100644
--- a/stdlib/util.c
+++ b/src/stdlib/util.c
diff --git a/stdlib/util.h b/src/stdlib/util.h
index 6f79bed6..6f79bed6 100644
--- a/stdlib/util.h
+++ b/src/stdlib/util.h