diff options
Diffstat (limited to 'test/Makefile')
-rw-r--r-- | test/Makefile | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/test/Makefile b/test/Makefile index fdc3eb3..06dd47e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,19 +1,25 @@ -CC=afl-cc -LD=afl-cc - BIN=../bin -.PHONY: all masm mld msim +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) -all: masm mld msim +clean: + rm -fr ./mld + rm -fr ./msim -masm: - make -C ../masm clean build CC=$(CC) LD=$(LD) - $(BIN)/masm/masm -o ./mld/test.o ./masm/test.asm +$(OBJ): ./mld/%.o : ./masm/%.asm + @mkdir -p $(@D) + $(BIN)/masm/masm -o $@ $< -mld: - make -C ../mld clean build CC=$(CC) LD=$(LD) - $(BIN)/mld/mld -o ./msim/test ./mld/test.o +$(ELF): ./msim/% : ./mld/%.o ../lib/runtime.asm + @mkdir -p $(@D) + $(BIN)/mld/mld -o $@ $< -msim: - make -C ../msim clean build CC=$(CC) LD=$(LD) +$(TEST): % : ./msim/% + ../tools/test.sh $@ |