114 lines
2.3 KiB
Makefile
114 lines
2.3 KiB
Makefile
O ?= .
|
|
IMAGESDIR ?= $(O)/images
|
|
CONFIGDIR ?= .
|
|
|
|
export CONFIGDIR
|
|
|
|
update.tar: $(IMAGESDIR)/update.tar.zstd
|
|
|
|
$(O)/.prepared: \
|
|
prepare.sh \
|
|
setup-local-repo.sh \
|
|
$(shell find patches/ebuilds -type f)
|
|
./prepare.sh
|
|
./setup-local-repo.sh
|
|
mkdir -p $(O)
|
|
touch $(O)/.prepared
|
|
|
|
prepare: $(O)/.prepared
|
|
|
|
$(O)/.host-tools: \
|
|
build-host-tools.sh \
|
|
host-tools.packages \
|
|
$(shell find $(CONFIGDIR)/portage/host -type f) \
|
|
$(O)/.prepared
|
|
./build-host-tools.sh
|
|
touch $(O)/.host-tools
|
|
|
|
host-tools: $(O)/.host-tools
|
|
|
|
$(O)/.built: \
|
|
build.sh \
|
|
build.packages \
|
|
install.packages \
|
|
$(CONFIGDIR)/build.packages \
|
|
$(CONFIGDIR)/install.packages \
|
|
$(shell find $(CONFIGDIR)/portage/target -type f) \
|
|
$(O)/.host-tools \
|
|
$(O)/.prepared
|
|
./build.sh
|
|
touch $(O)/.built
|
|
|
|
$(O)/.ready: \
|
|
build-rootfs.sh \
|
|
install.packages \
|
|
$(CONFIGDIR)/install.packages \
|
|
$(CONFIGDIR)/installonly.packages \
|
|
$(CONFIGDIR)/busybox.symlinks \
|
|
$(O)/linux/arch/arm64/boot/Image.gz \
|
|
$(shell find overlay -type f) \
|
|
$(shell find $(CONFIGDIR)/overlay -type f 2>/dev/null) \
|
|
$(O)/.host-tools \
|
|
$(O)/.built
|
|
./build-rootfs.sh
|
|
touch $(O)/.ready
|
|
|
|
$(IMAGESDIR)/rootfs.squashfs: \
|
|
build-squashfs.sh \
|
|
$(CONFIGDIR)/squashfs.exclude \
|
|
$(O)/.ready
|
|
./build-squashfs.sh "$(IMAGESDIR)"
|
|
|
|
squashfs: $(IMAGESDIR)/rootfs.squashfs
|
|
|
|
$(O)/linux/arch/arm64/boot/Image.gz: \
|
|
build-kernel.sh \
|
|
$(CONFIGDIR)/linux.config \
|
|
$(O)/.host-tools \
|
|
$(O)/.prepared
|
|
./build-kernel.sh "$(O)"
|
|
|
|
kernel: $(O)/linux/arch/arm64/boot/Image.gz
|
|
|
|
$(O)/efi-part/EFI/BOOT/BOOTAA64.efi: \
|
|
build-grub.sh \
|
|
grub.cfg \
|
|
$(O)/.host-tools \
|
|
$(O)/.prepared
|
|
./build-grub.sh "$(O)"
|
|
|
|
grub: $(O)/efi-part/EFI/BOOT/BOOTAA64.efi
|
|
|
|
$(IMAGESDIR)/sdcard.img: \
|
|
genimage.cfg \
|
|
genimage.sh \
|
|
post-build.sh \
|
|
$(O)/efi-part/EFI/BOOT/BOOTAA64.efi
|
|
./post-build.sh "$(O)"
|
|
./genimage.sh "$(O)" "$(IMAGESDIR)"
|
|
|
|
sdcard.img: $(IMAGESDIR)/sdcard.img
|
|
|
|
$(IMAGESDIR)/firmware.img: $(IMAGESDIR)/sdcard.img
|
|
|
|
$(IMAGESDIR)/update.tar.zstd: \
|
|
$(IMAGESDIR)/rootfs.squashfs \
|
|
$(IMAGESDIR)/firmware.img \
|
|
install-update.sh \
|
|
$(O)/.host-tools \
|
|
$(O)/.prepared
|
|
./build-update.sh "$(IMAGESDIR)"
|
|
|
|
clean:
|
|
rm -rf $(O)/linux $(O)/output $(IMAGESDIR) $(O)/tmp
|
|
rm -f $(O)/.prepared $(O)/.host-tools
|
|
|
|
.PHONY: \
|
|
grub \
|
|
host-tools \
|
|
kernel \
|
|
prepare \
|
|
sdcard.img \
|
|
squashfs \
|
|
update.tar
|