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 FILES := $(addprefix $(OUTPUT),$(FILES))
54 CC := $(CROSS_COMPILE)gcc -MD
55 CXX := $(CROSS_COMPILE)g++ -MD
56 PKG_CONFIG := $(CROSS_COMPILE)pkg-config
60 __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
61 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
63 __BUILDXX = $(CXX) $(CXXFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
64 BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
66 ###############################
68 $(OUTPUT)test-all.bin:
69 $(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
71 $(OUTPUT)test-hello.bin:
74 $(OUTPUT)test-pthread-attr-setaffinity-np.bin:
75 $(BUILD) -D_GNU_SOURCE -lpthread
77 $(OUTPUT)test-stackprotector-all.bin:
78 $(BUILD) -fstack-protector-all
80 $(OUTPUT)test-fortify-source.bin:
81 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
83 $(OUTPUT)test-bionic.bin:
86 $(OUTPUT)test-libelf.bin:
89 $(OUTPUT)test-glibc.bin:
93 ifeq ($(findstring -static,${LDFLAGS}),-static)
94 DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
97 $(OUTPUT)test-dwarf.bin:
100 $(OUTPUT)test-dwarf_getlocations.bin:
101 $(BUILD) $(DWARFLIBS)
103 $(OUTPUT)test-libelf-mmap.bin:
106 $(OUTPUT)test-libelf-getphdrnum.bin:
109 $(OUTPUT)test-libelf-gelf_getnote.bin:
112 $(OUTPUT)test-libelf-getshdrstrndx.bin:
115 $(OUTPUT)test-libnuma.bin:
118 $(OUTPUT)test-numa_num_possible_cpus.bin:
121 $(OUTPUT)test-libunwind.bin:
124 $(OUTPUT)test-libunwind-debug-frame.bin:
126 $(OUTPUT)test-libunwind-x86.bin:
127 $(BUILD) -lelf -lunwind-x86
129 $(OUTPUT)test-libunwind-x86_64.bin:
130 $(BUILD) -lelf -lunwind-x86_64
132 $(OUTPUT)test-libunwind-arm.bin:
133 $(BUILD) -lelf -lunwind-arm
135 $(OUTPUT)test-libunwind-aarch64.bin:
136 $(BUILD) -lelf -lunwind-aarch64
138 $(OUTPUT)test-libunwind-debug-frame-arm.bin:
139 $(BUILD) -lelf -lunwind-arm
141 $(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
142 $(BUILD) -lelf -lunwind-aarch64
144 $(OUTPUT)test-libaudit.bin:
147 $(OUTPUT)test-libslang.bin:
148 $(BUILD) -I/usr/include/slang -lslang
150 $(OUTPUT)test-libcrypto.bin:
153 $(OUTPUT)test-gtk2.bin:
154 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
156 $(OUTPUT)test-gtk2-infobar.bin:
157 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
159 grep-libs = $(filter -l%,$(1))
160 strip-libs = $(filter-out -l%,$(1))
162 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
163 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
164 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
165 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
166 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
168 $(OUTPUT)test-libperl.bin:
169 $(BUILD) $(FLAGS_PERL_EMBED)
171 $(OUTPUT)test-libpython.bin:
174 $(OUTPUT)test-libpython-version.bin:
177 $(OUTPUT)test-libbfd.bin:
178 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
180 $(OUTPUT)test-liberty.bin:
181 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
183 $(OUTPUT)test-liberty-z.bin:
184 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
186 $(OUTPUT)test-cplus-demangle.bin:
189 $(OUTPUT)test-backtrace.bin:
192 $(OUTPUT)test-timerfd.bin:
195 $(OUTPUT)test-libdw-dwarf-unwind.bin:
196 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
198 $(OUTPUT)test-libbabeltrace.bin:
199 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
201 $(OUTPUT)test-sync-compare-and-swap.bin:
204 $(OUTPUT)test-compile-32.bin:
205 $(CC) -m32 -o $@ test-compile.c
207 $(OUTPUT)test-compile-x32.bin:
208 $(CC) -mx32 -o $@ test-compile.c
210 $(OUTPUT)test-zlib.bin:
213 $(OUTPUT)test-lzma.bin:
216 $(OUTPUT)test-get_cpuid.bin:
219 $(OUTPUT)test-bpf.bin:
222 $(OUTPUT)test-sdt.bin:
225 $(OUTPUT)test-cxx.bin:
226 $(BUILDXX) -std=gnu++11
228 -include $(OUTPUT)*.d
230 ###############################
233 rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)