-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 845 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
GHDL := ghdl
WORKDIR := work
VERSION := 93
TARGETS := signExtend.vhd alu.vhd alucontrol.vhd controlunit.vhd
TARGETS += $(wildcard testbenches/*.vhd)
DEBUG ?= 1
VISUAL ?= 0
VERBOSE ?= 1
GHDLFLAGS := --std=$(VERSION) --workdir=$(WORKDIR)
ifeq ($(DEBUG), 1)
GHDLFLAGS += -v
endif
# Verbosity
ifeq ($(VERBOSE),0)
AT := @
else
AT :=
endif
COMPONENT_TO_TEST ?= signExtend
# General
analyse: | $(WORKDIR)
$(AT)$(GHDL) -a $(GHDLFLAGS) $(TARGETS)
check_syntax: | $(WORKDIR)
$(AT)$(GHDL) -s $(GHDLFLAGS) $(TARGETS)
clean:
$(AT)rm -rf $(WORKDIR)
$(WORKDIR):
$(AT)mkdir -p $(WORKDIR)
# Tests
test: | $(WORKDIR)
$(AT)$(GHDL) -r $(GHDLFLAGS) $(COMPONENT_TO_TEST)_tb --vcd=$(WORKDIR)/$(COMPONENT_TO_TEST)_test.vcd
ifeq ($(VISUAL), 1)
$(AT)gtkwave $(WORKDIR)/$(COMPONENT_TO_TEST)_test.vcd
endif
.PHONY: all analyse check_syntax clean test