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