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 \
52 test-sched_getcpu.bin \
55 FILES
:= $(addprefix $(OUTPUT
),$(FILES
))
57 CC ?
= $(CROSS_COMPILE
)gcc
58 CXX ?
= $(CROSS_COMPILE
)g
++
59 PKG_CONFIG ?
= $(CROSS_COMPILE
)pkg-config
60 LLVM_CONFIG ?
= llvm-config
64 __BUILD
= $(CC
) $(CFLAGS
) -MD
-Wall
-Werror
-o
$@
$(patsubst %.bin
,%.c
,$(@F
)) $(LDFLAGS
)
65 BUILD
= $(__BUILD
) > $(@
:.bin
=.make.output
) 2>&1
67 __BUILDXX
= $(CXX
) $(CXXFLAGS
) -MD
-Wall
-Werror
-o
$@
$(patsubst %.bin
,%.
cpp,$(@F
)) $(LDFLAGS
)
68 BUILDXX
= $(__BUILDXX
) > $(@
:.bin
=.make.output
) 2>&1
70 ###############################
72 $(OUTPUT
)test-all.bin
:
73 $(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
75 $(OUTPUT
)test-hello.bin
:
78 $(OUTPUT
)test-pthread-attr-setaffinity-np.bin
:
79 $(BUILD
) -D_GNU_SOURCE
-lpthread
81 $(OUTPUT
)test-stackprotector-all.bin
:
82 $(BUILD
) -fstack-protector-all
84 $(OUTPUT
)test-fortify-source.bin
:
85 $(BUILD
) -O2
-D_FORTIFY_SOURCE
=2
87 $(OUTPUT
)test-bionic.bin
:
90 $(OUTPUT
)test-libelf.bin
:
93 $(OUTPUT
)test-glibc.bin
:
96 $(OUTPUT
)test-sched_getcpu.bin
:
99 $(OUTPUT
)test-setns.bin
:
103 ifeq ($(findstring -static
,${LDFLAGS}),-static
)
104 DWARFLIBS
+= -lelf
-lebl
-lz
-llzma
-lbz2
107 $(OUTPUT
)test-dwarf.bin
:
108 $(BUILD
) $(DWARFLIBS
)
110 $(OUTPUT
)test-dwarf_getlocations.bin
:
111 $(BUILD
) $(DWARFLIBS
)
113 $(OUTPUT
)test-libelf-mmap.bin
:
116 $(OUTPUT
)test-libelf-getphdrnum.bin
:
119 $(OUTPUT
)test-libelf-gelf_getnote.bin
:
122 $(OUTPUT
)test-libelf-getshdrstrndx.bin
:
125 $(OUTPUT
)test-libnuma.bin
:
128 $(OUTPUT
)test-numa_num_possible_cpus.bin
:
131 $(OUTPUT
)test-libunwind.bin
:
134 $(OUTPUT
)test-libunwind-debug-frame.bin
:
136 $(OUTPUT
)test-libunwind-x86.bin
:
137 $(BUILD
) -lelf
-lunwind-x86
139 $(OUTPUT
)test-libunwind-x86_64.bin
:
140 $(BUILD
) -lelf
-lunwind-x86_64
142 $(OUTPUT
)test-libunwind-arm.bin
:
143 $(BUILD
) -lelf
-lunwind-arm
145 $(OUTPUT
)test-libunwind-aarch64.bin
:
146 $(BUILD
) -lelf
-lunwind-aarch64
148 $(OUTPUT
)test-libunwind-debug-frame-arm.bin
:
149 $(BUILD
) -lelf
-lunwind-arm
151 $(OUTPUT
)test-libunwind-debug-frame-aarch64.bin
:
152 $(BUILD
) -lelf
-lunwind-aarch64
154 $(OUTPUT
)test-libaudit.bin
:
157 $(OUTPUT
)test-libslang.bin
:
158 $(BUILD
) -I
/usr
/include/slang
-lslang
160 $(OUTPUT
)test-libcrypto.bin
:
163 $(OUTPUT
)test-gtk2.bin
:
164 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
166 $(OUTPUT
)test-gtk2-infobar.bin
:
167 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
169 grep-libs
= $(filter -l
%,$(1))
170 strip-libs
= $(filter-out -l
%,$(1))
172 PERL_EMBED_LDOPTS
= $(shell perl
-MExtUtils
::Embed
-e ldopts
2>/dev
/null
)
173 PERL_EMBED_LDFLAGS
= $(call strip-libs
,$(PERL_EMBED_LDOPTS
))
174 PERL_EMBED_LIBADD
= $(call grep-libs
,$(PERL_EMBED_LDOPTS
))
175 PERL_EMBED_CCOPTS
= `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
176 FLAGS_PERL_EMBED
=$(PERL_EMBED_CCOPTS
) $(PERL_EMBED_LDOPTS
)
178 $(OUTPUT
)test-libperl.bin
:
179 $(BUILD
) $(FLAGS_PERL_EMBED
)
181 $(OUTPUT
)test-libpython.bin
:
182 $(BUILD
) $(FLAGS_PYTHON_EMBED
)
184 $(OUTPUT
)test-libpython-version.bin
:
187 $(OUTPUT
)test-libbfd.bin
:
188 $(BUILD
) -DPACKAGE
='"perf"' -lbfd
-lz
-liberty
-ldl
190 $(OUTPUT
)test-liberty.bin
:
191 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
193 $(OUTPUT
)test-liberty-z.bin
:
194 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
-lz
196 $(OUTPUT
)test-cplus-demangle.bin
:
199 $(OUTPUT
)test-backtrace.bin
:
202 $(OUTPUT
)test-timerfd.bin
:
205 $(OUTPUT
)test-libdw-dwarf-unwind.bin
:
206 $(BUILD
) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
208 $(OUTPUT
)test-libbabeltrace.bin
:
209 $(BUILD
) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
211 $(OUTPUT
)test-sync-compare-and-swap.bin
:
214 $(OUTPUT
)test-compile-32.bin
:
215 $(CC
) -m32
-o
$@ test-compile.c
217 $(OUTPUT
)test-compile-x32.bin
:
218 $(CC
) -mx32
-o
$@ test-compile.c
220 $(OUTPUT
)test-zlib.bin
:
223 $(OUTPUT
)test-lzma.bin
:
226 $(OUTPUT
)test-get_cpuid.bin
:
229 $(OUTPUT
)test-bpf.bin
:
232 $(OUTPUT
)test-sdt.bin
:
235 $(OUTPUT
)test-cxx.bin
:
236 $(BUILDXX
) -std
=gnu
++11
238 $(OUTPUT
)test-jvmti.bin
:
241 $(OUTPUT
)test-llvm.bin
:
242 $(BUILDXX
) -std
=gnu
++11 \
243 -I
$(shell $(LLVM_CONFIG
) --includedir) \
244 -L
$(shell $(LLVM_CONFIG
) --libdir) \
245 $(shell $(LLVM_CONFIG
) --libs Core BPF
) \
246 $(shell $(LLVM_CONFIG
) --system-libs
)
248 $(OUTPUT
)test-llvm-version.bin
:
249 $(BUILDXX
) -std
=gnu
++11 \
250 -I
$(shell $(LLVM_CONFIG
) --includedir)
252 $(OUTPUT
)test-clang.bin
:
253 $(BUILDXX
) -std
=gnu
++11 \
254 -I
$(shell $(LLVM_CONFIG
) --includedir) \
255 -L
$(shell $(LLVM_CONFIG
) --libdir) \
256 -Wl
,--start-group
-lclangBasic
-lclangDriver \
257 -lclangFrontend
-lclangEdit
-lclangLex \
258 -lclangAST
-Wl
,--end-group \
259 $(shell $(LLVM_CONFIG
) --libs Core option
) \
260 $(shell $(LLVM_CONFIG
) --system-libs
)
262 -include $(OUTPUT
)*.d
264 ###############################
267 rm -f
$(FILES
) $(OUTPUT
)*.d
$(FILES
:.bin
=.make.output
)