forked from somhi/BBC_DemiSTify
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (58 loc) · 2.6 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
DEMISTIFYPATH=DeMiSTify
SUBMODULES=$(DEMISTIFYPATH)/EightThirtyTwo/lib832/lib832.a
PROJECT=BBC
PROJECTPATH=./
PROJECTTOROOT=../
BOARD=
ROMSIZE1=8192
ROMSIZE2=4096
all: $(DEMISTIFYPATH)/site.template $(DEMISTIFYPATH)/site.mk $(SUBMODULES) firmware init compile tns
# Use the file least likely to change within DeMiSTify to detect submodules!
$(DEMISTIFYPATH)/COPYING:
git submodule update --init --recursive
$(DEMISTIFYPATH)/site.mk: $(DEMISTIFYPATH)/COPYING
$(info ******************************************************)
$(info Please copy the example DeMiSTify/site.template file to)
$(info DeMiSTify/site.mk and edit the paths for the version(s))
$(info of Quartus you have installed.)
$(info *******************************************************)
$(error site.mk not found.)
include $(DEMISTIFYPATH)/site.mk
$(DEMISTIFYPATH)/EightThirtyTwo/Makefile:
git submodule update --init --recursive
$(SUBMODULES): $(DEMISTIFYPATH)/EightThirtyTwo/Makefile
make -C $(DEMISTIFYPATH) -f bootstrap.mk
.PHONY: firmware
firmware: $(SUBMODULES)
make -C firmware -f ../$(DEMISTIFYPATH)/firmware/Makefile DEMISTIFYPATH=../$(DEMISTIFYPATH) ROMSIZE1=$(ROMSIZE1) ROMSIZE2=$(ROMSIZE2)
.PHONY: firmware_clean
firmware_clean: $(SUBMODULES)
make -C firmware -f ../$(DEMISTIFYPATH)/firmware/Makefile DEMISTIFYPATH=../$(DEMISTIFYPATH) ROMSIZE1=$(ROMSIZE1) ROMSIZE2=$(ROMSIZE2) clean
.PHONY: init
init:
make -f $(DEMISTIFYPATH)/Makefile DEMISTIFYPATH=$(DEMISTIFYPATH) PROJECTTOROOT=$(PROJECTTOROOT) PROJECTPATH=$(PROJECTPATH) PROJECTS=$(PROJECT) BOARD=$(BOARD) init
.PHONY: compile
compile:
make -f $(DEMISTIFYPATH)/Makefile DEMISTIFYPATH=$(DEMISTIFYPATH) PROJECTTOROOT=$(PROJECTTOROOT) PROJECTPATH=$(PROJECTPATH) PROJECTS=$(PROJECT) BOARD=$(BOARD) compile
.PHONY: clean
clean:
make -f $(DEMISTIFYPATH)/Makefile DEMISTIFYPATH=$(DEMISTIFYPATH) PROJECTTOROOT=$(PROJECTTOROOT) PROJECTPATH=$(PROJECTPATH) PROJECTS=$(PROJECT) BOARD=$(BOARD) clean
.PHONY: tns
tns:
@for BOARD in ${BOARDS}; do \
echo $$BOARD; \
grep -r Design-wide\ TNS $$BOARD/output_files/*.rpt; \
echo -ne '\007'; \
done
.PHONY: mist
mist:
@echo -n "Compiling $(PROJECT) for MiST... "
@$(QUARTUS_MIST)/quartus_sh >mist/compile.log --flow compile mist/$(PROJECT)_MiST.qpf \
&& echo "\033[32mSuccess\033[0m" || grep Error mist/compile.log
@grep -r Design-wide\ TNS mist/output_files/*.rpt
.PHONY: mister
mister:
@echo -n "Compiling $(PROJECT) for MiSTer... "
@$(QUARTUS_MISTER)/quartus_sh >MiSTer/compile.log --flow compile MiSTer/$(PROJECT)_MiSTer.qpf \
&& echo "\033[32mSuccess\033[0m" || grep Error MiSTer/compile.log
@grep -r Design-wide\ TNS MiSTer/output_files/*.rpt