-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
98 lines (72 loc) · 2.32 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
95
96
97
98
#
# Build a Banana Pi install
#
DEBIAN_VER = stretch
DEBIAN_ARCH = armhf
# which uboot and device tree is this being built for
ARMBIAN_UBOOT_PKG = linux-u-boot-bananapi-dev
UBOOT = linux-u-boot-dev-bananapi_5.38_armhf
BOARD = sun7i-a20-bananapi
# FIXME - it would be nice if the uboot name was related to the dtb name
SRC_SPL = $(ARMBIAN)/usr/lib/$(UBOOT)/u-boot-sunxi-with-spl.bin
CLEAN_FILES += $(TAG) $(ARMBIAN) $(BOOT)
# Directories
ARMBIAN = $(BUILD)/armbian
BUILD_DEPENDS = \
xz-utils \
TOP_DIR ?= $(abspath ../..)
export TOP_DIR
all: image
include $(TOP_DIR)/mk/common.mk
include $(TOP_DIR)/boards/common-partitions.mk
include $(TOP_DIR)/boards/common-allwinner.mk
include $(TOP_DIR)/boards/common-kernel-local.mk
include $(TOP_DIR)/boards/common-firmware-armbian.mk
include $(TOP_DIR)/boards/common-cjdns-hack.mk
include $(TOP_DIR)/boards/common-initrd.mk
test:
echo this board must be tested by flashing the output
false
# Everything below this line is HW specific Armbian u-Boot startup code
$(TAG)/armbian:
$(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) armbian $(ARMBIAN) $(ARMBIAN_UBOOT_PKG)
$(call tag,armbian)
$(BOOT): $(TAG)/boot
$(TAG)/boot:
mkdir -p $(BOOT)
$(call tag,boot)
$(BOOT)/.next: $(TAG)/boot
touch $@
# TODO
# - stop using our local version of these files. (See the Makefile in
# boards/sun8i-h2-plus-orangepi-zero/ for more details)
$(BOOT)/boot.scr: $(TAG)/boot
$(BOOT)/boot.scr: boot.scr
cp $< $@
CLEAN_FILES += boot.scr
$(BOOT)/armbianEnv.txt: $(TAG)/boot
$(BOOT)/armbianEnv.txt: armbianEnv.txt
cp $< $@
$(BOOT)/zImage: $(LOCAL_KERNEL)
cp $< $@
cp $(dir $<)/.config $(dir $@)
$(BOOT)/uInitrd: $(TAG)/boot
$(BOOT)/uInitrd: $(BUILD)/combined.uInitrd
cp $< $@
CLEAN_FILES += $(BUILD)/combined.uInitrd
BOOT_FILES = \
$(BOOT)/boot.scr $(BOOT)/armbianEnv.txt \
$(BOOT)/.next \
$(BOOT)/zImage \
$(BOOT)/uInitrd \
BOOT_DTB_FILES = \
$(BOOT)/dtb/$(BOARD).dtb
boot: $(BOOT_FILES) $(BOOT_DTB_FILES)
# Everything below this line is packing the built boot dir into a disk image
$(SRC_SPL): $(TAG)/armbian
# FIXME - the env file is a hack
$(DISK_IMAGE): $(SRC_SPL) $(BUILD)/mtoolsrc $(BOOT_FILES) $(BOOT_DTB_FILES) env
$(call image_normal)
$(call allwinner_normal,$@.tmp,$(SRC_SPL),$(BUILD)/mtoolsrc,z:,$(BOOT_FILES),$(BOOT_DTB_FILES))
$(call uboot_overwrite_environment,env,$@.tmp)
mv $@.tmp $@