01474dc706
Use tools/build/ makefiles to build rtla, inheriting the benefits of it. For example, having a proper way to handle dependencies. rtla is built using perf infra-structure when building inside the kernel tree. At this point, rtla diverges from perf in two points: Documentation and tarball generation/build. At the documentation level, rtla is one step ahead, placing the documentation at Documentation/tools/rtla/, using the same build tools as kernel documentation. The idea is to move perf documentation to the same scheme and then share the same makefiles. rtla has a tarball target that the (old) RHEL8 uses. The tarball was kept using a simple standalone makefile for compatibility. The standalone makefile shares most of the code, e.g., flags, with regular buildings. The tarball method was set as deprecated. If necessary, we can make a rtla tarball like perf, which includes the entire tools/build. But this would also require changes in the user side (the directory structure changes, and probably the deps to build the package). Inspired on perf and objtool. Link: https://lkml.kernel.org/r/57563abf2715d22515c0c54a87cff3849eca5d52.1710519524.git.bristot@kernel.org Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Josh Poimboeuf <jpoimboe@kernel.org> Cc: John Kacur <jkacur@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
48 lines
1.3 KiB
Makefile
48 lines
1.3 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
STOP_ERROR :=
|
|
|
|
LIBTRACEEVENT_MIN_VERSION = 1.5
|
|
LIBTRACEFS_MIN_VERSION = 1.3
|
|
|
|
define lib_setup
|
|
$(eval LIB_INCLUDES += $(shell sh -c "$(PKG_CONFIG) --cflags lib$(1)"))
|
|
$(eval EXTLIBS += -l$(1))
|
|
endef
|
|
|
|
$(call feature_check,libtraceevent)
|
|
ifeq ($(feature-libtraceevent), 1)
|
|
$(call detected,CONFIG_LIBTRACEEVENT)
|
|
|
|
TEST = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 && echo y || echo n")
|
|
ifeq ($(TEST),n)
|
|
$(info libtraceevent version is too low, it must be at least $(LIBTRACEEVENT_MIN_VERSION))
|
|
STOP_ERROR := 1
|
|
endif
|
|
|
|
$(call lib_setup,traceevent)
|
|
else
|
|
STOP_ERROR := 1
|
|
$(info libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel)
|
|
endif
|
|
|
|
$(call feature_check,libtracefs)
|
|
ifeq ($(feature-libtracefs), 1)
|
|
$(call detected,CONFIG_LIBTRACEFS)
|
|
|
|
TEST = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 && echo y || echo n")
|
|
ifeq ($(TEST),n)
|
|
$(info libtracefs version is too low, it must be at least $(LIBTRACEFS_MIN_VERSION))
|
|
STOP_ERROR := 1
|
|
endif
|
|
|
|
$(call lib_setup,tracefs)
|
|
else
|
|
STOP_ERROR := 1
|
|
$(info libtracefs is missing. Please install libtracefs-dev/libtracefs-devel)
|
|
endif
|
|
|
|
ifeq ($(STOP_ERROR),1)
|
|
$(error Please, check the errors above.)
|
|
endif
|