From 45762bced35335cdb4d51f65cef6d405b88b252a Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 28 Mar 2024 15:08:07 -0400 Subject: Makefile for tests --- tests/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/Makefile (limited to 'tests/Makefile') diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..d1a2c46 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,28 @@ +empty := + +out_dir := out +obj_dir := $(out_dir)/artifacts + +src_files := $(wildcard *.tnsl) +obj_files := $(src_files:.tnsl=.o) +out_files := $(src_files:.tnsl=.out) + +all: outdir $(out_files) +.PHONY: all test + +%.asm: %.tnsl + ../ctc $< $(obj_dir)/$@ + +%.o: %.asm + nasm -f elf64 -o $(obj_dir)/$@ $(obj_dir)/$< + +%.out: %.o + gcc -o $(out_dir)/$@ $(obj_dir)/$< + +outdir: + mkdir -p $(out_dir) + mkdir -p $(obj_dir) + +clean: + rm -rf out/* + -- cgit v1.2.3