perf tools: Add a build-test variant to use in builds from a tarball
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Apr 2021 00:15:34 +0000 (21:15 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Apr 2021 11:43:58 +0000 (08:43 -0300)
To use in automated tests inside containers from a tarball generated
by 'make perf-tar-src-pkg*', where testing building from a tarball
is obviously not needed, so add a 'build-test-tarball' for that case.

And don't build with gtk2 as this complicates things for cross builds
where we don't always have all the libraries a full perf build requires
available for the target arch, ditto for static builds.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile
tools/perf/tests/make

index b8fc7d9..f3fe360 100644 (file)
@@ -100,7 +100,10 @@ clean:
 # make -C tools/perf -f tests/make
 #
 build-test:
-       @$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory tarpkg out
+       @$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory tarpkg make_static make_with_gtk2 out
+
+build-test-tarball:
+       @$(MAKE) -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory out
 
 #
 # All other targets get passed through:
index a90fa04..94bd5d2 100644 (file)
@@ -155,7 +155,6 @@ run += make_no_syscall_tbl
 run += make_with_babeltrace
 run += make_with_clangllvm
 run += make_with_libpfm4
-run += make_with_gtk2
 run += make_help
 run += make_doc
 run += make_perf_o
@@ -172,7 +171,6 @@ run += make_install_prefix_slash
 # run += make_install_info
 # run += make_install_pdf
 run += make_minimal
-run += make_static
 
 ifneq ($(call has,ctags),)
 run += make_tags
@@ -307,6 +305,26 @@ $(run):
        $(call test,$@) && \
        rm -rf $@ $$TMP_DEST || (cat $@ ; false)
 
+make_with_gtk2:
+       $(call clean)
+       @TMP_DEST=$$(mktemp -d); \
+       cmd="cd $(PERF) && $(MAKE_F) $($@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
+       printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \
+       ( eval $$cmd ) >> $@ 2>&1; \
+       echo "  test: $(call test,$@)" >> $@ 2>&1; \
+       $(call test,$@) && \
+       rm -rf $@ $$TMP_DEST || (cat $@ ; false)
+
+make_static:
+       $(call clean)
+       @TMP_DEST=$$(mktemp -d); \
+       cmd="cd $(PERF) && $(MAKE_F) $($@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
+       printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \
+       ( eval $$cmd ) >> $@ 2>&1; \
+       echo "  test: $(call test,$@)" >> $@ 2>&1; \
+       $(call test,$@) && \
+       rm -rf $@ $$TMP_DEST || (cat $@ ; false)
+
 $(run_O):
        $(call clean)
        @TMP_O=$$(mktemp -d); \