-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
63 lines (42 loc) · 1.96 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
LDIST-R5C ?= $(shell cat "debian/nanopi-r5c/make_debian_img.sh" | sed -n 's/\s*local deb_dist=.\([[:alpha:]]\+\)./\1/p')
LDIST-R5S ?= $(shell cat "debian/nanopi-r5s/make_debian_img.sh" | sed -n 's/\s*local deb_dist=.\([[:alpha:]]\+\)./\1/p')
all: uboot dtb debian
@echo "all binaries ready"
debian: debian-r5c debian-r5s
debian-r5c: uboot dtb debian/nanopi-r5c/mmc_2g.img
@echo "debian nanopi-r5c image ready"
debian-r5s: uboot dtb debian/nanopi-r5s/mmc_2g.img
@echo "debian nanopi-r5s image ready"
dtb: dtb/rk3568-nanopi-r5c.dtb dtb/rk3568-nanopi-r5s.dtb
@echo "device tree binaries ready"
uboot: uboot/idbloader-r5c.img uboot/u-boot-r5c.itb uboot/idbloader-r5s.img uboot/u-boot-r5s.itb
@echo "u-boot binaries ready"
package-%: all
@echo "building package for version $*"
@rm -rfv distfiles
@mkdir -v distfiles
@cp -v uboot/idbloader-r5c.img uboot/u-boot-r5c.itb distfiles
@cp -v dtb/rk3568-nanopi-r5c.dtb distfiles
@cp -v debian/nanopi-r5c/mmc_2g.img distfiles/nanopi-r5c_$(LDIST-R5C)-$*.img
@xz -zve8 distfiles/nanopi-r5c_$(LDIST-R5C)-$*.img
@cp -v uboot/idbloader-r5s.img uboot/u-boot-r5s.itb distfiles
@cp -v dtb/rk3568-nanopi-r5s.dtb distfiles
@cp -v debian/nanopi-r5s/mmc_2g.img distfiles/nanopi-r5s_$(LDIST-R5S)-$*.img
@xz -zve8 distfiles/nanopi-r5s_$(LDIST-R5S)-$*.img
@cd distfiles ; sha256sum * > sha256sums.txt
clean:
@rm -rfv distfiles
sudo sh debian/nanopi-r5c/make_debian_img.sh clean
sudo sh debian/nanopi-r5s/make_debian_img.sh clean
sh dtb/make_dtb.sh clean
sh uboot/make_uboot.sh clean
@echo "all targets clean"
debian/nanopi-r5c/mmc_2g.img:
sudo sh debian/nanopi-r5c/make_debian_img.sh nocomp
debian/nanopi-r5s/mmc_2g.img:
sudo sh debian/nanopi-r5s/make_debian_img.sh nocomp
dtb/rk3568-nanopi-r5c.dtb dtb/rk3568-nanopi-r5s.dtb:
sh dtb/make_dtb.sh cp
uboot/idbloader-r5c.img uboot/u-boot-r5c.itb uboot/idbloader-r5s.img uboot/u-boot-r5s.itb:
sh uboot/make_uboot.sh cp
.PHONY: debian debian-r5c debian-r5s dtb uboot all package-* clean