diff mbox series

[v2,2/2] build: omit "source" symlink when building hypervisor in-tree

Message ID 0d073a56-b3a0-a64d-6bf4-851c660c6155@suse.com (mailing list archive)
State New, archived
Headers show
Series build: out-of-tree building adjustments | expand

Commit Message

Jan Beulich March 29, 2023, 10:23 a.m. UTC
This symlink is getting in the way of using e.g. "find" on the xen/
subtree, and it isn't really needed when not building out-of-tree:
The one use that there was can easily be avoided.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Anthony PERARD May 4, 2023, 2:52 p.m. UTC | #1
On Wed, Mar 29, 2023 at 12:23:37PM +0200, Jan Beulich wrote:
> This symlink is getting in the way of using e.g. "find" on the xen/
> subtree, and it isn't really needed when not building out-of-tree:
> The one use that there was can easily be avoided.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,
diff mbox series

Patch

--- a/.gitignore
+++ b/.gitignore
@@ -295,7 +295,6 @@  xen/include/xen/acm_policy.h
 xen/include/xen/compile.h
 xen/include/xen/hypercall-defs.h
 xen/include/xen/lib/x86/cpuid-autogen.h
-xen/source
 xen/test/livepatch/config.h
 xen/test/livepatch/expect_config.h
 xen/test/livepatch/*.livepatch
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -310,7 +310,6 @@  cmd_makefile = { \
     } > Makefile
 
 outputmakefile:
-	$(Q)ln -fsn $(srctree) source
 ifdef building_out_of_srctree
 	$(Q)if [ -f $(srctree)/.config -o \
 		 -d $(srctree)/include/config -o \
@@ -321,6 +320,7 @@  ifdef building_out_of_srctree
 		echo >&2 "***"; \
 		false; \
 	fi
+	$(Q)ln -fsn $(srctree) source
 	$(call cmd,makefile)
 	$(Q)test -e .gitignore || \
 	{ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
--- a/xen/common/efi/efi-common.mk
+++ b/xen/common/efi/efi-common.mk
@@ -5,11 +5,16 @@  CFLAGS-y += -fshort-wchar
 CFLAGS-y += -iquote $(srctree)/common/efi
 CFLAGS-y += -iquote $(srcdir)
 
+source :=
+ifneq ($(abs_objtree),$(abs_srctree))
+source := source/
+endif
+
 # Part of the command line transforms $(obj)
 # e.g.: It transforms "dir/foo/bar" into successively
 #       "dir foo bar", ".. .. ..", "../../.."
 $(obj)/%.c: $(srctree)/common/efi/%.c FORCE
-	$(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, ,$(obj))))/source/common/efi/$(<F) $@
+	$(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, ,$(obj))))/$(source)common/efi/$(<F) $@
 
 clean-files += $(patsubst %.o, %.c, $(EFIOBJ-y:.init.o=.o) $(EFIOBJ-))
 clean-files += common-stub.c