forked from slaclab/surf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (68 loc) · 3.24 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Makefile automatically generated by ghdl
# Version: GHDL 0.34-dev (2017-03-01) [Dunoon edition] - mcode code generator
# Command used to generate this makefile:
# ghdl --gen-makefile -v -P/afs/slac/g/reseng/vol20/ghdl/lib/ghdl/vendors/xilinx-vivado/ --workdir=work --ieee=synopsys -fexplicit -frelaxed-rules AxiLiteCrossbar
GHDL=ghdl
GHDL_WORKDIR=ghdl
GHDLFLAGS= --workdir=${GHDL_WORKDIR} --work=work --ieee=synopsys -fexplicit -frelaxed-rules --warn-no-library
GHDLRUNFLAGS=
PATHS = $(shell find -type f -name '*.vhd')
# Exclude all the VHDL2008 files: /usr/bin/ghdl-mcode:warning: library synopsys does not exists for v08
# Exclude all exempt modules with same entity name
EXCLUDE = $(shell find ./ghdl-build/ -type f -name '*.vhd') \
$(shell find ./dsp/logic/ -type f -name '*.vhd') \
$(shell find . -type f -name '*Ad9249Deserializer.vhd') \
$(shell find . -type f -name '*Ad9249ReadoutGroup.vhd') \
$(shell find . -type f -name '*GigEthGthUltraScale.vhd') \
$(shell find . -type f -name '*GigEthGthUltraScaleWrapper.vhd') \
$(shell find . -type f -name '*TenGigEthGthUltraScale.vhd') \
$(shell find . -type f -name '*TenGigEthGthUltraScaleClk.vhd') \
$(shell find . -type f -name '*TenGigEthGthUltraScaleRst.vhd') \
$(shell find . -type f -name '*TenGigEthGthUltraScaleWrapper.vhd') \
$(shell find . -type f -name '*XauiGthUltraScale.vhd') \
$(shell find . -type f -name '*XauiGthUltraScaleWrapper.vhd') \
$(shell find . -type f -name '*ClinkDataClk.vhd') \
$(shell find . -type f -name '*ClinkDataShift.vhd') \
$(shell find . -type f -name '*Pgp2bGthUltra.vhd') \
$(shell find . -type f -name '*PgpGthCoreWrapper.vhd') \
$(shell find . -type f -name '*Pgp3GthUs.vhd') \
$(shell find . -type f -name '*Pgp3GthUsIpWrapper.vhd') \
$(shell find . -type f -name '*Pgp3GthUsQpll.vhd') \
$(shell find . -type f -name '*Pgp3GthUsWrapper.vhd') \
$(shell find . -type f -name '*InputBufferReg.vhd') \
$(shell find . -type f -name '*OutputBufferReg.vhd') \
$(shell find . -type f -name '*GthUltraScaleQuadPll.vhd') \
$(shell find . -type f -name '*MicroblazeBasicCoreWrapper.vhd') \
FILES = $(filter-out $(EXCLUDE),$(wildcard $(PATHS)))
ENTITY_EXCLUDES = stdlib
ENTITIES := $(filter-out $(ENTITY_EXCLUDES),$(patsubst %Pkg,,$(patsubst %.vhd,%,$(notdir $(FILES)))))
MAKEFILES = $(patsubst %,%.mk,$(ENTITIES))
all: dir import
test:
@echo GHDLFLAGS: $(GHDLFLAGS)
@echo FILES: $(FILES)
@echo ENTITIES:
@echo "\t$(foreach ARG,$(ENTITIES), $(ARG)\n)"
clean :
$(GHDL) --clean $(GHDLFLAGS)
dir:
test -d $(GHDL_WORKDIR) || mkdir $(GHDL_WORKDIR)
import : $(FILES)
@echo "============================================================================="
@echo Importing:
@echo "============================================================================="
$(GHDL) -i $(GHDLFLAGS) $(FILES)
syntax: $(FILES)
@echo "============================================================================="
@echo Syntax Checking:
@echo "============================================================================="
$(GHDL) -s $(GHDLFLAGS) $(FILES)
makefiles: $(MAKEFILES)
elaborate: $(ENTITIES)
$(ENTITIES) : import syntax
$(GHDL) -e $(GHDLFLAGS) $@
html : $(FILES)
$(GHDL) --xref-html $(GHDLFLAGS) $(FILES)
$(MAKEFILES) : import
$(GHDL) --gen-makefile $(GHDLFLAGS) $(patsubst %.mk,%,$@) > work/$@
force: