forked from adumont/hrm-cpu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
94 lines (80 loc) · 3.09 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
87
88
89
90
91
92
93
94
all: check_latest ci-deps test
TARGETDIR:=$(HOME)/toolchain
SOURCEDIR:=$(HOME)/src
test:
grep . $(TARGETDIR)/*.ver
$(MAKE) -s -C verilog test
$(MAKE) -C verilog/test BOARD=alhambra hwbin
$(MAKE) -C verilog/test BOARD=ice40hx8k hwbin
clean:
$(MAKE) -C verilog clean
$(MAKE) -C gui clean
$(MAKE) -C verilog/test BOARD=alhambra clean
$(MAKE) -C verilog/test BOARD=alhambra hwclean
$(MAKE) -C verilog/test BOARD=ice40hx8k clean
$(MAKE) -C verilog/test BOARD=ice40hx8k hwclean
rm -rf verilog/builddir
GIT_ICEST:=https://github.com/cliffordwolf/icestorm.git
GIT_YOSYS:=https://github.com/cliffordwolf/yosys.git
GIT_ARACH:=https://github.com/cseed/arachne-pnr.git
GIT_SYMBI:=https://github.com/cliffordwolf/SymbiYosys.git
GIT_YICES:=https://github.com/SRI-CSL/yices2.git
VER_ICEST:=$(TARGETDIR)/icestorm.ver
VER_YOSYS:=$(TARGETDIR)/yosys.ver
VER_ARACH:=$(TARGETDIR)/arachne-pnr.ver
VER_SYMBI:=$(TARGETDIR)/symbiyosys.ver
VER_YICES:=$(TARGETDIR)/yices2.ver
check_latest:
[ -e $(VER_ICEST) ] && ( git ls-remote --heads $(GIT_ICEST) refs/heads/master | cut -f1 | cmp $(VER_ICEST) - || rm -f $(VER_ICEST) ) || true
[ -e $(VER_YOSYS) ] && ( git ls-remote --heads $(GIT_YOSYS) refs/heads/master | cut -f1 | cmp $(VER_YOSYS) - || rm -f $(VER_YOSYS) ) || true
[ -e $(VER_ARACH) ] && ( git ls-remote --heads $(GIT_ARACH) refs/heads/master | cut -f1 | cmp $(VER_ARACH) - || rm -f $(VER_ARACH) ) || true
[ -e $(VER_SYMBI) ] && ( git ls-remote --heads $(GIT_SYMBI) refs/heads/master | cut -f1 | cmp $(VER_SYMBI) - || rm -f $(VER_SYMBI) ) || true
[ -e $(VER_YICES) ] && ( git ls-remote --heads $(GIT_YICES) refs/heads/master | cut -f1 | cmp $(VER_YICES) - || rm -f $(VER_YICES) ) || true
ci-deps: $(VER_ICEST) $(VER_YOSYS) $(VER_ARACH) $(VER_SYMBI) $(VER_YICES)
ifndef TRAVIS
NPROC:= -j$(shell nproc)
endif
$(VER_ICEST):
mkdir -p $(SOURCEDIR); cd $(SOURCEDIR) && \
( [ -e icestorm ] || git clone $(GIT_ICEST) ) && \
cd icestorm && \
git pull && \
git log -1 && \
nice make $(NPROC) DESTDIR=$(TARGETDIR) PREFIX= install && \
git rev-parse HEAD > $(VER_ICEST)
$(VER_YOSYS):
mkdir -p $(SOURCEDIR); cd $(SOURCEDIR) && \
( [ -e yosys ] || git clone $(GIT_YOSYS) ) && \
cd yosys && \
git pull && \
git log -1 && \
nice make $(NPROC) PREFIX=$(TARGETDIR) install && \
git rev-parse HEAD > $(VER_YOSYS)
$(VER_ARACH):
mkdir -p $(SOURCEDIR); cd $(SOURCEDIR) && \
( [ -e arachne-pnr ] || git clone $(GIT_ARACH) ) && \
cd arachne-pnr && \
git pull && \
git log -1 && \
nice make $(NPROC) PREFIX=$(TARGETDIR) install && \
git rev-parse HEAD > $(VER_ARACH)
$(VER_SYMBI):
mkdir -p $(SOURCEDIR); cd $(SOURCEDIR) && \
( [ -e SymbiYosys ] || git clone $(GIT_SYMBI) ) && \
cd SymbiYosys && \
git pull && \
git log -1 && \
nice make PREFIX=$(TARGETDIR) install && \
git rev-parse HEAD > $(VER_SYMBI)
$(VER_YICES):
mkdir -p $(SOURCEDIR); cd $(SOURCEDIR) && \
( [ -e yices2 ] || git clone $(GIT_YICES) ) && \
cd yices2 && \
git pull && \
git log -1 && \
autoconf && \
./configure --prefix=$(TARGETDIR) && \
nice make $(NPROC) && \
make $(NPROC) install && \
git rev-parse HEAD > $(VER_YICES)
.PHONY: test clean ci-deps check_latest