Bladeren bron

perf tools: Don't check configuration on make clean

Current perf build process checks various system configuration on
invocation to make.  But this is not needed just for cleaning.

To do that, move some of python related variables out of conditional
since 'clean' target needs them.  Normal path should not be affected by
this.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1352867990-658-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Namhyung Kim 12 jaren geleden
bovenliggende
commit
3cde41b0d6
2 gewijzigde bestanden met toevoegingen van 18 en 12 verwijderingen
  1. 2 0
      tools/perf/Documentation/Makefile
  2. 16 12
      tools/perf/Makefile

+ 2 - 0
tools/perf/Documentation/Makefile

@@ -222,10 +222,12 @@ install-pdf: pdf
 #install-html: html
 #install-html: html
 #	'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
 #	'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
 
 
+ifneq ($(MAKECMDGOALS),clean)
 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
 	$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) $(OUTPUT)PERF-VERSION-FILE
 	$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) $(OUTPUT)PERF-VERSION-FILE
 
 
 -include $(OUTPUT)PERF-VERSION-FILE
 -include $(OUTPUT)PERF-VERSION-FILE
+endif
 
 
 #
 #
 # Determine "include::" file references in asciidoc files.
 # Determine "include::" file references in asciidoc files.

+ 16 - 12
tools/perf/Makefile

@@ -153,6 +153,7 @@ INSTALL = install
 # explicitly what architecture to check for. Fix this up for yours..
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
 
+ifneq ($(MAKECMDGOALS),clean)
 -include config/feature-tests.mak
 -include config/feature-tests.mak
 
 
 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y)
 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)
 	EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
 	EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
 	BASIC_CFLAGS += -I.
 	BASIC_CFLAGS += -I.
 endif
 endif
+endif # MAKECMDGOALS != clean
 
 
 # Guard against environment variables
 # Guard against environment variables
 BUILTIN_OBJS =
 BUILTIN_OBJS =
@@ -230,11 +232,19 @@ endif
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
 TE_LIB := -L$(TE_PATH) -ltraceevent
 TE_LIB := -L$(TE_PATH) -ltraceevent
 
 
+export LIBTRACEEVENT
+
+# python extension build directories
+PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
+PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
+PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
+export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
+
+python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
+
 PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
 PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py
 
 
-export LIBTRACEEVENT
-
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
 	$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
 	$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
 	  --quiet build_ext; \
 	  --quiet build_ext; \
@@ -514,6 +524,7 @@ PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT)
 #
 #
 # Platform specific tweaks
 # Platform specific tweaks
 #
 #
+ifneq ($(MAKECMDGOALS),clean)
 
 
 # We choose to avoid "if .. else if .. else .. endif endif"
 # We choose to avoid "if .. else if .. else .. endif endif"
 # because maintaining the nesting to match is a pain.  If
 # because maintaining the nesting to match is a pain.  If
@@ -703,7 +714,7 @@ disable-python = $(eval $(disable-python_code))
 define disable-python_code
 define disable-python_code
   BASIC_CFLAGS += -DNO_LIBPYTHON
   BASIC_CFLAGS += -DNO_LIBPYTHON
   $(if $(1),$(warning No $(1) was found))
   $(if $(1),$(warning No $(1) was found))
-  $(warning Python support won't be built)
+  $(warning Python support will not be built)
 endef
 endef
 
 
 override PYTHON := \
 override PYTHON := \
@@ -711,19 +722,10 @@ override PYTHON := \
 
 
 ifndef PYTHON
 ifndef PYTHON
   $(call disable-python,python interpreter)
   $(call disable-python,python interpreter)
-  python-clean :=
 else
 else
 
 
   PYTHON_WORD := $(call shell-wordify,$(PYTHON))
   PYTHON_WORD := $(call shell-wordify,$(PYTHON))
 
 
-  # python extension build directories
-  PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
-  PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
-  PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
-  export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
-
-  python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
-
   ifdef NO_LIBPYTHON
   ifdef NO_LIBPYTHON
     $(call disable-python)
     $(call disable-python)
   else
   else
@@ -839,6 +841,8 @@ ifdef ASCIIDOC8
 	export ASCIIDOC8
 	export ASCIIDOC8
 endif
 endif
 
 
+endif # MAKECMDGOALS != clean
+
 # Shell quote (do not use $(call) to accommodate ancient setups);
 # Shell quote (do not use $(call) to accommodate ancient setups);
 
 
 ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
 ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))