blob: 2fc2ab7c7e3ac13995f14752e04903600c4206ed [file] [log] [blame]
From df15bbe2af8d40ae004410642cf07df677dabdff Mon Sep 17 00:00:00 2001
From: Sudip Mukherjee <>
Date: Fri, 15 Nov 2019 11:36:09 +0000
Subject: [PATCH] libtraceevent: Fix lib installation with O=
commit 587db8ebdac2c5eb3a8851e16b26f2e2711ab797 upstream.
When we use 'O=' with make to build libtraceevent in a separate folder
it fails to install libtraceevent.a and with the
INSTALL /home/sudip/linux/obj-trace/libtraceevent.a
INSTALL /home/sudip/linux/obj-trace/
cp: cannot stat 'libtraceevent.a': No such file or directory
Makefile:225: recipe for target 'install_lib' failed
make: *** [install_lib] Error 1
I used the command:
make O=../../../obj-trace DESTDIR=~/test prefix==/usr install
It turns out libtraceevent Makefile, even though it builds in a separate
folder, searches for libtraceevent.a and in its
source folder.
So, add the 'OUTPUT' prefix to the source path so that 'make' looks for
the files in the correct place.
Signed-off-by: Sudipm Mukherjee <>
Reviewed-by: Steven Rostedt (VMware) <>
Signed-off-by: Arnaldo Carvalho de Melo <>
Signed-off-by: Paul Gortmaker <>
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index a39cdd0d890d..c1a6a5748fe4 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
LIB_INSTALL = libtraceevent.a*
+LIB_INSTALL := $(addprefix $(OUTPUT),$(LIB_INSTALL))
INCLUDES = -I. -I $(srctree)/tools/include $(CONFIG_INCLUDES)