qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ideas towards requiring VPATH build


From: Eric Blake
Subject: ideas towards requiring VPATH build
Date: Fri, 11 Oct 2019 16:28:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0

I know we've talked about enforcing a VPATH build, but haven't yet flipped the switch. This week, I've played with using a VPATH build (cd qemu; mkdir -p build; cd ./build; ../configure ...; make ...), but find my old habits of expecting an in-tree build to just work (cd qemu; make ...) hard to overcome. So this is what I've come up with: if you place the following file in-tree, then any 'make ...' command you type in-tree without using -C will have the same effect as if you had typed the same command in the build directory, but without having to manually remember to switch to the build directory.

Perhaps this can be a starting point for a patch to actually include this file in qemu.git as part of the larger effort to force VPATH builds, while still having the convenience of in-tree make working for those who were used to it. (I places an echo and sleep in my file to remind myself when I forgot to use the build directory, but that is not mandatory if we want GNUmakefile stored in qemu.git).

Presumably, any full switch to force a VPATH build would also include creating the build directory as needed (my hack assumes that it already exists).

$ cat GNUmakefile
# Hack for redirecting while reminding myself to use distinct builddir
%: force
        @echo 'changing directory to build...'
        @sleep 2
        @$(MAKE) -C build -f Makefile $(MAKECMDGOALS)
force: ;
GNUmakefile: ;

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]