-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1.26 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
SCRIPTS_DIR = $(realpath scripts)
SCRIPTS := $(shell find $(SCRIPTS_DIR))
PATCHES_DIR = $(realpath patches)
FSBL_PATCHES_DIR = $(PATCHES_DIR)/fsbl
# Script parameters
BIT_FILE ?= $(realpath system_top.bit)
XSA_FILE ?= $(realpath design.xsa)
UBOOT_FILE ?= $(realpath u-boot)
UBOOT_LOADADDR ?= 0x4000000
BUILD_DIR = build/
OUT_DIR = output/
GEN_SCRIPTS = $(OUT_DIR)/zynq.bif $(BUILD_DIR)/create_fsbl.tcl
FSBL_SRC = $(BUILD_DIR)/zynq_fsbl
FSBL_ELF = $(FSBL_SRC)/executable.elf
BOOT_BIN = $(OUT_DIR)/BOOT.BIN
all: $(BOOT_BIN)
$(GEN_SCRIPTS): $(SCRIPTS)
rm -rf $(BUILD_DIR) $(OUT_DIR)
mkdir -p $(BUILD_DIR) $(OUT_DIR)
$(SCRIPTS_DIR)/build_boot_bin.sh scripts $(BIT_FILE) $(XSA_FILE) $(UBOOT_FILE) $(UBOOT_LOADADDR)
$(FSBL_SRC): $(GEN_SCRIPTS)
$(SCRIPTS_DIR)/build_boot_bin.sh create_fsbl $(BIT_FILE) $(XSA_FILE) $(UBOOT_FILE) $(UBOOT_LOADADDR)
$(FSBL_ELF): $(FSBL_SRC)
cd $(FSBL_SRC); \
git init; git add -A; git commit -s -m "init"; \
git am $(FSBL_PATCHES_DIR)/*
$(SCRIPTS_DIR)/build_boot_bin.sh build_fsbl $(BIT_FILE) $(XSA_FILE) $(UBOOT_FILE) $(UBOOT_LOADADDR)
$(BOOT_BIN): $(FSBL_ELF) $(UBOOT_FILE) $(BIT_FILE) $(XSA_FILE)
$(SCRIPTS_DIR)/build_boot_bin.sh build_bootbin $(BIT_FILE) $(XSA_FILE) $(UBOOT_FILE) $(UBOOT_LOADADDR)
.PHONY: clean
clean:
rm -rf build output