diff options
-rw-r--r-- | tools/perf/Makefile | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 64c043b7a438..6b5452a120af 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -70,8 +70,9 @@ ifneq ($(OUTPUT),) | |||
70 | #$(info Determined 'OUTPUT' to be $(OUTPUT)) | 70 | #$(info Determined 'OUTPUT' to be $(OUTPUT)) |
71 | endif | 71 | endif |
72 | 72 | ||
73 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE | 73 | $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD |
74 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) | 74 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
75 | @touch $(OUTPUT)PERF-VERSION-FILE | ||
75 | 76 | ||
76 | CC = $(CROSS_COMPILE)gcc | 77 | CC = $(CROSS_COMPILE)gcc |
77 | AR = $(CROSS_COMPILE)ar | 78 | AR = $(CROSS_COMPILE)ar |
@@ -814,6 +815,16 @@ clean: $(LIBTRACEEVENT)-clean $(LIBLK)-clean | |||
814 | $(RM) $(OUTPUT)util/*-flex* | 815 | $(RM) $(OUTPUT)util/*-flex* |
815 | $(python-clean) | 816 | $(python-clean) |
816 | 817 | ||
818 | # | ||
819 | # Trick: if ../../.git does not exist - we are building out of tree for example, | ||
820 | # then force version regeneration: | ||
821 | # | ||
822 | ifeq ($(wildcard ../../.git/HEAD),) | ||
823 | GIT-HEAD-PHONY = ../../.git/HEAD | ||
824 | else | ||
825 | GIT-HEAD-PHONY = | ||
826 | endif | ||
827 | |||
817 | .PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK) | 828 | .PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK) |
818 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell | 829 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
819 | .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS | 830 | .PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS |