The Portage packages that need to be built and/or installed are now specified in the `build.packages` and `install.packages` files, respectively. Similarly, packages to be installed on the host system are specified in `host-tools.packages`. Finally, the `installonly.packages` file contains a list of packages that are installed in the destination root, but not built in the sysroot beforehand. This allows `make` to better track when the package sets change. It will also make it easier to maintain different sets for different variants in the future.
116 lines
2.2 KiB
Makefile
116 lines
2.2 KiB
Makefile
O ?= .
|
|
IMAGESDIR ?= $(O)/images
|
|
|
|
update.tar: $(IMAGESDIR)/update.tar.zstd
|
|
|
|
$(O)/.prepared: \
|
|
prepare.sh \
|
|
config-portage.sh \
|
|
setup-local-repo.sh \
|
|
$(shell find portage host-portage -type f) \
|
|
$(shell find patches/ebuilds -type f)
|
|
./prepare.sh
|
|
./config-portage.sh
|
|
./setup-local-repo.sh
|
|
mkdir -p $(O)
|
|
touch $(O)/.prepared
|
|
|
|
prepare: $(O)/.prepared
|
|
|
|
$(O)/.host-tools: \
|
|
build-host-tools.sh \
|
|
host-tools.packages \
|
|
$(O)/.prepared
|
|
./build-host-tools.sh
|
|
touch $(O)/.host-tools
|
|
|
|
host-tools: $(O)/.host-tools
|
|
|
|
$(O)/.built: \
|
|
build.sh \
|
|
build.packages \
|
|
install.packages \
|
|
$(O)/.host-tools \
|
|
$(O)/.prepared
|
|
./build.sh
|
|
touch $(O)/.built
|
|
|
|
$(O)/.ready: \
|
|
build-rootfs.sh \
|
|
install.packages \
|
|
installonly.packages \
|
|
$(O)/linux/arch/arm64/boot/Image.gz \
|
|
$(O)/.host-tools \
|
|
$(O)/.built
|
|
./build-rootfs.sh
|
|
touch $(O)/.ready
|
|
|
|
$(IMAGESDIR)/rootfs.squashfs: \
|
|
build-squashfs.sh \
|
|
squashfs.exclude \
|
|
$(O)/.ready
|
|
./build-squashfs.sh "$(IMAGESDIR)"
|
|
|
|
squashfs: $(IMAGESDIR)/rootfs.squashfs
|
|
|
|
$(O)/linux/arch/arm64/boot/Image.gz: \
|
|
build-kernel.sh \
|
|
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
|
|
|
|
$(O)/efi-part/u-boot.bin: \
|
|
build-uboot.sh \
|
|
u-boot.config
|
|
./build-uboot.sh "$(O)"
|
|
|
|
uboot: $(O)/efi-part/u-boot.bin
|
|
|
|
$(IMAGESDIR)/sdcard.img: \
|
|
genimage.cfg \
|
|
genimage.sh \
|
|
post-build.sh \
|
|
$(O)/efi-part/u-boot.bin \
|
|
$(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:
|
|
git -C u-boot clean -fdx && git -C u-boot checkout -- .
|
|
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 \
|
|
uboot \
|
|
update.tar
|