aimee-os/Makefile

131 lines
2.7 KiB
Makefile

O ?= .
IMAGESDIR ?= $(O)/images
CONFIGDIR ?= .
export CONFIGDIR
update.tar: $(IMAGESDIR)/update.tar.zstd
$(O)/portage/.stamp: \
$(shell find portage -type f) \
$(shell find $(CONFIGDIR)/portage -type f)
rm -rf $(O)/portage
mkdir -p $(O)/portage/etc/portage
tar -C portage -c . | tar -C $(O)/portage/etc/portage -x
tar -C $(CONFIGDIR)/portage -c . | tar -C $(O)/portage/etc/portage -x
touch $@
portage: $(O)/portage/.stamp
$(O)/.prepared: \
$(O)/portage/.stamp \
prepare.sh \
setup-local-repo.sh
./prepare.sh
./setup-local-repo.sh
mkdir -p $(O)
touch $(O)/.prepared
prepare: $(O)/.prepared
$(O)/.built: \
build.sh \
build.packages \
install.packages \
$(wildcard $(CONFIGDIR)/build.packages) \
$(CONFIGDIR)/install.packages \
$(O)/portage/.stamp \
$(O)/.prepared
./build.sh
touch $(O)/.built
build: $(O)/.built
$(O)/semanage.mods: \
semanage.mods \
$(wildcard $(CONFIGDIR)/semanage.mods)
cat $^ > $@
$(O)/.ready: \
build-rootfs.sh \
install.packages \
$(CONFIGDIR)/install.packages \
$(wildcard $(CONFIGDIR)/installonly.packages) \
$(wildcard $(CONFIGDIR)/busybox.symlinks) \
$(O)/linux/arch/arm64/boot/Image.gz \
$(O)/semanage.mods \
$(shell find overlay -type f) \
$(shell find $(CONFIGDIR)/overlay -type f 2>/dev/null) \
$(O)/.built
./build-rootfs.sh "$(O)"
touch $(O)/.ready
$(O)/squashfs.exclude: \
squashfs.exclude \
$(shell test -f $(CONFIGDIR)/squashfs.exclude && echo $(CONFIGDIR)/squashfs.exclude)
mkdir -p $(O)
sort $^ > $@
$(O)/squashfs.pseudo: \
$(wildcard $(CONFIGDIR)/squashfs.pseudo)
sort /dev/null $^ > $@
$(IMAGESDIR)/rootfs.squashfs: \
build-squashfs.sh \
$(O)/squashfs.exclude \
$(O)/squashfs.pseudo \
$(O)/.ready
./build-squashfs.sh "$(O)" "$(IMAGESDIR)"
squashfs: $(IMAGESDIR)/rootfs.squashfs
$(O)/linux/arch/arm64/boot/Image.gz: \
build-kernel.sh \
$(CONFIGDIR)/linux.config \
$(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)/.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 \
$(IMAGESDIR)/rootfs.squashfs
./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)/.prepared
./build-update.sh "$(IMAGESDIR)"
clean:
rm -rf $(O)/linux $(O)/output $(IMAGESDIR) $(O)/tmp
rm -f $(O)/.prepared
.PHONY: \
build \
grub \
kernel \
portage \
prepare \
sdcard.img \
squashfs \
update.tar