summaryrefslogtreecommitdiff
path: root/test/Makefile
blob: 06dd47e3f3d0896ecd4f72b1cc412013cbf9bc46 (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
BIN=../bin

ASM = $(shell find ./masm -type f -name "*.asm")
OBJ = $(patsubst ./masm/%.asm,./mld/%.o,$(ASM))
ELF = $(patsubst ./mld/%.o,./msim/%,$(OBJ))
TEST = $(patsubst ./msim/%,%,$(ELF))

.PHONY: build clean

build: $(TEST)

clean:
	rm -fr ./mld
	rm -fr ./msim

$(OBJ): ./mld/%.o : ./masm/%.asm
	@mkdir -p $(@D)
	$(BIN)/masm/masm -o $@ $<

$(ELF): ./msim/% : ./mld/%.o ../lib/runtime.asm
	@mkdir -p $(@D)
	$(BIN)/mld/mld -o $@ $<

$(TEST): % : ./msim/%
	../tools/test.sh $@