4 # standard single make variable specified
5 make_clean_all := clean all
6 make_python_perf_so := python/perf.so
8 make_no_libperl := NO_LIBPERL=1
9 make_no_libpython := NO_LIBPYTHON=1
10 make_no_scripts := NO_LIBPYTHON=1 NO_LIBPERL=1
11 make_no_newt := NO_NEWT=1
12 make_no_slang := NO_SLANG=1
13 make_no_gtk2 := NO_GTK2=1
14 make_no_ui := NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
15 make_no_demangle := NO_DEMANGLE=1
16 make_no_libelf := NO_LIBELF=1
17 make_no_libunwind := NO_LIBUNWIND=1
18 make_no_backtrace := NO_BACKTRACE=1
19 make_no_libnuma := NO_LIBNUMA=1
20 make_no_libaudit := NO_LIBAUDIT=1
21 make_no_libbionic := NO_LIBBIONIC=1
27 make_util_map_o := util/map.o
29 # all the NO_* variable combined
30 make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
31 make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
32 make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
34 # $(run) contains all available tests
37 run += make_python_perf_so
39 run += make_no_libperl
40 run += make_no_libpython
41 run += make_no_scripts
46 run += make_no_demangle
48 run += make_no_libunwind
49 run += make_no_backtrace
50 run += make_no_libnuma
51 run += make_no_libaudit
52 run += make_no_libbionic
58 run += make_util_map_o
61 # $(run_O) contains same portion of $(run) tests with '_O' attached
62 # to distinguish O=... tests
63 run_O := $(addsuffix _O,$(run))
65 # disable some tests for O=...
66 run_O := $(filter-out make_python_perf_so_O,$(run_O))
68 # define test for each compile as 'test_NAME' variable
69 # with the test itself as a value
70 test_make_tags = test -f tags
71 test_make_cscope = test -f cscope.out
73 test_make_tags_O := $(test_make_tags)
74 test_make_cscope_O := $(test_make_cscope)
77 test_make_help := $(test_ok)
78 test_make_doc := $(test_ok)
79 test_make_help_O := $(test_ok)
80 test_make_doc_O := $(test_ok)
82 test_make_python_perf_so := test -f $(PERF)/python/perf.so
84 test_make_perf_o := test -f $(PERF)/perf.o
85 test_make_util_map_o := test -f $(PERF)/util/map.o
88 #test_make_python_perf_so_O := test -f $$TMP/tools/perf/python/perf.so
89 #test_make_perf_o_O := test -f $$TMP/tools/perf/perf.o
90 #test_make_util_map_o_O := test -f $$TMP/tools/perf/util/map.o
92 test_make_perf_o_O := true
93 test_make_util_map_o_O := true
95 test_default = test -x $(PERF)/perf
96 test = $(if $(test_$1),$(test_$1),$(test_default))
98 test_default_O = test -x $$TMP/perf
99 test_O = $(if $(test_$1),$(test_$1),$(test_default_O))
104 d := $(info run $(run))
105 d := $(info run_O $(run_O))
108 MAKEFLAGS := --no-print-directory
110 clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
114 @cmd="cd $(PERF) && make -f $(MK) $($@)"; \
115 echo "- $@: $$cmd" && echo $$cmd > $@ && \
116 ( eval $$cmd ) >> $@ 2>&1; \
117 echo " test: $(call test,$@)"; \
123 @TMP=$$(mktemp -d); \
124 cmd="cd $(PERF) && make -f $(MK) $($(patsubst %_O,%,$@)) O=$$TMP"; \
125 echo "- $@: $$cmd" && echo $$cmd > $@ && \
126 ( eval $$cmd ) >> $@ 2>&1 && \
127 echo " test: $(call test_O,$@)"; \
128 $(call test_O,$@) && \
138 .PHONY: all $(run) $(run_O) clean