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