6 test-fortify-source.bin \
7 test-sync-compare-and-swap.bin \
10 test-gtk2-infobar.bin \
16 test-cplus-demangle.bin \
18 test-libelf-getphdrnum.bin \
19 test-libelf-mmap.bin \
21 test-numa_num_possible_cpus.bin \
24 test-libpython-version.bin \
28 test-libunwind-debug-frame.bin \
29 test-pthread-attr-setaffinity-np.bin \
30 test-stackprotector-all.bin \
32 test-libdw-dwarf-unwind.bin \
33 test-libbabeltrace.bin \
35 test-compile-x32.bin \
41 FILES
:= $(addprefix $(OUTPUT
),$(FILES
))
43 CC
:= $(CROSS_COMPILE
)gcc
-MD
44 PKG_CONFIG
:= $(CROSS_COMPILE
)pkg-config
48 __BUILD
= $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@
$(patsubst %.bin
,%.c
,$(@F
)) $(LDFLAGS
)
49 BUILD
= $(__BUILD
) > $(@
:.bin
=.make.output
) 2>&1
51 ###############################
53 $(OUTPUT
)test-all.bin
:
54 $(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
56 $(OUTPUT
)test-hello.bin
:
59 $(OUTPUT
)test-pthread-attr-setaffinity-np.bin
:
60 $(BUILD
) -D_GNU_SOURCE
-lpthread
62 $(OUTPUT
)test-stackprotector-all.bin
:
63 $(BUILD
) -fstack-protector-all
65 $(OUTPUT
)test-fortify-source.bin
:
66 $(BUILD
) -O2
-D_FORTIFY_SOURCE
=2
68 $(OUTPUT
)test-bionic.bin
:
71 $(OUTPUT
)test-libelf.bin
:
74 $(OUTPUT
)test-glibc.bin
:
78 ifeq ($(findstring -static
,${LDFLAGS}),-static
)
79 DWARFLIBS
+= -lelf
-lebl
-lz
-llzma
-lbz2
82 $(OUTPUT
)test-dwarf.bin
:
85 $(OUTPUT
)test-libelf-mmap.bin
:
88 $(OUTPUT
)test-libelf-getphdrnum.bin
:
91 $(OUTPUT
)test-libnuma.bin
:
94 $(OUTPUT
)test-numa_num_possible_cpus.bin
:
97 $(OUTPUT
)test-libunwind.bin
:
100 $(OUTPUT
)test-libunwind-debug-frame.bin
:
103 $(OUTPUT
)test-libaudit.bin
:
106 $(OUTPUT
)test-libslang.bin
:
107 $(BUILD
) -I
/usr
/include/slang
-lslang
109 $(OUTPUT
)test-libcrypto.bin
:
112 $(OUTPUT
)test-gtk2.bin
:
113 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
115 $(OUTPUT
)test-gtk2-infobar.bin
:
116 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
118 grep-libs
= $(filter -l
%,$(1))
119 strip-libs
= $(filter-out -l
%,$(1))
121 PERL_EMBED_LDOPTS
= $(shell perl
-MExtUtils
::Embed
-e ldopts
2>/dev
/null
)
122 PERL_EMBED_LDFLAGS
= $(call strip-libs
,$(PERL_EMBED_LDOPTS
))
123 PERL_EMBED_LIBADD
= $(call grep-libs
,$(PERL_EMBED_LDOPTS
))
124 PERL_EMBED_CCOPTS
= `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
125 FLAGS_PERL_EMBED
=$(PERL_EMBED_CCOPTS
) $(PERL_EMBED_LDOPTS
)
127 $(OUTPUT
)test-libperl.bin
:
128 $(BUILD
) $(FLAGS_PERL_EMBED
)
130 $(OUTPUT
)test-libpython.bin
:
133 $(OUTPUT
)test-libpython-version.bin
:
136 $(OUTPUT
)test-libbfd.bin
:
137 $(BUILD
) -DPACKAGE
='"perf"' -lbfd
-lz
-liberty
-ldl
139 $(OUTPUT
)test-liberty.bin
:
140 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
142 $(OUTPUT
)test-liberty-z.bin
:
143 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
-lz
145 $(OUTPUT
)test-cplus-demangle.bin
:
148 $(OUTPUT
)test-backtrace.bin
:
151 $(OUTPUT
)test-timerfd.bin
:
154 $(OUTPUT
)test-libdw-dwarf-unwind.bin
:
155 $(BUILD
) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
157 $(OUTPUT
)test-libbabeltrace.bin
:
158 $(BUILD
) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
160 $(OUTPUT
)test-sync-compare-and-swap.bin
:
163 $(OUTPUT
)test-compile-32.bin
:
164 $(CC
) -m32
-o
$@ test-compile.c
166 $(OUTPUT
)test-compile-x32.bin
:
167 $(CC
) -mx32
-o
$@ test-compile.c
169 $(OUTPUT
)test-zlib.bin
:
172 $(OUTPUT
)test-lzma.bin
:
175 $(OUTPUT
)test-get_cpuid.bin
:
178 $(OUTPUT
)test-bpf.bin
:
181 -include $(OUTPUT
)*.d
183 ###############################
186 rm -f
$(FILES
) $(OUTPUT
)*.d
$(FILES
:.bin
=.make.output
)