aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Documentation/Makefile2
-rw-r--r--tools/perf/Makefile28
2 files changed, 18 insertions, 12 deletions
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index ef6d22e879eb..f6e5901c8f5f 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -222,10 +222,12 @@ install-pdf: pdf
222#install-html: html 222#install-html: html
223# '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir) 223# '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
224 224
225ifneq ($(MAKECMDGOALS),clean)
225$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE 226$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
226 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) $(OUTPUT)PERF-VERSION-FILE 227 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) $(OUTPUT)PERF-VERSION-FILE
227 228
228-include $(OUTPUT)PERF-VERSION-FILE 229-include $(OUTPUT)PERF-VERSION-FILE
230endif
229 231
230# 232#
231# Determine "include::" file references in asciidoc files. 233# Determine "include::" file references in asciidoc files.
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 8fca560cf78e..08da9fc616c4 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -153,6 +153,7 @@ INSTALL = install
153# explicitly what architecture to check for. Fix this up for yours.. 153# explicitly what architecture to check for. Fix this up for yours..
154SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ 154SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
155 155
156ifneq ($(MAKECMDGOALS),clean)
156-include config/feature-tests.mak 157-include config/feature-tests.mak
157 158
158ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) 159ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y)
@@ -206,6 +207,7 @@ ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
206 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) 207 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
207 BASIC_CFLAGS += -I. 208 BASIC_CFLAGS += -I.
208endif 209endif
210endif # MAKECMDGOALS != clean
209 211
210# Guard against environment variables 212# Guard against environment variables
211BUILTIN_OBJS = 213BUILTIN_OBJS =
@@ -230,11 +232,19 @@ endif
230LIBTRACEEVENT = $(TE_PATH)libtraceevent.a 232LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
231TE_LIB := -L$(TE_PATH) -ltraceevent 233TE_LIB := -L$(TE_PATH) -ltraceevent
232 234
235export LIBTRACEEVENT
236
237# python extension build directories
238PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
239PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
240PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
241export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
242
243python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
244
233PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) 245PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
234PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py 246PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py
235 247
236export LIBTRACEEVENT
237
238$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) 248$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
239 $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ 249 $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
240 --quiet build_ext; \ 250 --quiet build_ext; \
@@ -514,6 +524,7 @@ PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT)
514# 524#
515# Platform specific tweaks 525# Platform specific tweaks
516# 526#
527ifneq ($(MAKECMDGOALS),clean)
517 528
518# We choose to avoid "if .. else if .. else .. endif endif" 529# We choose to avoid "if .. else if .. else .. endif endif"
519# because maintaining the nesting to match is a pain. If 530# because maintaining the nesting to match is a pain. If
@@ -703,7 +714,7 @@ disable-python = $(eval $(disable-python_code))
703define disable-python_code 714define disable-python_code
704 BASIC_CFLAGS += -DNO_LIBPYTHON 715 BASIC_CFLAGS += -DNO_LIBPYTHON
705 $(if $(1),$(warning No $(1) was found)) 716 $(if $(1),$(warning No $(1) was found))
706 $(warning Python support won't be built) 717 $(warning Python support will not be built)
707endef 718endef
708 719
709override PYTHON := \ 720override PYTHON := \
@@ -711,19 +722,10 @@ override PYTHON := \
711 722
712ifndef PYTHON 723ifndef PYTHON
713 $(call disable-python,python interpreter) 724 $(call disable-python,python interpreter)
714 python-clean :=
715else 725else
716 726
717 PYTHON_WORD := $(call shell-wordify,$(PYTHON)) 727 PYTHON_WORD := $(call shell-wordify,$(PYTHON))
718 728
719 # python extension build directories
720 PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
721 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
722 PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
723 export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
724
725 python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
726
727 ifdef NO_LIBPYTHON 729 ifdef NO_LIBPYTHON
728 $(call disable-python) 730 $(call disable-python)
729 else 731 else
@@ -839,6 +841,8 @@ ifdef ASCIIDOC8
839 export ASCIIDOC8 841 export ASCIIDOC8
840endif 842endif
841 843
844endif # MAKECMDGOALS != clean
845
842# Shell quote (do not use $(call) to accommodate ancient setups); 846# Shell quote (do not use $(call) to accommodate ancient setups);
843 847
844ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG)) 848ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))