diff options
Diffstat (limited to 'tools/perf/Makefile')
| -rw-r--r-- | tools/perf/Makefile | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 940257b5774e..3b8f7b80376b 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -52,7 +52,10 @@ ifeq ($(ARCH),i386) | |||
| 52 | endif | 52 | endif |
| 53 | ifeq ($(ARCH),x86_64) | 53 | ifeq ($(ARCH),x86_64) |
| 54 | ARCH := x86 | 54 | ARCH := x86 |
| 55 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) | 55 | IS_X86_64 := 0 |
| 56 | ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) | ||
| 57 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) | ||
| 58 | endif | ||
| 56 | ifeq (${IS_X86_64}, 1) | 59 | ifeq (${IS_X86_64}, 1) |
| 57 | RAW_ARCH := x86_64 | 60 | RAW_ARCH := x86_64 |
| 58 | ARCH_CFLAGS := -DARCH_X86_64 | 61 | ARCH_CFLAGS := -DARCH_X86_64 |
| @@ -178,9 +181,9 @@ strip-libs = $(filter-out -l%,$(1)) | |||
| 178 | 181 | ||
| 179 | $(OUTPUT)python/perf.so: $(PYRF_OBJS) | 182 | $(OUTPUT)python/perf.so: $(PYRF_OBJS) |
| 180 | $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ | 183 | $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ |
| 181 | --quiet build_ext \ | 184 | --quiet build_ext; \ |
| 182 | --build-lib='$(OUTPUT)python' \ | 185 | mkdir -p $(OUTPUT)python && \ |
| 183 | --build-temp='$(OUTPUT)python/temp' | 186 | cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/ |
| 184 | # | 187 | # |
| 185 | # No Perl scripts right now: | 188 | # No Perl scripts right now: |
| 186 | # | 189 | # |
| @@ -279,6 +282,7 @@ LIB_H += util/thread.h | |||
| 279 | LIB_H += util/thread_map.h | 282 | LIB_H += util/thread_map.h |
| 280 | LIB_H += util/trace-event.h | 283 | LIB_H += util/trace-event.h |
| 281 | LIB_H += util/probe-finder.h | 284 | LIB_H += util/probe-finder.h |
| 285 | LIB_H += util/dwarf-aux.h | ||
| 282 | LIB_H += util/probe-event.h | 286 | LIB_H += util/probe-event.h |
| 283 | LIB_H += util/pstack.h | 287 | LIB_H += util/pstack.h |
| 284 | LIB_H += util/cpumap.h | 288 | LIB_H += util/cpumap.h |
| @@ -435,6 +439,7 @@ else | |||
| 435 | BASIC_CFLAGS += -DDWARF_SUPPORT | 439 | BASIC_CFLAGS += -DDWARF_SUPPORT |
| 436 | EXTLIBS += -lelf -ldw | 440 | EXTLIBS += -lelf -ldw |
| 437 | LIB_OBJS += $(OUTPUT)util/probe-finder.o | 441 | LIB_OBJS += $(OUTPUT)util/probe-finder.o |
| 442 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o | ||
| 438 | endif # PERF_HAVE_DWARF_REGS | 443 | endif # PERF_HAVE_DWARF_REGS |
| 439 | endif # NO_DWARF | 444 | endif # NO_DWARF |
| 440 | 445 | ||
| @@ -504,9 +509,13 @@ else | |||
| 504 | 509 | ||
| 505 | PYTHON_WORD := $(call shell-wordify,$(PYTHON)) | 510 | PYTHON_WORD := $(call shell-wordify,$(PYTHON)) |
| 506 | 511 | ||
| 507 | python-clean := $(PYTHON_WORD) util/setup.py clean \ | 512 | # python extension build directories |
| 508 | --build-lib='$(OUTPUT)python' \ | 513 | PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ |
| 509 | --build-temp='$(OUTPUT)python/temp' | 514 | PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/ |
| 515 | PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/ | ||
| 516 | export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP | ||
| 517 | |||
| 518 | python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so | ||
| 510 | 519 | ||
| 511 | ifdef NO_LIBPYTHON | 520 | ifdef NO_LIBPYTHON |
| 512 | $(call disable-python) | 521 | $(call disable-python) |
| @@ -863,6 +872,9 @@ install: all | |||
| 863 | $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python' | 872 | $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python' |
| 864 | $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' | 873 | $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' |
| 865 | 874 | ||
| 875 | install-python_ext: | ||
| 876 | $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' | ||
| 877 | |||
| 866 | install-doc: | 878 | install-doc: |
| 867 | $(MAKE) -C Documentation install | 879 | $(MAKE) -C Documentation install |
| 868 | 880 | ||
| @@ -890,7 +902,7 @@ quick-install-html: | |||
| 890 | ### Cleaning rules | 902 | ### Cleaning rules |
| 891 | 903 | ||
| 892 | clean: | 904 | clean: |
| 893 | $(RM) $(OUTPUT){*.o,*/*.o,*/*/*.o,*/*/*/*.o,$(LIB_FILE),perf-archive} | 905 | $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) |
| 894 | $(RM) $(ALL_PROGRAMS) perf | 906 | $(RM) $(ALL_PROGRAMS) perf |
| 895 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* | 907 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* |
| 896 | $(MAKE) -C Documentation/ clean | 908 | $(MAKE) -C Documentation/ clean |
