mips/test/Makefile
2024-09-30 18:50:22 -04:00

25 lines
477 B
Makefile

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 $@