From 0b86431038c1e874d7d7030ab41a8f56b0a9991f Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 14 Aug 2018 10:33:40 +0200 Subject: Added some comments on the Makefile --- test/mppa/Makefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/mppa/Makefile b/test/mppa/Makefile index 5b312475..22f22945 100644 --- a/test/mppa/Makefile +++ b/test/mppa/Makefile @@ -4,7 +4,6 @@ ASMDIR=asm TESTNAMES=$(notdir $(subst .c,,$(wildcard $(DIR)/*.c))) CCOMP=../../ccomp -#TESTS=$(addprefix $(DIR)/,$(TESTNAMES)) ELF=$(addprefix $(DIR)/$(BINDIR)/,$(addsuffix .bin,$(TESTNAMES))) TOK=$(addprefix $(DIR)/$(BINDIR)/,$(addsuffix .tok,$(TESTNAMES))) ASM=$(addprefix $(DIR)/$(ASMDIR)/,$(addsuffix .s,$(TESTNAMES))) @@ -15,19 +14,32 @@ all: $(ELF) nobin: $(ASM) +## +# Assembling CompCert's assembly file +## $(DIR)/$(BINDIR)/%.bin: $(DIR)/$(ASMDIR)/%.s @mkdir -p $(@D) ccomp $< -o $@ +## +# Compiling the C file with CompCert +## .SECONDARY: $(DIR)/$(ASMDIR)/%.s: $(DIR)/%.c $(CCOMP) @mkdir -p $(@D) ccomp $(DEBUG) -O0 -v -S $< -o $@ +## +# A token (.tok) is created if the .bin (created by CompCert) yields the same +# result as the .bin.exp (created by executing the binary compiled with gcc) +## $(DIR)/$(BINDIR)/%.tok: $(DIR)/$(BINDIR)/%.bin $(DIR)/output/%.bin.exp @mkdir -p $(@D) @bash check.sh $< $@ +## +# Generate .bin.exp : compile with gcc, execute, store the result in .bin.exp +## $(DIR)/output/%.bin.exp: $(DIR)/%.c @bash generate.sh $< $@ @@ -37,15 +49,23 @@ FORCE: .PHONY: check check: $(TOK) sort mmult +## +# A utility displaying which of the pseudo-instructions are covered in the tests +## .PHONY: coverage coverage: $(ASM) bash coverage.sh $(DIR)/$(ASMDIR) - +## +# Different versions of a sorting algorithm +## .PHONY: sort sort: FORCE (cd sort && make compc-check) +## +# Different versions of a matrix multiply +## .PHONY: mmult mmult: FORCE (cd mmult && make compc-check) -- cgit