summaryrefslogtreecommitdiff
path: root/tests/Makefile
blob: 0b25a6854b38db4fa7de40b23f92e18c5db3596a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)

.PHONY: all outdir clean
all: outdir $(out_files)

%.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/*