5f88152223
In particular: - .base is now generated from pieces (see image.in/Makefile) - s/DISTROS/IMAGES/g; s/CONFIGS/DISTROS/g (for clarity) - s/DISK_LISTS/MAIN_LISTS/g ("disk" was early m-p-d legacy) - introduced BASE_PACKAGES to complement BASE_LISTS - minor tweaks to Makefile (ARCH and DATE moved elsewhere) - libdistro.mk: dropped overlooked IMAGE_INIT_LIST copy - clean.mk: silly cleanup
46 lines
1.5 KiB
Makefile
46 lines
1.5 KiB
Makefile
# steps to build a distribution image:
|
|
# --- here
|
|
# 1. initialize new profile (BUILDDIR) as a copy of image.in/
|
|
# 2. configure distro
|
|
# 3. copy subprofiles, script hooks, and package lists/groups
|
|
# from metaprofile to new profile (as needed)
|
|
# --- in BUILDDIR
|
|
# 4. build subprofiles and subsequently the image
|
|
|
|
all help:
|
|
@echo '** available distribution targets:'
|
|
@echo $(IMAGES) | fmt -sw"$$((COLUMNS>>1))" | column -t
|
|
|
|
# most of the actual work done elsewhere
|
|
include clean.mk
|
|
include profile.mk
|
|
include distro.mk
|
|
include log.mk
|
|
include iso.mk
|
|
|
|
# we can't use implicit rules for top-level targets, only for prereqs
|
|
# NB: what about static pattern rules?
|
|
# TODO: move into libdistro?
|
|
DISTROS := $(shell sed -n 's,^distro/\([^:.]\+\):.*$$,\1,p' distro.mk)
|
|
IMAGES := $(addsuffix .iso,$(DISTROS))
|
|
|
|
# to be passed into distcfg.mk
|
|
IMAGEDIR ?= $(shell [ -d "$$HOME/out" -a -w "$$HOME/out" ] \
|
|
&& echo "$$HOME/out" \
|
|
|| echo "$(BUILDDIR)/out" )
|
|
IMAGENAME ?= mkimage-profiles-$(ARCH).iso
|
|
|
|
$(IMAGES): %.iso: | profile/init distro/% boot/isolinux profile/populate iso
|
|
@# TODO: run automated tests (e.g. iso size)
|
|
@OUTNAME="$(@:.iso=)-$(DATE)-$(ARCH).iso"; \
|
|
OUTPATH="$(IMAGEDIR)/$$OUTNAME"; \
|
|
test -s "$(IMAGEDIR)/$(IMAGENAME)" && \
|
|
mv "$(IMAGEDIR)/$(IMAGENAME)" "$$OUTPATH" && \
|
|
echo "** image: $$OUTPATH" && \
|
|
ln -sf "$$OUTNAME" "$(IMAGEDIR)/$@" && \
|
|
ln -sf "$@" "$(IMAGEDIR)/mkimage-profiles.iso"; \
|
|
if [ -n "$(DEBUG)" ]; then \
|
|
cp -a "$(BUILDLOG)" "$$OUTPATH.log"; \
|
|
cp -a "$(CONFIG)" "$$OUTPATH.cfg"; \
|
|
fi
|