tMakefile - pinephone-boot - Bootloader and kernel build for the PinePhone devkit
HTML git clone git://parazyd.org/pinephone-boot.git | https://git.parazyd.org/pinephone-boot
DIR Log
DIR Files
DIR Refs
---
tMakefile (2237B)
---
1 .POSIX:
2
3 # Dependencies:
4 # unzip flex bc bison kmod cpio libssl-dev device-tree-compiler python
5 # python-dev swig u-boot-tools
6
7 compiler = aarch64-linux-gnu-
8 clonedepth = --depth 1
9
10 atfgit = https://github.com/ARM-software/arm-trusted-firmware.git
11 ubootgit = https://gitlab.com/pine64-org/u-boot.git
12 linuxgit = https://gitlab.com/pine64-org/linux.git
13 linuxbranch = pinephone-dontbeevil-5.1-rc7
14 linuxconfig = pinephone-config-5.1.0-rc7
15
16 BIN = \
17 bl31.bin \
18 u-boot-sunxi-with-spl-sopine.bin \
19 Image \
20 Image.gz \
21 sun50i-a64-dontbeevil.dtb \
22 boot.scr
23
24 DIR = \
25 arm-trusted-firmware \
26 u-boot \
27 pinephone-linux \
28 lib/modules
29
30 all: $(BIN) $(DIR)
31
32 arm-trusted-firmware:
33 git clone $(clonedepth) $(atfgit) $@
34
35 bl31.bin: arm-trusted-firmware
36 $(MAKE) -C arm-trusted-firmware distclean
37 $(MAKE) -C arm-trusted-firmware CROSS_COMPILE=$(compiler) \
38 PLAT=sun50i_a64 DEBUG=1 bl31
39 cp arm-trusted-firmware/build/sun50i_a64/debug/$@ $@
40
41 boot.scr:
42 mkimage -C none -A arm -T script -d boot.txt $@
43
44 u-boot:
45 git clone $(clonedepth) $(ubootgit) $@
46
47 u-boot-sunxi-with-spl-sopine.bin: bl31.bin u-boot
48 $(MAKE) -C u-boot distclean
49 $(MAKE) -C u-boot sopine_baseboard_defconfig
50 cp -f bl31.bin u-boot/
51 echo 'CONFIG_IDENT_STRING=" Maemo Leste"' >> u-boot/.config
52 $(MAKE) -C u-boot ARCH=arm CROSS_COMPILE=$(compiler)
53 cat u-boot/spl/sunxi-spl.bin u-boot/u-boot.itb > $@
54
55 pinephone-linux:
56 git clone -b $(linuxbranch) $(clonedepth) $(linuxgit) $@
57
58 Image: pinephone-linux
59 cp $(linuxconfig) pinephone-linux/.config
60 $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \
61 oldconfig
62 $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \
63 Image modules
64 cp pinephone-linux/arch/arm64/boot/$@ $@
65
66 Image.gz: Image
67 gzip -kf Image
68
69 sun50i-a64-dontbeevil.dtb: Image
70 $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \
71 allwinner/$@
72 cp pinephone-linux/arch/arm64/boot/dts/allwinner/$@ $@
73
74 lib/modules: Image
75 rm -rf $@
76 $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \
77 INSTALL_MOD_PATH="$(PWD)" modules_install
78
79 clean:
80 rm -rf $(BIN) lib
81
82 distclean: clean
83 $(MAKE) -C arm-trusted-firmware distclean
84 $(MAKE) -C u-boot distclean
85 $(MAKE) -C pinephone-linux distclean
86
87 mrproper: clean
88 rm -rf $(DIR)