Add Wishbone datasheets
[AGH_computer_science_engineering_thesis.git] / Makefile.test
blob84274655f5845cb47a8a4056d16865eaab832783
1 # This Makefile is to be included by Makefile of each test
3 ifndef PROJ_DIR
4 PROJ_DIR := ../../
5 endif
7 def : test
9 include $(PROJ_DIR)/Makefile.util
11 IVFLAGS += -DSIMULATION
12 # The macroassembly header file is somewhat different thing, but I don't know
13 # what place would be more suitable for it than include/ dir
14 MACROASM_FLAGS += -I$(PROJ_DIR)/include/ -E
16 ifdef DEBUG
17 IVFLAGS += -DDEBUG
18 DBG&SAVE = tee "$(1)"
19 else
20 DBG&SAVE = cat > "$(1)" # putting cat through pipe - what an animal cruelty!
21 endif
23 ifdef QUICK_TEST
24 ifdef VGA_TEST
25 SKIPPING = 1
26 endif
27 endif
29 ifdef SKIPPING
30 test :
31         @echo Skipping >&2
32 else
33 ifdef VGA_TEST
34 test : VGAdump.ppm VGAdump_expected.ppm
35 endif
36 test : report.log
37         ! grep error $< >&2
38 ifdef VGA_TEST
39         diff VGAdump.ppm VGAdump_expected.ppm
40 endif
41 endif
43 %.mem : %.memv
44         $(IV) $(MACROASM_FLAGS) $^ -o $@
46 %.vvp : %.v $(DEPENDS)
47         $(IV) $(IVFLAGS) -s $(TOP) $(filter %.v,$^) -o $@
49 report.log : $(DEPENDS)
50 ifdef VGA_TEST
51 report.log VGAdump.mem : $(PROJ_DIR)/design/font.mem
52 endif
53 report.log VGAdump.mem : test.vvp
54         $(VVP) $< | $(call DBG&SAVE,report.log)
56 clean :
57         find . -name "*.vvp" -delete
58         rm $(call FIND_GENERATED_FILES,.) report.log VGAdump.mem \
59                 VGAdump.ppm 2>/dev/null || true
61 .PHONY : test def clean $(TOOLS_TARGETS)
63 .SECONDARY : $(TOOLS_TARGETS)