-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
63 lines (46 loc) · 1.17 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
# MINIMIG-DE1
# top makefile
# 2012, rok.krajnc@gmail.com
### board ###
BOARD?=de1
### paths ###
REL_DIR=rel
CTRL_FW_DIR=fw/ctrl
CTRL_BOOT_DIR=fw/ctrl_boot
FPGA_DIR=fpga/$(BOARD)
### files ###
CTRL_FW=$(CTRL_FW_DIR)/bin/de1_boot.bin
CTRL_BOOT=$(CTRL_BOOT_DIR)/bin/de1_boot.bin
FPGA=$(FPGA_DIR)/out/minimig_de1.sof $(FPGA_DIR)/out/minimig_de1.pof
### build rules ###
BUILD_OPT=clean all
# all
all:
@echo Building all ...
@mkdir -p $(REL_DIR)
@make ctrl_fw
@make ctrl_boot
@make fpga
ctrl_fw: Makefile
@echo Building ctrl firmware in $(CTRL_FW_DIR) ...
@$(MAKE) -C $(CTRL_FW_DIR) $(BUILD_OPT)
@cp $(CTRL_FW) $(REL_DIR)/
ctrl_boot: Makefile
@echo Building ctrl boot firmware in $(CTRL_BOOT_DIR) ...
@$(MAKE) -C $(CTRL_BOOT_DIR) $(BUILD_OPT)
.PHONY: fpga
fpga: Makefile
@echo Building FPGA in $(FPGA_DIR) ...
@$(MAKE) -C $(FPGA_DIR) $(BUILD_OPT)
@cp $(FPGA) $(REL_DIR)/
# clean
clean:
@echo Clearing release dir ...
# @rm -rf $(REL_DIR)
@$(MAKE) -C $(CTRL_FW_DIR) clean
@$(MAKE) -C $(CTRL_BOOT_DIR) clean
@$(MAKE) -C $(FPGA_DIR) clean
install:
@quartus_pgm -mas -o "p;$(FPGA_DIR)/out/minimig_de1.pof"
test:
@quartus_pgm -mjtag -o "p;$(FPGA_DIR)/out/minimig_de1.sof"