In effort to support different builds of Aimee OS using the same scripts, without necessarily having to fork this repository, the build system now supports a `CONFIGDIR` setting. When this variable is set, files defining the target environment, such as the lists of packages to install, the kernel configuration, the Portage configuration, etc. are found in the path it specifes. The reference build, for the Home Assistant Yellow board, is configured in the `yellow` directory. To build it, run: ```sh CONFIGDIR=yellow ./vm-build.sh ```
111 lines
2.2 KiB
Makefile
111 lines
2.2 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 \
|
|
$(CONFIGDIR)/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 \
|
|
$(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 \
|
|
$(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
|