aboutsummaryrefslogtreecommitdiff
# This Makefile is to be included by Makefile of each test

ifndef PROJ_DIR
PROJ_DIR := ../../
endif

def : test

include $(PROJ_DIR)/Makefile.util

IVFLAGS += -DSIMULATION
# The macroassembly header file is somewhat different thing, but I don't know
# what place would be more suitable for it than include/ dir
MACROASM_FLAGS += -I$(PROJ_DIR)/include/ -E

ifdef DEBUG
IVFLAGS += -DDEBUG
DBG&SAVE = tee "$(1)"
else
DBG&SAVE = cat > "$(1)" # putting cat through pipe - what an animal cruelty!
endif

ifdef QUICK_TEST
ifdef VGA_TEST
SKIPPING = 1
endif
endif

ifdef SKIPPING
test :
	@echo Skipping >&2
else
ifdef VGA_TEST
test : VGAdump.ppm VGAdump_expected.ppm
endif
test : report.log
	! grep error $< >&2
ifdef VGA_TEST
	diff VGAdump.ppm VGAdump_expected.ppm
endif
endif

%.mem : %.memv
	$(IV) $(MACROASM_FLAGS) $^ -o $@

%.vvp : %.v $(DEPENDS)
	$(IV) $(IVFLAGS) -s $(TOP) $(filter %.v,$^) -o $@

report.log : $(DEPENDS)
ifdef VGA_TEST
report.log VGAdump.mem : $(PROJ_DIR)/design/font.mem
endif
report.log VGAdump.mem : test.vvp
	$(VVP) $< | $(call DBG&SAVE,report.log)

clean :
	find . -name "*.vvp" -delete
	rm $(call FIND_GENERATED_FILES,.) report.log VGAdump.mem \
		VGAdump.ppm 2>/dev/null || true

.PHONY : test def clean $(TOOLS_TARGETS)

.SECONDARY : $(TOOLS_TARGETS)
test where it belongs....Ludovic Courtès 2019-07-12Merge branch 'master' into core-updates...Marius Bakke 2019-07-08scripts: environment: Add --no-cwd....Carl Dong 2019-06-14tests: Make builds less expensive....Ludovic Courtès 2019-05-07environment: Non ad-hoc mode also honors transformation options....Ludovic Courtès 2019-03-04environment: Rename '--inherit' to '--preserve'....Ludovic Courtès 2019-03-04environment: Remove deprecated -E/--exec option....Ludovic Courtès 2019-02-16environment: Add '--inherit'....Ludovic Courtès 2018-12-17environment: Support package transformation options....Ludovic Courtès 2018-02-21environment: Add --manifest option....David Thompson 2017-06-21environment: Disable profile collision checks....Ludovic Courtès 2017-01-19guix environment, build: Allow absolute file names with '--root'....Ludovic Courtès