6 test-dwarf_getlocations.bin \
7 test-fortify-source.bin \
8 test-sync-compare-and-swap.bin \
11 test-gtk2-infobar.bin \
17 test-cplus-demangle.bin \
19 test-libelf-getphdrnum.bin \
20 test-libelf-gelf_getnote.bin \
21 test-libelf-getshdrstrndx.bin \
22 test-libelf-mmap.bin \
24 test-numa_num_possible_cpus.bin \
27 test-libpython-version.bin \
31 test-libunwind-debug-frame.bin \
32 test-libunwind-x86.bin \
33 test-libunwind-x86_64.bin \
34 test-libunwind-arm.bin \
35 test-libunwind-aarch64.bin \
36 test-libunwind-debug-frame-arm.bin \
37 test-libunwind-debug-frame-aarch64.bin \
38 test-pthread-attr-setaffinity-np.bin \
39 test-stackprotector-all.bin \
41 test-libdw-dwarf-unwind.bin \
42 test-libbabeltrace.bin \
44 test-compile-x32.bin \
51 FILES
:= $(addprefix $(OUTPUT
),$(FILES
))
53 CC
:= $(CROSS_COMPILE
)gcc
-MD
54 PKG_CONFIG
:= $(CROSS_COMPILE
)pkg-config
58 __BUILD
= $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@
$(patsubst %.bin
,%.c
,$(@F
)) $(LDFLAGS
)
59 BUILD
= $(__BUILD
) > $(@
:.bin
=.make.output
) 2>&1
61 ###############################
63 $(OUTPUT
)test-all.bin
:
64 $(BUILD
) -fstack-protector-all
-O2
-D_FORTIFY_SOURCE
=2 -ldw
-lelf
-lnuma
-lelf
-laudit
-I
/usr
/include/slang
-lslang
$(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
) $(FLAGS_PERL_EMBED
) $(FLAGS_PYTHON_EMBED
) -DPACKAGE
='"perf"' -lbfd
-ldl
-lz
-llzma
66 $(OUTPUT
)test-hello.bin
:
69 $(OUTPUT
)test-pthread-attr-setaffinity-np.bin
:
70 $(BUILD
) -D_GNU_SOURCE
-lpthread
72 $(OUTPUT
)test-stackprotector-all.bin
:
73 $(BUILD
) -fstack-protector-all
75 $(OUTPUT
)test-fortify-source.bin
:
76 $(BUILD
) -O2
-D_FORTIFY_SOURCE
=2
78 $(OUTPUT
)test-bionic.bin
:
81 $(OUTPUT
)test-libelf.bin
:
84 $(OUTPUT
)test-glibc.bin
:
88 ifeq ($(findstring -static
,${LDFLAGS}),-static
)
89 DWARFLIBS
+= -lelf
-lebl
-lz
-llzma
-lbz2
92 $(OUTPUT
)test-dwarf.bin
:
95 $(OUTPUT
)test-dwarf_getlocations.bin
:
98 $(OUTPUT
)test-libelf-mmap.bin
:
101 $(OUTPUT
)test-libelf-getphdrnum.bin
:
104 $(OUTPUT
)test-libelf-gelf_getnote.bin
:
107 $(OUTPUT
)test-libelf-getshdrstrndx.bin
:
110 $(OUTPUT
)test-libnuma.bin
:
113 $(OUTPUT
)test-numa_num_possible_cpus.bin
:
116 $(OUTPUT
)test-libunwind.bin
:
119 $(OUTPUT
)test-libunwind-debug-frame.bin
:
121 $(OUTPUT
)test-libunwind-x86.bin
:
122 $(BUILD
) -lelf
-lunwind-x86
124 $(OUTPUT
)test-libunwind-x86_64.bin
:
125 $(BUILD
) -lelf
-lunwind-x86_64
127 $(OUTPUT
)test-libunwind-arm.bin
:
128 $(BUILD
) -lelf
-lunwind-arm
130 $(OUTPUT
)test-libunwind-aarch64.bin
:
131 $(BUILD
) -lelf
-lunwind-aarch64
133 $(OUTPUT
)test-libunwind-debug-frame-arm.bin
:
134 $(BUILD
) -lelf
-lunwind-arm
136 $(OUTPUT
)test-libunwind-debug-frame-aarch64.bin
:
137 $(BUILD
) -lelf
-lunwind-aarch64
139 $(OUTPUT
)test-libaudit.bin
:
142 $(OUTPUT
)test-libslang.bin
:
143 $(BUILD
) -I
/usr
/include/slang
-lslang
145 $(OUTPUT
)test-libcrypto.bin
:
148 $(OUTPUT
)test-gtk2.bin
:
149 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
151 $(OUTPUT
)test-gtk2-infobar.bin
:
152 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
154 grep-libs
= $(filter -l
%,$(1))
155 strip-libs
= $(filter-out -l
%,$(1))
157 PERL_EMBED_LDOPTS
= $(shell perl
-MExtUtils
::Embed
-e ldopts
2>/dev
/null
)
158 PERL_EMBED_LDFLAGS
= $(call strip-libs
,$(PERL_EMBED_LDOPTS
))
159 PERL_EMBED_LIBADD
= $(call grep-libs
,$(PERL_EMBED_LDOPTS
))
160 PERL_EMBED_CCOPTS
= `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
161 FLAGS_PERL_EMBED
=$(PERL_EMBED_CCOPTS
) $(PERL_EMBED_LDOPTS
)
163 $(OUTPUT
)test-libperl.bin
:
164 $(BUILD
) $(FLAGS_PERL_EMBED
)
166 $(OUTPUT
)test-libpython.bin
:
169 $(OUTPUT
)test-libpython-version.bin
:
172 $(OUTPUT
)test-libbfd.bin
:
173 $(BUILD
) -DPACKAGE
='"perf"' -lbfd
-lz
-liberty
-ldl
175 $(OUTPUT
)test-liberty.bin
:
176 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
178 $(OUTPUT
)test-liberty-z.bin
:
179 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
-lz
181 $(OUTPUT
)test-cplus-demangle.bin
:
184 $(OUTPUT
)test-backtrace.bin
:
187 $(OUTPUT
)test-timerfd.bin
:
190 $(OUTPUT
)test-libdw-dwarf-unwind.bin
:
191 $(BUILD
) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
193 $(OUTPUT
)test-libbabeltrace.bin
:
194 $(BUILD
) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
196 $(OUTPUT
)test-sync-compare-and-swap.bin
:
199 $(OUTPUT
)test-compile-32.bin
:
200 $(CC
) -m32
-o
$@ test-compile.c
202 $(OUTPUT
)test-compile-x32.bin
:
203 $(CC
) -mx32
-o
$@ test-compile.c
205 $(OUTPUT
)test-zlib.bin
:
208 $(OUTPUT
)test-lzma.bin
:
211 $(OUTPUT
)test-get_cpuid.bin
:
214 $(OUTPUT
)test-bpf.bin
:
217 $(OUTPUT
)test-sdt.bin
:
220 -include $(OUTPUT
)*.d
222 ###############################
225 rm -f
$(FILES
) $(OUTPUT
)*.d
$(FILES
:.bin
=.make.output
)