diff options
| -rw-r--r-- | tools/perf/Documentation/Makefile | 2 | ||||
| -rw-r--r-- | tools/perf/Makefile | 28 |
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 | ||
| 225 | ifneq ($(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 |
| 230 | endif | ||
| 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.. |
| 154 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ | 154 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
| 155 | 155 | ||
| 156 | ifneq ($(MAKECMDGOALS),clean) | ||
| 156 | -include config/feature-tests.mak | 157 | -include config/feature-tests.mak |
| 157 | 158 | ||
| 158 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) | 159 | ifeq ($(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. |
| 208 | endif | 209 | endif |
| 210 | endif # MAKECMDGOALS != clean | ||
| 209 | 211 | ||
| 210 | # Guard against environment variables | 212 | # Guard against environment variables |
| 211 | BUILTIN_OBJS = | 213 | BUILTIN_OBJS = |
| @@ -230,11 +232,19 @@ endif | |||
| 230 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a | 232 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a |
| 231 | TE_LIB := -L$(TE_PATH) -ltraceevent | 233 | TE_LIB := -L$(TE_PATH) -ltraceevent |
| 232 | 234 | ||
| 235 | export LIBTRACEEVENT | ||
| 236 | |||
| 237 | # python extension build directories | ||
| 238 | PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ | ||
| 239 | PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/ | ||
| 240 | PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/ | ||
| 241 | export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP | ||
| 242 | |||
| 243 | python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so | ||
| 244 | |||
| 233 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) | 245 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) |
| 234 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py | 246 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py |
| 235 | 247 | ||
| 236 | export 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 | # |
| 527 | ifneq ($(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)) | |||
| 703 | define disable-python_code | 714 | define 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) |
| 707 | endef | 718 | endef |
| 708 | 719 | ||
| 709 | override PYTHON := \ | 720 | override PYTHON := \ |
| @@ -711,19 +722,10 @@ override PYTHON := \ | |||
| 711 | 722 | ||
| 712 | ifndef PYTHON | 723 | ifndef PYTHON |
| 713 | $(call disable-python,python interpreter) | 724 | $(call disable-python,python interpreter) |
| 714 | python-clean := | ||
| 715 | else | 725 | else |
| 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 |
| 840 | endif | 842 | endif |
| 841 | 843 | ||
| 844 | endif # 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 | ||
| 844 | ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG)) | 848 | ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG)) |
