Create manpages and binaries including the version
authorBastian Blank <waldi@debian.org>
Mon, 26 Sep 2011 12:53:12 +0000 (13:53 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 12 Aug 2017 22:09:26 +0000 (23:09 +0100)
[bwh: Fix version insertion in perf man page cross-references and perf
man page title.  Install bash_completion script for perf with a
version-dependent name.  And do the same for trace.]

Gbp-Pq: Topic debian
Gbp-Pq: Name tools-perf-version.patch

tools/perf/Documentation/Makefile
tools/perf/Makefile.perf
tools/perf/util/Build
tools/perf/util/vdso.c

index 098cfb9ca8f0f73374f2ee32fdd6cb55ce32e55f..21f904e06cb47244a3e3db5fec5c05bea5826da6 100644 (file)
@@ -183,14 +183,16 @@ ifdef missing_tools
        $(error "You need to install $(missing_tools) for man pages")
 endif
 
-do-install-man: man
+do-install-man: $(addprefix install-man-,$(_DOC_MAN1))
+
+install-man-perf.1: $(OUTPUT)perf.1
+       $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
+       sed -e 's/"PERF"/"PERF_$(VERSION)"/' -e 's/fBperf-/fBperf_$(VERSION)-/g' $^ > $(DESTDIR)$(man1dir)/perf_$(VERSION).1
+
+install-man-perf%.1: $(OUTPUT)perf%.1
        $(call QUIET_INSTALL, Documentation-man) \
                $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir); \
-#              $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir); \
-#              $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir); \
-               $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir); \
-#              $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir); \
-#              $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
+               sed -e 's/"PERF\\-/"PERF_$(VERSION)\\-/' -e 's/fBperf-/fBperf_$(VERSION)-/g' $^ > $(DESTDIR)$(man1dir)/perf_$(VERSION)$*.1
 
 install-man: check-man-tools man
 
index 5008f51a08a2118ca34723a87373acd231afb7c3..1cd2208df9d15a1758b1839d60b6dd0568e95fe1 100644 (file)
@@ -649,23 +649,23 @@ endif
 install-tools: all install-gtk
        $(call QUIET_INSTALL, binaries) \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
-               $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \
-               $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
+               $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)/perf_$(VERSION)'; \
+               $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf_$(VERSION)' '$(DESTDIR_SQ)$(bindir_SQ)/trace_$(VERSION)'
+       $(call QUIET_INSTALL, libexec) \
+               $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
 ifndef NO_PERF_READ_VDSO32
        $(call QUIET_INSTALL, perf-read-vdso32) \
-               $(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(bindir_SQ)';
+               $(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)';
 endif
 ifndef NO_PERF_READ_VDSOX32
        $(call QUIET_INSTALL, perf-read-vdsox32) \
-               $(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(bindir_SQ)';
+               $(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)';
 endif
 ifndef NO_JVMTI
        $(call QUIET_INSTALL, $(LIBJVMTI)) \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
                $(INSTALL) $(OUTPUT)$(LIBJVMTI) '$(DESTDIR_SQ)$(libdir_SQ)';
 endif
-       $(call QUIET_INSTALL, libexec) \
-               $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
        $(call QUIET_INSTALL, perf-archive) \
                $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
        $(call QUIET_INSTALL, perf-with-kcore) \
@@ -693,7 +693,7 @@ ifndef NO_LIBPYTHON
 endif
        $(call QUIET_INSTALL, perf_completion-script) \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \
-               $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
+               $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf_$(VERSION)'
        $(call QUIET_INSTALL, perf-tip) \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(tip_instdir_SQ)'; \
                $(INSTALL) Documentation/tips.txt -t '$(DESTDIR_SQ)$(tip_instdir_SQ)'
@@ -714,7 +714,7 @@ install-python_ext:
 
 # 'make install-doc' should call 'make -C Documentation install'
 $(INSTALL_DOC_TARGETS):
-       $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
+       $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=) VERSION=$(VERSION)
 
 ### Cleaning rules
 
index 79dea95a7f688ca9fa9b16346b3fae25af797f5c..bb403b9b11ec8bf42b2d319ba1e6e663e7703aee 100644 (file)
@@ -173,6 +173,7 @@ CFLAGS_libstring.o     += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ET
 CFLAGS_hweight.o       += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
 CFLAGS_parse-events.o  += -Wno-redundant-decls
 CFLAGS_header.o        += -include $(OUTPUT)PERF-VERSION-FILE
+CFLAGS_vdso.o          += -DPERFEXECDIR='"$(perfexec_instdir_SQ)"'
 
 $(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
        $(call rule_mkdir)
index d3c39eec89a85b64f724bf27466c3dabc15a1029..8a5177d41e106b29f6d4f0efa6c31d5ee8effa01 100644 (file)
@@ -51,12 +51,12 @@ static struct vdso_info *vdso_info__new(void)
                .vdso32  = {
                        .temp_file_name = VDSO__TEMP_FILE_NAME,
                        .dso_name = DSO__NAME_VDSO32,
-                       .read_prog = "perf-read-vdso32",
+                       .read_prog = PERFEXECDIR "/perf-read-vdso32",
                },
                .vdsox32  = {
                        .temp_file_name = VDSO__TEMP_FILE_NAME,
                        .dso_name = DSO__NAME_VDSOX32,
-                       .read_prog = "perf-read-vdsox32",
+                       .read_prog = PERFEXECDIR "/perf-read-vdsox32",
                },
 #endif
        };