diff options
| -rw-r--r-- | Makefile | 26 | ||||
| -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
@@ -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/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/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/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/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 |
