c2f70e5c10
- image.in/functions.mk: rework kpackage() + it takes two arguments explicitly now: this adds some noise for "generic" invocations but is rather less messy with recently introduced STAGE1_KFLAVOUR (which in its turn is rather cleaner than messing with KFLAVOURS, especially since soemthing changed in presumably apt and we can't rely on kernel packages being installed in the order formed). - BUILDDIR/DEBUG related fixes + Makefile: BUILDDIR initialization moved to distro.mk - build.log += git info
46 lines
1.2 KiB
Makefile
46 lines
1.2 KiB
Makefile
# this makefile is designed to be included in toplevel one
|
|
|
|
# this could have come from environment;
|
|
# if not, can be symlinked if r/w, or made anew
|
|
# NB: immediate assignment
|
|
ifndef BUILDDIR
|
|
BUILDDIR := $(shell [ -s build ] \
|
|
&& realpath build \
|
|
|| bin/mktmpdir mkimage-profiles.build)
|
|
endif
|
|
|
|
# even smart caching only hurts when every build goes from scratch
|
|
NO_CACHE ?= 1
|
|
|
|
export BUILDDIR NO_CACHE
|
|
|
|
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
|
|
profile/init: distclean
|
|
@echo -n "** initializing BUILDDIR: "
|
|
@rsync -qaH --delete image.in/ "$(BUILDDIR)"/
|
|
@:> "$(BUILDDIR)"/distcfg.mk
|
|
@{ \
|
|
git show-ref --head -d -s -- HEAD && \
|
|
git status -s && \
|
|
echo; \
|
|
} 2>/dev/null >> "$(BUILDLOG)"
|
|
@mkdir "$(BUILDDIR)"/.mki # mkimage toplevel marker
|
|
@type -t git >&/dev/null && \
|
|
cd $(BUILDDIR) && \
|
|
git init -q && \
|
|
git add . && \
|
|
git commit -qam 'init'
|
|
@rm -f build && \
|
|
if [ -w . ]; then \
|
|
ln -sf "$(BUILDDIR)" build && \
|
|
echo "build/"; \
|
|
else \
|
|
echo "$(BUILDDIR)/"; \
|
|
fi
|
|
|
|
# step 3 entry point: copy the needed parts into BUILDDIR
|
|
profile/populate: profile/init distro/.rc
|
|
@for dir in sub.in features.in pkg.in; do \
|
|
$(MAKE) -C $$dir $(LOG); \
|
|
done
|