aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-21 21:43:51 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-21 21:43:51 -0400
commitdcf266228512e100e779fe72f2d4e9ebb605ffe6 (patch)
tree6fb3cac1ee3647f08bca219949ed8dc61b5861f2
parent9acea1807f5945c55445a16259386e4979203a1e (diff)
Move files into src/ and build into build/
-rw-r--r--Makefile26
-rw-r--r--src/ast.c (renamed from ast.c)0
-rw-r--r--src/ast.h (renamed from ast.h)0
-rw-r--r--src/compile.c (renamed from compile.c)0
-rw-r--r--src/compile.h (renamed from compile.h)0
-rw-r--r--src/cordhelpers.c (renamed from cordhelpers.c)0
-rw-r--r--src/cordhelpers.h (renamed from cordhelpers.h)0
-rw-r--r--src/enums.c (renamed from enums.c)0
-rw-r--r--src/enums.h (renamed from enums.h)0
-rw-r--r--src/environment.c (renamed from environment.c)0
-rw-r--r--src/environment.h (renamed from environment.h)0
-rw-r--r--src/parse.c (renamed from parse.c)0
-rw-r--r--src/parse.h (renamed from parse.h)0
-rw-r--r--src/repl.c (renamed from repl.c)0
-rw-r--r--src/repl.h (renamed from repl.h)0
-rw-r--r--src/structs.c (renamed from structs.c)0
-rw-r--r--src/structs.h (renamed from structs.h)0
-rw-r--r--src/tomo.c (renamed from tomo.c)0
-rw-r--r--src/typecheck.c (renamed from typecheck.c)0
-rw-r--r--src/typecheck.h (renamed from typecheck.h)0
-rw-r--r--src/types.c (renamed from types.c)0
-rw-r--r--src/types.h (renamed from types.h)0
22 files changed, 14 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index e1520979..76438980 100644
--- a/Makefile
+++ b/Makefile
@@ -38,30 +38,32 @@ BUILTIN_OBJS=stdlib/siphash.o stdlib/arrays.o stdlib/bools.o stdlib/bytes.o stdl
stdlib/structs.o stdlib/enums.o stdlib/moments.o stdlib/mutexeddata.o
TESTS=$(patsubst %.tm,%.tm.testresult,$(wildcard test/*.tm))
-all: libtomo.so tomo
+all: build/libtomo.so build/tomo
-tomo: tomo.o $(BUILTIN_OBJS) ast.o parse.o environment.o types.o typecheck.o structs.o enums.o compile.o repl.o cordhelpers.o
+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
+ @mkdir -p build
@echo $(CC) $(CFLAGS_PLACEHOLDER) $(LDFLAGS) $^ $(LDLIBS) -o $@
@$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
-libtomo.so: $(BUILTIN_OBJS)
+build/libtomo.so: $(BUILTIN_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 $@
tags:
ctags *.[ch] **/*.[ch]
-%.o: %.c ast.h environment.h types.h
+%.o: %.c src/ast.h src/environment.h src/types.h
@echo $(CC) $(CFLAGS_PLACEHOLDER) -c $< -o $@
@$(CC) $(CFLAGS) -c $< -o $@
%: %.tm
tomo -e $<
-%.tm.testresult: %.tm tomo
+%.tm.testresult: %.tm build/tomo
@printf '\x1b[33;1;4m%s\x1b[m\n' $<
@set -o pipefail; \
- if ! VERBOSE=0 COLOR=1 LC_ALL=C CC=gcc ./tomo -O 1 $< 2>&1 | tee $@; then \
+ if ! VERBOSE=0 COLOR=1 LC_ALL=C CC=gcc ./build/tomo -O 1 $< 2>&1 | tee $@; then \
rm -f $@; \
false; \
fi
@@ -70,23 +72,23 @@ test: $(TESTS)
@echo -e '\x1b[32;7m ALL TESTS PASSED! \x1b[m'
clean:
- rm -rf tomo *.o stdlib/*.o libtomo.so test/*.tm.testresult test/.build examples/.build examples/*/.build
+ rm -rf build/* *.o stdlib/*.o test/*.tm.testresult test/.build examples/.build examples/*/.build
%: %.md
pandoc --lua-filter=.pandoc/bold-code.lua -s $< -t man -o $@
examples: examples/commands/commands examples/base64/base64 examples/ini/ini examples/game/game \
examples/tomodeps/tomodeps examples/tomo-install/tomo-install examples/wrap/wrap examples/colorful/colorful
- ./tomo -IL examples/commands examples/shell examples/base64 examples/log examples/ini examples/vectors examples/game \
+ ./build/tomo -IL examples/commands examples/shell examples/base64 examples/log examples/ini examples/vectors examples/game \
examples/http examples/threads examples/tomodeps examples/tomo-install examples/wrap examples/pthreads examples/colorful
- ./tomo examples/learnxiny.tm
+ ./build/tomo examples/learnxiny.tm
-install: tomo libtomo.so
+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 libtomo.so "$(PREFIX)/lib/"
+ cp -v build/libtomo.so "$(PREFIX)/lib/"
rm -f "$(PREFIX)/bin/tomo"
- cp -v tomo "$(PREFIX)/bin/"
+ cp -v build/tomo "$(PREFIX)/bin/"
cp -v tomo.1 "$(PREFIX)/man/man1/"
uninstall:
diff --git a/ast.c b/src/ast.c
index 982ef7dc..982ef7dc 100644
--- a/ast.c
+++ b/src/ast.c
diff --git a/ast.h b/src/ast.h
index c9db9061..c9db9061 100644
--- a/ast.h
+++ b/src/ast.h
diff --git a/compile.c b/src/compile.c
index 73d5ebfe..73d5ebfe 100644
--- a/compile.c
+++ b/src/compile.c
diff --git a/compile.h b/src/compile.h
index 4256ab5d..4256ab5d 100644
--- a/compile.h
+++ b/src/compile.h
diff --git a/cordhelpers.c b/src/cordhelpers.c
index 57189a8f..57189a8f 100644
--- a/cordhelpers.c
+++ b/src/cordhelpers.c
diff --git a/cordhelpers.h b/src/cordhelpers.h
index 9a72e93c..9a72e93c 100644
--- a/cordhelpers.h
+++ b/src/cordhelpers.h
diff --git a/enums.c b/src/enums.c
index 06af0df3..06af0df3 100644
--- a/enums.c
+++ b/src/enums.c
diff --git a/enums.h b/src/enums.h
index 5f693e5a..5f693e5a 100644
--- a/enums.h
+++ b/src/enums.h
diff --git a/environment.c b/src/environment.c
index 85677524..85677524 100644
--- a/environment.c
+++ b/src/environment.c
diff --git a/environment.h b/src/environment.h
index fbd75c8e..fbd75c8e 100644
--- a/environment.h
+++ b/src/environment.h
diff --git a/parse.c b/src/parse.c
index 325131e5..325131e5 100644
--- a/parse.c
+++ b/src/parse.c
diff --git a/parse.h b/src/parse.h
index 95b2ff95..95b2ff95 100644
--- a/parse.h
+++ b/src/parse.h
diff --git a/repl.c b/src/repl.c
index 39fe30fa..39fe30fa 100644
--- a/repl.c
+++ b/src/repl.c
diff --git a/repl.h b/src/repl.h
index 10ca0cc7..10ca0cc7 100644
--- a/repl.h
+++ b/src/repl.h
diff --git a/structs.c b/src/structs.c
index c5f45c59..c5f45c59 100644
--- a/structs.c
+++ b/src/structs.c
diff --git a/structs.h b/src/structs.h
index 328972cd..328972cd 100644
--- a/structs.h
+++ b/src/structs.h
diff --git a/tomo.c b/src/tomo.c
index e99f42d9..e99f42d9 100644
--- a/tomo.c
+++ b/src/tomo.c
diff --git a/typecheck.c b/src/typecheck.c
index 0d0690bb..0d0690bb 100644
--- a/typecheck.c
+++ b/src/typecheck.c
diff --git a/typecheck.h b/src/typecheck.h
index cc5cb18c..cc5cb18c 100644
--- a/typecheck.h
+++ b/src/typecheck.h
diff --git a/types.c b/src/types.c
index 506850e8..506850e8 100644
--- a/types.c
+++ b/src/types.c
diff --git a/types.h b/src/types.h
index 780c4d5c..780c4d5c 100644
--- a/types.h
+++ b/src/types.h