1 |
6 |
dgisselq |
##############################################################################//
|
2 |
|
|
##
|
3 |
|
|
## Filename: Makefile
|
4 |
|
|
##
|
5 |
|
|
## Project: CMod S6 System on a Chip, ZipCPU demonstration project
|
6 |
|
|
##
|
7 |
|
|
## Purpose: An initial attempt at a master project makefile. Does not
|
8 |
|
|
## yet support subdirectory recursion, so it currently does
|
9 |
|
|
## little more than make a tar file or a date stamp.
|
10 |
|
|
##
|
11 |
|
|
## Creator: Dan Gisselquist, Ph.D.
|
12 |
|
|
## Gisselquist Technology, LLC
|
13 |
|
|
##
|
14 |
|
|
##############################################################################//
|
15 |
|
|
##
|
16 |
|
|
## Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
17 |
|
|
##
|
18 |
|
|
## This program is free software (firmware): you can redistribute it and/or
|
19 |
|
|
## modify it under the terms of the GNU General Public License as published
|
20 |
|
|
## by the Free Software Foundation, either version 3 of the License, or (at
|
21 |
|
|
## your option) any later version.
|
22 |
|
|
##
|
23 |
|
|
## This program is distributed in the hope that it will be useful, but WITHOUT
|
24 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
25 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
26 |
|
|
## for more details.
|
27 |
|
|
##
|
28 |
|
|
## You should have received a copy of the GNU General Public License along
|
29 |
|
|
## with this program. (It's in the $(ROOT)/doc directory, run make with no
|
30 |
|
|
## target there if the PDF file isn't present.) If not, see
|
31 |
|
|
## for a copy.
|
32 |
|
|
##
|
33 |
|
|
## License: GPL, v3, as defined and found on www.gnu.org,
|
34 |
|
|
## http://www.gnu.org/licenses/gpl.html
|
35 |
|
|
##
|
36 |
|
|
##
|
37 |
|
|
##############################################################################//
|
38 |
|
|
##
|
39 |
|
|
##
|
40 |
2 |
dgisselq |
.PHONY: all
|
41 |
11 |
dgisselq |
all: datestamp archive rtl sw
|
42 |
2 |
dgisselq |
# BENCH := `find bench -name Makefile` `find bench -name "*.cpp"` `find bench -name "*.h"`
|
43 |
|
|
BENCH :=
|
44 |
|
|
RTL := `find rtl -name "*.v"` `find rtl -name Makefile`
|
45 |
|
|
NOTES := `find . -name "*.txt"` `find . -name "*.html"`
|
46 |
|
|
SW := `find sw -name "*.cpp"` `find sw -name "*.h"` \
|
47 |
|
|
`find sw -name "*.sh"` `find sw -name "*.py"` \
|
48 |
|
|
`find sw -name "*.pl"` `find sw -name Makefile`
|
49 |
|
|
# PROJ := xilinx/xula.prj xilinx/xula.xise xilinx/xula.xst \
|
50 |
|
|
# xilinx/xula.ut xilinx/Makefile
|
51 |
|
|
PROJ :=
|
52 |
|
|
BIN := `find xilinx -name "*.bit"`
|
53 |
|
|
CONSTRAINTS := cmod.ucf
|
54 |
|
|
YYMMDD := `date +%Y%m%d`
|
55 |
|
|
|
56 |
6 |
dgisselq |
.PHONY: datestamp
|
57 |
|
|
datestamp:
|
58 |
|
|
@bash -c 'if [ ! -e $(YYMMDD)-build.v ]; then rm 20??????-build.v; perl mkdatev.pl > $(YYMMDD)-build.v; rm -f rtl/builddate.v; fi'
|
59 |
|
|
@bash -c 'if [ ! -e rtl/builddate.v ]; then cd rtl; cp ../$(YYMMDD)-build.v builddate.v; fi'
|
60 |
2 |
dgisselq |
|
61 |
11 |
dgisselq |
.PHONY: rtl
|
62 |
|
|
rtl:
|
63 |
|
|
@make --no-print-directory -C rtl
|
64 |
|
|
|
65 |
|
|
.PHONY: sw
|
66 |
|
|
sw:
|
67 |
|
|
@make --no-print-directory -C sw
|
68 |
|
|
|
69 |
|
|
.PHONY: doc
|
70 |
|
|
doc:
|
71 |
|
|
@make --no-print-directory -C doc
|
72 |
|
|
|
73 |
|
|
.PHONY: bench
|
74 |
|
|
bench: rtl
|
75 |
|
|
@make --no-print-directory -C bench/cpp
|
76 |
|
|
|
77 |
2 |
dgisselq |
.PHONY: archive
|
78 |
|
|
archive:
|
79 |
11 |
dgisselq |
tar --transform s,^,$(YYMMDD)-s6/, -chjf $(YYMMDD)-s6.tjz $(BENCH) $(SW) $(RTL) $(NOTES) $(PROJ) $(BIN) $(CONSTRAINTS)
|
80 |
2 |
dgisselq |
|
81 |
|
|
# .PHONY: bit
|
82 |
|
|
# bit:
|
83 |
11 |
dgisselq |
# make --no-print-directory -C xilinx toplevel.bit
|
84 |
2 |
dgisselq |
|
85 |
6 |
dgisselq |
axload:
|
86 |
|
|
djtgcfg enum
|
87 |
|
|
djtgcfg init -d CmodS6
|
88 |
|
|
djtgcfg prog -d CmodS6 -i 0 -f xilinx/alttop.bit
|
89 |
8 |
dgisselq |
# Might also be able to do a ...
|
90 |
|
|
# djtgcfg erase -d CmodS6 -i 0
|
91 |
|
|
# but I can't speak to whether it would be useful or not.
|
92 |
2 |
dgisselq |
|
93 |
6 |
dgisselq |
xload:
|
94 |
8 |
dgisselq |
djtgcfg init -d CmodS6
|
95 |
6 |
dgisselq |
djtgcfg prog -d CmodS6 -i 0 -f xilinx/toplevel.bit
|