1 |
13 |
dgisselq |
################################################################################
|
2 |
|
|
##
|
3 |
|
|
## Filename: rtl/Makefile
|
4 |
|
|
##
|
5 |
|
|
## Project: WBScope, a wishbone hosted scope
|
6 |
|
|
##
|
7 |
|
|
## Purpose: To direct the Verilator build of the SoC sources. The result
|
8 |
|
|
## is C++ code (built by Verilator), that is then built (herein)
|
9 |
|
|
## into a library.
|
10 |
|
|
##
|
11 |
|
|
## Targets: The default target, all, builds the target test, which includes
|
12 |
|
|
## the libraries necessary for Verilator testing.
|
13 |
|
|
##
|
14 |
|
|
## Creator: Dan Gisselquist, Ph.D.
|
15 |
|
|
## Gisselquist Technology, LLC
|
16 |
|
|
##
|
17 |
|
|
################################################################################
|
18 |
|
|
##
|
19 |
|
|
## Copyright (C) 2015-2017, Gisselquist Technology, LLC
|
20 |
|
|
##
|
21 |
|
|
## This program is free software (firmware): you can redistribute it and/or
|
22 |
|
|
## modify it under the terms of the GNU General Public License as published
|
23 |
|
|
## by the Free Software Foundation, either version 3 of the License, or (at
|
24 |
|
|
## your option) any later version.
|
25 |
|
|
##
|
26 |
|
|
## This program is distributed in the hope that it will be useful, but WITHOUT
|
27 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
28 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
29 |
|
|
## for more details.
|
30 |
|
|
##
|
31 |
|
|
## You should have received a copy of the GNU General Public License along
|
32 |
|
|
## with this program. (It's in the $(ROOT)/doc directory. Run make with no
|
33 |
|
|
## target there if the PDF file isn't present.) If not, see
|
34 |
|
|
## for a copy.
|
35 |
|
|
##
|
36 |
|
|
## License: GPL, v3, as defined and found on www.gnu.org,
|
37 |
|
|
## http://www.gnu.org/licenses/gpl.html
|
38 |
|
|
##
|
39 |
|
|
################################################################################
|
40 |
|
|
##
|
41 |
|
|
##
|
42 |
|
|
all: test axi
|
43 |
|
|
FBDIR := .
|
44 |
|
|
VDIRFB:= $(FBDIR)/obj_dir
|
45 |
|
|
|
46 |
|
|
.PHONY: test
|
47 |
|
|
test: $(VDIRFB)/Vwbscope__ALL.a
|
48 |
|
|
test: $(VDIRFB)/Vwbscopc__ALL.a
|
49 |
|
|
.PHONY: axi
|
50 |
|
|
axi: $(VDIRFB)/Vaxi4lscope__ALL.a
|
51 |
|
|
|
52 |
|
|
$(VDIRFB)/Vwbscope__ALL.a: $(VDIRFB)/Vwbscope.h $(VDIRFB)/Vwbscope.cpp
|
53 |
|
|
$(VDIRFB)/Vwbscope__ALL.a: $(VDIRFB)/Vwbscope.mk
|
54 |
|
|
$(VDIRFB)/Vwbscope.h $(VDIRFB)/Vwbscope.cpp $(VDIRFB)/Vwbscope.mk: wbscope.v
|
55 |
|
|
|
56 |
|
|
$(VDIRFB)/Vwbscopc__ALL.a: $(VDIRFB)/Vwbscopc.h $(VDIRFB)/Vwbscopc.cpp
|
57 |
|
|
$(VDIRFB)/Vwbscopc__ALL.a: $(VDIRFB)/Vwbscopc.mk
|
58 |
|
|
$(VDIRFB)/Vwbscopc.h $(VDIRFB)/Vwbscopc.cpp $(VDIRFB)/Vwbscopc.mk: wbscopc.v
|
59 |
|
|
|
60 |
|
|
$(VDIRFB)/V%.cpp $(VDIRFB)/V%.h $(VDIRFB)/V%.mk: $(FBDIR)/%.v
|
61 |
|
|
verilator -Wall -cc $*.v
|
62 |
|
|
|
63 |
|
|
$(VDIRFB)/V%__ALL.a: $(VDIRFB)/V%.mk
|
64 |
|
|
cd $(VDIRFB); make -f V$*.mk
|
65 |
|
|
|
66 |
|
|
.PHONY: clean
|
67 |
|
|
clean:
|
68 |
|
|
rm -rf $(VDIRFB)/
|
69 |
|
|
|