[Swan-dev] Append .kvm to OBJDIR when a KVM build

Andrew Cagney andrew.cagney at gmail.com
Wed Mar 11 17:46:12 EET 2015

Another of my local tweaks.

Currently,  a VM build (swan-build) unhelpfully deletes all OBJ.linux.*
directories.  This, of course, includes any native build you've been
doing.  I'd like to tweak things so that:

- on the VM OBJDIR has .kvm (.vm?) appended so VM and host builds use
different directories
- swan-build, which should only be run on a VM,  deletes OBJ.linix*.vm
(yes it should rely on "make distclean" but that's another story)

Since the VM has its own private build directory this also gets us that bit
closer to not even needing the delete.

I've appended the key part of the patch.  The magic grep line matches what
virt-what does.


diff --git a/mk/objdir.mk b/mk/objdir.mk
index f86c9db..a581319 100644
--- a/mk/objdir.mk
+++ b/mk/objdir.mk
@@ -56,4 +56,8 @@ BUILDENV:=$(shell uname -s | tr 'A-Z' 'a-z' | sed -e
 export BUILDENV

+ifeq ($(origin OBJDIR_KVM),undefined)
+OBJDIR_KVM:=$(shell grep -i QEMU /proc/cpuinfo >/dev/null 2>&1 && echo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20150311/f2ad7584/attachment.html>

More information about the Swan-dev mailing list