Commit 554aca50 authored by Anton Midyukov's avatar Anton Midyukov

profile.mk: do not cleanup BUILDDIR, which is a symlink

This is required to run mkimage-profiles from mki-build with --vm-run. mki-build creates a build directory and a symlink to it in the current directory. The BUILDDIR variable is then set to the value of the symlink.
parent b5198e47
......@@ -33,7 +33,7 @@ RC = $(HOME)/.mkimage/profiles.mk
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
# NB: our output MUST go into stderr to escape POSTPROC
profile/init: distclean
profile/init: $(shell [ -L $(BUILDDIR) ] || echo distclean)
@{ \
if [ "`realpath "$(BUILDDIR)/"`" = / ]; then \
echo "$(TIME) ERROR: invalid BUILDDIR: \`$(BUILDDIR)'"; \
......@@ -75,7 +75,7 @@ profile/init: distclean
git show -s --format=%H > "$(BUILDDIR)"/commit; \
fi; \
mp-commit -i "$(BUILDDIR)" "derivative profile initialized"; \
if [ -w . ]; then \
if [ -w . -a ! -L "$(BUILDDIR)" ]; then \
rm -f "$(SYMLINK)" && \
ln -s "$(BUILDDIR)" "$(SYMLINK)" && \
if [ -z "$(QUIET)" ]; then \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment