Commit 746bd29e authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf build: Use tools/lib headers from install path

Switch -I from tools/lib to the install path for the tools/lib
libraries. Add the include_headers build targets to prepare target, as
well as pmu-events.c compilation that dependes on libperf.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: bpf@vger.kernel.org
Link: http://lore.kernel.org/lkml/20221109184914.1357295-15-irogers@google.com
Link: http://lore.kernel.org/lkml/20221116072211.2837834-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c4d9d95f
...@@ -349,7 +349,6 @@ ifeq ($(DEBUG),0) ...@@ -349,7 +349,6 @@ ifeq ($(DEBUG),0)
endif endif
endif endif
INC_FLAGS += -I$(srctree)/tools/lib/perf/include
INC_FLAGS += -I$(src-perf)/util/include INC_FLAGS += -I$(src-perf)/util/include
INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
INC_FLAGS += -I$(srctree)/tools/include/ INC_FLAGS += -I$(srctree)/tools/include/
...@@ -367,7 +366,6 @@ endif ...@@ -367,7 +366,6 @@ endif
INC_FLAGS += -I$(src-perf)/util INC_FLAGS += -I$(src-perf)/util
INC_FLAGS += -I$(src-perf) INC_FLAGS += -I$(src-perf)
INC_FLAGS += -I$(srctree)/tools/lib/
CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
......
...@@ -305,6 +305,7 @@ LIBTRACEEVENT_INCLUDE = $(LIBTRACEEVENT_DESTDIR)/include ...@@ -305,6 +305,7 @@ LIBTRACEEVENT_INCLUDE = $(LIBTRACEEVENT_DESTDIR)/include
LIBTRACEEVENT = $(LIBTRACEEVENT_OUTPUT)/libtraceevent.a LIBTRACEEVENT = $(LIBTRACEEVENT_OUTPUT)/libtraceevent.a
export LIBTRACEEVENT export LIBTRACEEVENT
LIBTRACEEVENT_DYNAMIC_LIST = $(LIBTRACEEVENT_PLUGINS_OUTPUT)/libtraceevent-dynamic-list LIBTRACEEVENT_DYNAMIC_LIST = $(LIBTRACEEVENT_PLUGINS_OUTPUT)/libtraceevent-dynamic-list
CFLAGS += -I$(LIBTRACEEVENT_OUTPUT)/include
# #
# The static build has no dynsym table, so this does not work for # The static build has no dynsym table, so this does not work for
...@@ -322,6 +323,7 @@ LIBAPI_DESTDIR = $(LIBAPI_OUTPUT) ...@@ -322,6 +323,7 @@ LIBAPI_DESTDIR = $(LIBAPI_OUTPUT)
LIBAPI_INCLUDE = $(LIBAPI_DESTDIR)/include LIBAPI_INCLUDE = $(LIBAPI_DESTDIR)/include
LIBAPI = $(LIBAPI_OUTPUT)/libapi.a LIBAPI = $(LIBAPI_OUTPUT)/libapi.a
export LIBAPI export LIBAPI
CFLAGS += -I$(LIBAPI_OUTPUT)/include
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
LIBBPF_OUTPUT = $(abspath $(OUTPUT))/libbpf LIBBPF_OUTPUT = $(abspath $(OUTPUT))/libbpf
...@@ -331,6 +333,7 @@ endif ...@@ -331,6 +333,7 @@ endif
LIBBPF_DESTDIR = $(LIBBPF_OUTPUT) LIBBPF_DESTDIR = $(LIBBPF_OUTPUT)
LIBBPF_INCLUDE = $(LIBBPF_DESTDIR)/include LIBBPF_INCLUDE = $(LIBBPF_DESTDIR)/include
LIBBPF = $(LIBBPF_OUTPUT)/libbpf.a LIBBPF = $(LIBBPF_OUTPUT)/libbpf.a
CFLAGS += -I$(LIBBPF_OUTPUT)/include
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd
...@@ -340,6 +343,7 @@ endif ...@@ -340,6 +343,7 @@ endif
LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT) LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT)
LIBSUBCMD_INCLUDE = $(LIBSUBCMD_DESTDIR)/include LIBSUBCMD_INCLUDE = $(LIBSUBCMD_DESTDIR)/include
LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a
CFLAGS += -I$(LIBSUBCMD_OUTPUT)/include
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
LIBSYMBOL_OUTPUT = $(abspath $(OUTPUT))/libsymbol LIBSYMBOL_OUTPUT = $(abspath $(OUTPUT))/libsymbol
...@@ -349,6 +353,7 @@ endif ...@@ -349,6 +353,7 @@ endif
LIBSYMBOL_DESTDIR = $(LIBSYMBOL_OUTPUT) LIBSYMBOL_DESTDIR = $(LIBSYMBOL_OUTPUT)
LIBSYMBOL_INCLUDE = $(LIBSYMBOL_DESTDIR)/include LIBSYMBOL_INCLUDE = $(LIBSYMBOL_DESTDIR)/include
LIBSYMBOL = $(LIBSYMBOL_OUTPUT)/libsymbol.a LIBSYMBOL = $(LIBSYMBOL_OUTPUT)/libsymbol.a
CFLAGS += -I$(LIBSYMBOL_OUTPUT)/include
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
LIBPERF_OUTPUT = $(abspath $(OUTPUT))/libperf LIBPERF_OUTPUT = $(abspath $(OUTPUT))/libperf
...@@ -359,6 +364,7 @@ LIBPERF_DESTDIR = $(LIBPERF_OUTPUT) ...@@ -359,6 +364,7 @@ LIBPERF_DESTDIR = $(LIBPERF_OUTPUT)
LIBPERF_INCLUDE = $(LIBPERF_DESTDIR)/include LIBPERF_INCLUDE = $(LIBPERF_DESTDIR)/include
LIBPERF = $(LIBPERF_OUTPUT)/libperf.a LIBPERF = $(LIBPERF_OUTPUT)/libperf.a
export LIBPERF export LIBPERF
CFLAGS += -I$(LIBPERF_OUTPUT)/include
# python extension build directories # python extension build directories
PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
...@@ -691,14 +697,14 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj ...@@ -691,14 +697,14 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj
$(PERF_IN): prepare FORCE $(PERF_IN): prepare FORCE
$(Q)$(MAKE) $(build)=perf $(Q)$(MAKE) $(build)=perf
$(PMU_EVENTS_IN): FORCE $(PMU_EVENTS_IN): FORCE prepare
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \ $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@ $(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
$(GTK_IN): FORCE $(GTK_IN): FORCE prepare
$(Q)$(MAKE) $(build)=gtk $(Q)$(MAKE) $(build)=gtk
$(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS) $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
...@@ -774,6 +780,12 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc ...@@ -774,6 +780,12 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc
$(rename_flags_array) \ $(rename_flags_array) \
$(arch_errno_name_array) \ $(arch_errno_name_array) \
$(sync_file_range_arrays) \ $(sync_file_range_arrays) \
$(LIBAPI) \
$(LIBBPF) \
$(LIBPERF) \
$(LIBSUBCMD) \
$(LIBSYMBOL) \
$(LIBTRACEEVENT) \
bpf-skel bpf-skel
$(OUTPUT)%.o: %.c prepare FORCE $(OUTPUT)%.o: %.c prepare FORCE
......
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