]>
Commit | Line | Data |
---|---|---|
b6aa9979 | 1 | |
3ae069cf | 2 | FILES= \ |
56560ec6 CC |
3 | test-all.bin \ |
4 | test-backtrace.bin \ | |
5 | test-bionic.bin \ | |
6 | test-dwarf.bin \ | |
7 | test-fortify-source.bin \ | |
f6d31369 | 8 | test-sync-compare-and-swap.bin \ |
56560ec6 CC |
9 | test-glibc.bin \ |
10 | test-gtk2.bin \ | |
11 | test-gtk2-infobar.bin \ | |
12 | test-hello.bin \ | |
13 | test-libaudit.bin \ | |
14 | test-libbfd.bin \ | |
15 | test-liberty.bin \ | |
16 | test-liberty-z.bin \ | |
17 | test-cplus-demangle.bin \ | |
18 | test-libelf.bin \ | |
19 | test-libelf-getphdrnum.bin \ | |
20 | test-libelf-mmap.bin \ | |
21 | test-libnuma.bin \ | |
22 | test-libperl.bin \ | |
23 | test-libpython.bin \ | |
24 | test-libpython-version.bin \ | |
25 | test-libslang.bin \ | |
26 | test-libunwind.bin \ | |
27 | test-libunwind-debug-frame.bin \ | |
459a3df7 | 28 | test-pthread-attr-setaffinity-np.bin \ |
56560ec6 | 29 | test-stackprotector-all.bin \ |
45757895 | 30 | test-timerfd.bin \ |
e477f3f0 | 31 | test-libdw-dwarf-unwind.bin \ |
53d0a573 | 32 | test-libbabeltrace.bin \ |
e477f3f0 | 33 | test-compile-32.bin \ |
e92ce12e | 34 | test-compile-x32.bin \ |
6c6f0f61 | 35 | test-zlib.bin \ |
1b76c13e WN |
36 | test-lzma.bin \ |
37 | test-bpf.bin | |
b6aa9979 | 38 | |
a8a5cd8b MR |
39 | CC := $(CROSS_COMPILE)gcc -MD |
40 | PKG_CONFIG := $(CROSS_COMPILE)pkg-config | |
8b6eb56a | 41 | |
b6aa9979 IM |
42 | all: $(FILES) |
43 | ||
806f0727 JO |
44 | __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS) |
45 | BUILD = $(__BUILD) > $(OUTPUT)$(@:.bin=.make.output) 2>&1 | |
b6aa9979 IM |
46 | |
47 | ############################### | |
48 | ||
56560ec6 | 49 | test-all.bin: |
6c6f0f61 | 50 | $(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 |
baa9c30e | 51 | |
56560ec6 | 52 | test-hello.bin: |
b6aa9979 IM |
53 | $(BUILD) |
54 | ||
459a3df7 | 55 | test-pthread-attr-setaffinity-np.bin: |
b49f1a4b | 56 | $(BUILD) -D_GNU_SOURCE -lpthread |
459a3df7 | 57 | |
56560ec6 | 58 | test-stackprotector-all.bin: |
b49f1a4b | 59 | $(BUILD) -fstack-protector-all |
90ac5422 | 60 | |
56560ec6 | 61 | test-fortify-source.bin: |
b49f1a4b | 62 | $(BUILD) -O2 -D_FORTIFY_SOURCE=2 |
1ea6f99e | 63 | |
56560ec6 | 64 | test-bionic.bin: |
78e9d655 IM |
65 | $(BUILD) |
66 | ||
56560ec6 | 67 | test-libelf.bin: |
8f7f8005 IM |
68 | $(BUILD) -lelf |
69 | ||
56560ec6 | 70 | test-glibc.bin: |
e12762cf IM |
71 | $(BUILD) |
72 | ||
7aec51cb AK |
73 | DWARFLIBS := -ldw |
74 | ifeq ($(findstring -static,${LDFLAGS}),-static) | |
75 | DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 | |
76 | endif | |
77 | ||
56560ec6 | 78 | test-dwarf.bin: |
7aec51cb | 79 | $(BUILD) $(DWARFLIBS) |
8295d4e2 | 80 | |
56560ec6 | 81 | test-libelf-mmap.bin: |
8869b17e IM |
82 | $(BUILD) -lelf |
83 | ||
56560ec6 | 84 | test-libelf-getphdrnum.bin: |
b7bcef6f IM |
85 | $(BUILD) -lelf |
86 | ||
56560ec6 | 87 | test-libnuma.bin: |
3ae069cf IM |
88 | $(BUILD) -lnuma |
89 | ||
56560ec6 | 90 | test-libunwind.bin: |
1448fef4 | 91 | $(BUILD) -lelf |
058f952d | 92 | |
56560ec6 | 93 | test-libunwind-debug-frame.bin: |
1448fef4 | 94 | $(BUILD) -lelf |
e310718d | 95 | |
56560ec6 | 96 | test-libaudit.bin: |
d795a658 IM |
97 | $(BUILD) -laudit |
98 | ||
56560ec6 | 99 | test-libslang.bin: |
b9498b50 IM |
100 | $(BUILD) -I/usr/include/slang -lslang |
101 | ||
56560ec6 | 102 | test-gtk2.bin: |
a8a5cd8b | 103 | $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) |
7ef9e055 | 104 | |
56560ec6 | 105 | test-gtk2-infobar.bin: |
a8a5cd8b | 106 | $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) |
c7a79e96 | 107 | |
7181a671 IM |
108 | grep-libs = $(filter -l%,$(1)) |
109 | strip-libs = $(filter-out -l%,$(1)) | |
110 | ||
111 | PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) | |
112 | PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) | |
113 | PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) | |
114 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` | |
115 | FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) | |
116 | ||
56560ec6 | 117 | test-libperl.bin: |
7181a671 IM |
118 | $(BUILD) $(FLAGS_PERL_EMBED) |
119 | ||
56560ec6 | 120 | test-libpython.bin: |
56c7d79e | 121 | $(BUILD) |
9734163b | 122 | |
56560ec6 | 123 | test-libpython-version.bin: |
56c7d79e | 124 | $(BUILD) |
95d061c8 | 125 | |
56560ec6 | 126 | test-libbfd.bin: |
280e7c48 | 127 | $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl |
3b7646e4 | 128 | |
56560ec6 | 129 | test-liberty.bin: |
b49f1a4b | 130 | $(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty |
1c47661a | 131 | |
56560ec6 | 132 | test-liberty-z.bin: |
b49f1a4b | 133 | $(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz |
1c47661a | 134 | |
56560ec6 | 135 | test-cplus-demangle.bin: |
1c47661a IM |
136 | $(BUILD) -liberty |
137 | ||
56560ec6 | 138 | test-backtrace.bin: |
4cc9117a IM |
139 | $(BUILD) |
140 | ||
56560ec6 | 141 | test-timerfd.bin: |
87419c9a DA |
142 | $(BUILD) |
143 | ||
45757895 | 144 | test-libdw-dwarf-unwind.bin: |
53d0a573 JO |
145 | $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind) |
146 | ||
147 | test-libbabeltrace.bin: | |
148 | $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace) | |
45757895 | 149 | |
f6d31369 | 150 | test-sync-compare-and-swap.bin: |
b49f1a4b | 151 | $(BUILD) |
f6d31369 | 152 | |
e477f3f0 AH |
153 | test-compile-32.bin: |
154 | $(CC) -m32 -o $(OUTPUT)$@ test-compile.c | |
155 | ||
156 | test-compile-x32.bin: | |
157 | $(CC) -mx32 -o $(OUTPUT)$@ test-compile.c | |
158 | ||
e92ce12e NK |
159 | test-zlib.bin: |
160 | $(BUILD) -lz | |
161 | ||
6c6f0f61 JO |
162 | test-lzma.bin: |
163 | $(BUILD) -llzma | |
164 | ||
1b76c13e WN |
165 | test-bpf.bin: |
166 | $(BUILD) | |
167 | ||
231486a5 | 168 | -include *.d |
8b6eb56a | 169 | |
b6aa9979 IM |
170 | ############################### |
171 | ||
172 | clean: | |
806f0727 | 173 | rm -f $(FILES) *.d $(FILES:.bin=.make.output) |