aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-01-18 10:01:27 +0100
committerdec05eba <dec05eba@protonmail.com>2020-01-18 10:05:55 +0100
commit50c928d224bff0af322f23a7d2b842cd54aa2e68 (patch)
tree4e02b167c89c2ff109f6dfd1d2734309ea0192db /Makefile
parent1dbef1bfdefe8d7967a360f00d350db307d344e2 (diff)
Start on bytecode, move object files to build directory
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 19 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 9ab88c1..e19c75e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,29 @@
CFLAGS = -Wall -Wextra -g3 -ansi -pedantic
-OBJ = main.o tokenizer.o parser.o
+OBJ = build/main.o build/tokenizer.o build/parser.o build/bytecode.o build/buffer.o
-all: $(OBJ)
- cc -o tsl $(OBJ) -fPIE
+all: build_dir $(OBJ)
+ cc -o build/tsl $(OBJ) -fPIE
clean:
- rm $(OBJ) tsl
+ rm $(OBJ) build/tsl
+
+build_dir:
+ mkdir -p build
compiledb:
make clean; bear make
-main.o: src/main.c include/tokenizer.h
- cc -c src/main.c $(CFLAGS)
+build/main.o: src/main.c include/tokenizer.h
+ cc -c src/main.c -o build/main.o $(CFLAGS)
+
+build/tokenizer.o: src/tokenizer.c include/tokenizer.h
+ cc -c src/tokenizer.c -o build/tokenizer.o $(CFLAGS)
+
+build/parser.o: src/parser.c include/parser.h
+ cc -c src/parser.c -o build/parser.o $(CFLAGS)
-tokenizer.o: src/tokenizer.c include/tokenizer.h
- cc -c src/tokenizer.c $(CFLAGS)
+build/bytecode.o: src/bytecode.c include/bytecode.h
+ cc -c src/bytecode.c -o build/bytecode.o $(CFLAGS)
-parser.o: src/parser.c include/parser.h
- cc -c src/parser.c $(CFLAGS)
+build/buffer.o: src/std/buffer.c include/std/buffer.h
+ cc -c src/std/buffer.c -o build/buffer.o $(CFLAGS)