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 \
27 test-libunwind-debug-frame.bin \
28 test-pthread-attr-setaffinity-np.bin \
29 test-stackprotector-all.bin \
31 test-libdw-dwarf-unwind.bin \
32 test-libbabeltrace.bin \
34 test-compile-x32.bin \
40 FILES
:= $(addprefix $(OUTPUT
),$(FILES
))
42 CC
:= $(CROSS_COMPILE
)gcc
-MD
43 PKG_CONFIG
:= $(CROSS_COMPILE
)pkg-config
47 __BUILD
= $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@
$(patsubst %.bin
,%.c
,$(@F
)) $(LDFLAGS
)
48 BUILD
= $(__BUILD
) > $(@
:.bin
=.make.output
) 2>&1
50 ###############################
52 $(OUTPUT
)test-all.bin
:
53 $(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
55 $(OUTPUT
)test-hello.bin
:
58 $(OUTPUT
)test-pthread-attr-setaffinity-np.bin
:
59 $(BUILD
) -D_GNU_SOURCE
-lpthread
61 $(OUTPUT
)test-stackprotector-all.bin
:
62 $(BUILD
) -fstack-protector-all
64 $(OUTPUT
)test-fortify-source.bin
:
65 $(BUILD
) -O2
-D_FORTIFY_SOURCE
=2
67 $(OUTPUT
)test-bionic.bin
:
70 $(OUTPUT
)test-libelf.bin
:
73 $(OUTPUT
)test-glibc.bin
:
77 ifeq ($(findstring -static
,${LDFLAGS}),-static
)
78 DWARFLIBS
+= -lelf
-lebl
-lz
-llzma
-lbz2
81 $(OUTPUT
)test-dwarf.bin
:
84 $(OUTPUT
)test-libelf-mmap.bin
:
87 $(OUTPUT
)test-libelf-getphdrnum.bin
:
90 $(OUTPUT
)test-libnuma.bin
:
93 $(OUTPUT
)test-numa_num_possible_cpus.bin
:
96 $(OUTPUT
)test-libunwind.bin
:
99 $(OUTPUT
)test-libunwind-debug-frame.bin
:
102 $(OUTPUT
)test-libaudit.bin
:
105 $(OUTPUT
)test-libslang.bin
:
106 $(BUILD
) -I
/usr
/include/slang
-lslang
108 $(OUTPUT
)test-gtk2.bin
:
109 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
111 $(OUTPUT
)test-gtk2-infobar.bin
:
112 $(BUILD
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
114 grep-libs
= $(filter -l
%,$(1))
115 strip-libs
= $(filter-out -l
%,$(1))
117 PERL_EMBED_LDOPTS
= $(shell perl
-MExtUtils
::Embed
-e ldopts
2>/dev
/null
)
118 PERL_EMBED_LDFLAGS
= $(call strip-libs
,$(PERL_EMBED_LDOPTS
))
119 PERL_EMBED_LIBADD
= $(call grep-libs
,$(PERL_EMBED_LDOPTS
))
120 PERL_EMBED_CCOPTS
= `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
121 FLAGS_PERL_EMBED
=$(PERL_EMBED_CCOPTS
) $(PERL_EMBED_LDOPTS
)
123 $(OUTPUT
)test-libperl.bin
:
124 $(BUILD
) $(FLAGS_PERL_EMBED
)
126 $(OUTPUT
)test-libpython.bin
:
129 $(OUTPUT
)test-libpython-version.bin
:
132 $(OUTPUT
)test-libbfd.bin
:
133 $(BUILD
) -DPACKAGE
='"perf"' -lbfd
-lz
-liberty
-ldl
135 $(OUTPUT
)test-liberty.bin
:
136 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
138 $(OUTPUT
)test-liberty-z.bin
:
139 $(CC
) $(CFLAGS
) -Wall
-Werror
-o
$@ test-libbfd.c
-DPACKAGE
='"perf"' $(LDFLAGS
) -lbfd
-ldl
-liberty
-lz
141 $(OUTPUT
)test-cplus-demangle.bin
:
144 $(OUTPUT
)test-backtrace.bin
:
147 $(OUTPUT
)test-timerfd.bin
:
150 $(OUTPUT
)test-libdw-dwarf-unwind.bin
:
151 $(BUILD
) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
153 $(OUTPUT
)test-libbabeltrace.bin
:
154 $(BUILD
) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
156 $(OUTPUT
)test-sync-compare-and-swap.bin
:
159 $(OUTPUT
)test-compile-32.bin
:
160 $(CC
) -m32
-o
$@ test-compile.c
162 $(OUTPUT
)test-compile-x32.bin
:
163 $(CC
) -mx32
-o
$@ test-compile.c
165 $(OUTPUT
)test-zlib.bin
:
168 $(OUTPUT
)test-lzma.bin
:
171 $(OUTPUT
)test-get_cpuid.bin
:
174 $(OUTPUT
)test-bpf.bin
:
177 -include $(OUTPUT
)*.d
179 ###############################
182 rm -f
$(FILES
) $(OUTPUT
)*.d
$(FILES
:.bin
=.make.output
)