blob: 4365af70756875d2193a3756f5f0ca3619b3af6e (
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
29
30
31
32
33
|
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 run outdir clean
all: outdir $(out_files)
run: all
./run.sh
%.asm: %.tnsl
@../ctc $< $(obj_dir)/$@
%.o: %.asm
@nasm -f elf64 -o $(obj_dir)/$@ $(obj_dir)/$<
%.out: %.o
@gcc -o $(out_dir)/$@ $(obj_dir)/$<
@echo "Built $(out_dir)/$@"
outdir:
@mkdir -p $(out_dir)
@mkdir -p $(obj_dir)
@echo "Created output directories"
clean:
rm -rf out/*
|