-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
66 lines (50 loc) · 1.28 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
# MINIMIG-MIST
# top makefile
# 2015, rok.krajnc@gmail.com
### board ###
BOARD?=mist
### release ###
RELEASE?=minimig-mist-test
### paths ###
REL_DIR = rel
FW_DIR = fw
FPGA_DIR = fpga
FW_SRC_DIR = $(FW_DIR)/$(BOARD)
FPGA_SRC_DIR = $(FPGA_DIR)/$(BOARD)
FW_REL_DIR = $(REL_DIR)/$(RELEASE)
FPGA_REL_DIR = $(REL_DIR)/$(RELEASE)
### files ###
FW_BIN_FILES = $(FW_SRC_DIR)/firmware.bin $(FW_SRC_DIR)/firmware.hex $(FW_SRC_DIR)/firmware.upg
FPGA_BIN_FILES = $(FPGA_SRC_DIR)/out/minimig_mist.rbf
### build rules ###
BUILD_OPT=clean all
# all
all: dirs
@echo Building all ...
@make fw
@make fpga
@echo DONE building all!
# directories
dirs: Makefile
@echo Creating release dirs $(REL_DIR)/$(RELEASE) ...
@mkdir -p $(REL_DIR)
@mkdir -p $(REL_DIR)/$(RELEASE)
@mkdir -p $(FW_REL_DIR)
@mkdir -p $(FPGA_REL_DIR)
# fw
fw: Makefile dirs
@echo Building firmware in $(FW_SRC_DIR) ...
@$(MAKE) -C $(FW_SRC_DIR) $(BUILD_OPT)
@cp $(FW_BIN_FILES) $(FW_REL_DIR)/
# fpga
fpga: Makefile dirs
@echo Building FPGA in $(FPGA_SRC_DIR) ...
@$(MAKE) -C $(FPGA_SRC_DIR) $(BUILD_OPT)
@cp $(FPGA_BIN_FILES) $(FPGA_REL_DIR)/
# clean
clean:
@echo Clearing release dir ...
# @rm -rf $(FW_REL_DIR)
# @rm -rf $(FPGA_REL_DIR)
@$(MAKE) -C $(FW_SRC_DIR) clean
@$(MAKE) -C $(FPGA_SRC_DIR) clean