Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1079abd authored by Mike Galbraith's avatar Mike Galbraith Committed by Ingo Molnar
Browse files

perf_counter tools: Cleanup Makefile



We currently build perf-stat/record etc, only to do nothing
with them.  We also install the perf binary in two places,
$prefix/bin and $perfexec_instdir, which appears to be for
binaries which perf would exec were a command not linked in.
Correct this, and comment out broken/incomplete targets dist
and coverage.

Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent c25486c5
Loading
Loading
Loading
Loading
+73 −68
Original line number Original line Diff line number Diff line
@@ -260,8 +260,6 @@ PROGRAMS += perf


# List built-in command $C whose implementation cmd_$C() is not in
# List built-in command $C whose implementation cmd_$C() is not in
# builtin-$C.o but is linked in as part of some other command.
# builtin-$C.o but is linked in as part of some other command.
BUILT_INS += $(patsubst builtin-%.o,perf-%$X,$(BUILTIN_OBJS))

#
#
# None right now:
# None right now:
#
#
@@ -791,12 +789,14 @@ export perfexec_instdir


install: all
install: all
	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
	$(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)'
	$(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)'
ifdef BUILT_INS
	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
	$(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
ifneq (,$X)
ifneq (,$X)
	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), $(RM) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$p';)
	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), $(RM) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$p';)
endif
endif
endif


install-doc:
install-doc:
	$(MAKE) -C Documentation install
	$(MAKE) -C Documentation install
@@ -824,52 +824,55 @@ quick-install-html:




### Maintainer's dist rules
### Maintainer's dist rules

#
perf.spec: perf.spec.in
# None right now
	sed -e 's/@@VERSION@@/$(PERF_VERSION)/g' < $< > $@+
#
	mv $@+ $@
#

# perf.spec: perf.spec.in
PERF_TARNAME=perf-$(PERF_VERSION)
#	sed -e 's/@@VERSION@@/$(PERF_VERSION)/g' < $< > $@+
dist: perf.spec perf-archive$(X) configure
#	mv $@+ $@
	./perf-archive --format=tar \
#
		--prefix=$(PERF_TARNAME)/ HEAD^{tree} > $(PERF_TARNAME).tar
# PERF_TARNAME=perf-$(PERF_VERSION)
	@mkdir -p $(PERF_TARNAME)
# dist: perf.spec perf-archive$(X) configure
	@cp perf.spec configure $(PERF_TARNAME)
#	./perf-archive --format=tar \
	@echo $(PERF_VERSION) > $(PERF_TARNAME)/version
#		--prefix=$(PERF_TARNAME)/ HEAD^{tree} > $(PERF_TARNAME).tar
	$(TAR) rf $(PERF_TARNAME).tar \
#	@mkdir -p $(PERF_TARNAME)
		$(PERF_TARNAME)/perf.spec \
#	@cp perf.spec configure $(PERF_TARNAME)
		$(PERF_TARNAME)/configure \
#	@echo $(PERF_VERSION) > $(PERF_TARNAME)/version
		$(PERF_TARNAME)/version
#	$(TAR) rf $(PERF_TARNAME).tar \
	@$(RM) -r $(PERF_TARNAME)
#		$(PERF_TARNAME)/perf.spec \
	gzip -f -9 $(PERF_TARNAME).tar
#		$(PERF_TARNAME)/configure \

#		$(PERF_TARNAME)/version
htmldocs = perf-htmldocs-$(PERF_VERSION)
#	@$(RM) -r $(PERF_TARNAME)
manpages = perf-manpages-$(PERF_VERSION)
#	gzip -f -9 $(PERF_TARNAME).tar
dist-doc:
#
	$(RM) -r .doc-tmp-dir
# htmldocs = perf-htmldocs-$(PERF_VERSION)
	mkdir .doc-tmp-dir
# manpages = perf-manpages-$(PERF_VERSION)
	$(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
# dist-doc:
	cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
#	$(RM) -r .doc-tmp-dir
	gzip -n -9 -f $(htmldocs).tar
#	mkdir .doc-tmp-dir
	:
#	$(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
	$(RM) -r .doc-tmp-dir
#	cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
	mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
#	gzip -n -9 -f $(htmldocs).tar
	$(MAKE) -C Documentation DESTDIR=./ \
#	:
		man1dir=../.doc-tmp-dir/man1 \
#	$(RM) -r .doc-tmp-dir
		man5dir=../.doc-tmp-dir/man5 \
#	mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
		man7dir=../.doc-tmp-dir/man7 \
#	$(MAKE) -C Documentation DESTDIR=./ \
		install
#		man1dir=../.doc-tmp-dir/man1 \
	cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
#		man5dir=../.doc-tmp-dir/man5 \
	gzip -n -9 -f $(manpages).tar
#		man7dir=../.doc-tmp-dir/man7 \
	$(RM) -r .doc-tmp-dir
#		install

#	cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
rpm: dist
#	gzip -n -9 -f $(manpages).tar
	$(RPMBUILD) -ta $(PERF_TARNAME).tar.gz
#	$(RM) -r .doc-tmp-dir
#
# rpm: dist
#	$(RPMBUILD) -ta $(PERF_TARNAME).tar.gz


### Cleaning rules
### Cleaning rules


distclean: clean
distclean: clean
	$(RM) configure
#	$(RM) configure


clean:
clean:
	$(RM) *.o */*.o $(LIB_FILE)
	$(RM) *.o */*.o $(LIB_FILE)
@@ -896,25 +899,27 @@ check-builtins::


### Test suite coverage testing
### Test suite coverage testing
#
#
.PHONY: coverage coverage-clean coverage-build coverage-report
# None right now

#
coverage:
# .PHONY: coverage coverage-clean coverage-build coverage-report
	$(MAKE) coverage-build
#
	$(MAKE) coverage-report
# coverage:

#	$(MAKE) coverage-build
coverage-clean:
#	$(MAKE) coverage-report
	rm -f *.gcda *.gcno
#

# coverage-clean:
COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
#	rm -f *.gcda *.gcno
COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov
#

# COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
coverage-build: coverage-clean
# COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov
	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
#
	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
# coverage-build: coverage-clean
		-j1 test
#	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all

#	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
coverage-report:
#		-j1 test
	gcov -b *.c */*.c
#
	grep '^function.*called 0 ' *.c.gcov */*.c.gcov \
# coverage-report:
		| sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
#	gcov -b *.c */*.c
		| tee coverage-untested-functions
#	grep '^function.*called 0 ' *.c.gcov */*.c.gcov \
#		| sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
#		| tee coverage-untested-functions