Ingo Molnar | 3ae069c | 2013-09-30 13:37:10 +0200 | [diff] [blame] | 1 | FILES= \ |
Chunwei Chen | 56560ec | 2013-12-21 13:48:11 +0800 | [diff] [blame] | 2 | test-all.bin \ |
3 | test-backtrace.bin \ | ||||
4 | test-bionic.bin \ | ||||
5 | test-dwarf.bin \ | ||||
Arnaldo Carvalho de Melo | bd0419e | 2016-04-05 11:33:41 -0300 | [diff] [blame] | 6 | test-dwarf_getlocations.bin \ |
Chunwei Chen | 56560ec | 2013-12-21 13:48:11 +0800 | [diff] [blame] | 7 | test-fortify-source.bin \ |
Adrian Hunter | f6d3136 | 2014-07-14 13:02:53 +0300 | [diff] [blame] | 8 | test-sync-compare-and-swap.bin \ |
Chunwei Chen | 56560ec | 2013-12-21 13:48:11 +0800 | [diff] [blame] | 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 \ | ||||
Arnaldo Carvalho de Melo | f8ac860 | 2015-09-17 12:20:28 -0300 | [diff] [blame] | 22 | test-numa_num_possible_cpus.bin \ |
Chunwei Chen | 56560ec | 2013-12-21 13:48:11 +0800 | [diff] [blame] | 23 | test-libperl.bin \ |
24 | test-libpython.bin \ | ||||
25 | test-libpython-version.bin \ | ||||
26 | test-libslang.bin \ | ||||
Stephane Eranian | 8ee4646 | 2015-11-30 10:02:21 +0100 | [diff] [blame] | 27 | test-libcrypto.bin \ |
Chunwei Chen | 56560ec | 2013-12-21 13:48:11 +0800 | [diff] [blame] | 28 | test-libunwind.bin \ |
29 | test-libunwind-debug-frame.bin \ | ||||
He Kuang | b1d9600 | 2016-05-10 07:40:31 +0000 | [diff] [blame^] | 30 | test-libunwind-x86.bin \ |
31 | test-libunwind-x86_64.bin \ | ||||
32 | test-libunwind-arm.bin \ | ||||
33 | test-libunwind-aarch64.bin \ | ||||
Vineet Gupta | 459a3df | 2015-01-13 19:13:24 +0530 | [diff] [blame] | 34 | test-pthread-attr-setaffinity-np.bin \ |
Chunwei Chen | 56560ec | 2013-12-21 13:48:11 +0800 | [diff] [blame] | 35 | test-stackprotector-all.bin \ |
Jiri Olsa | 4575789 | 2014-02-19 16:52:56 +0100 | [diff] [blame] | 36 | test-timerfd.bin \ |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 37 | test-libdw-dwarf-unwind.bin \ |
Jiri Olsa | 53d0a57 | 2015-02-20 23:16:58 +0100 | [diff] [blame] | 38 | test-libbabeltrace.bin \ |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 39 | test-compile-32.bin \ |
Namhyung Kim | e92ce12 | 2014-10-31 16:51:38 +0900 | [diff] [blame] | 40 | test-compile-x32.bin \ |
Jiri Olsa | 6c6f0f6 | 2015-03-04 11:35:47 +0100 | [diff] [blame] | 41 | test-zlib.bin \ |
Wang Nan | 1b76c13 | 2015-07-01 02:13:51 +0000 | [diff] [blame] | 42 | test-lzma.bin \ |
Arnaldo Carvalho de Melo | b0063db | 2015-09-17 12:54:30 -0300 | [diff] [blame] | 43 | test-bpf.bin \ |
44 | test-get_cpuid.bin | ||||
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 45 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 46 | FILES := $(addprefix $(OUTPUT),$(FILES)) |
47 | |||||
Mark Rutland | a8a5cd8 | 2014-01-15 10:44:08 +0000 | [diff] [blame] | 48 | CC := $(CROSS_COMPILE)gcc -MD |
49 | PKG_CONFIG := $(CROSS_COMPILE)pkg-config | ||||
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 50 | |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 51 | all: $(FILES) |
52 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 53 | __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS) |
54 | BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1 | ||||
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 55 | |
56 | ############################### | ||||
57 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 58 | $(OUTPUT)test-all.bin: |
Jiri Olsa | 6c6f0f6 | 2015-03-04 11:35:47 +0100 | [diff] [blame] | 59 | $(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 |
Ingo Molnar | baa9c30 | 2013-10-01 14:14:31 +0200 | [diff] [blame] | 60 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 61 | $(OUTPUT)test-hello.bin: |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 62 | $(BUILD) |
63 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 64 | $(OUTPUT)test-pthread-attr-setaffinity-np.bin: |
Ingo Molnar | b49f1a4 | 2015-02-28 10:16:27 +0100 | [diff] [blame] | 65 | $(BUILD) -D_GNU_SOURCE -lpthread |
Vineet Gupta | 459a3df | 2015-01-13 19:13:24 +0530 | [diff] [blame] | 66 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 67 | $(OUTPUT)test-stackprotector-all.bin: |
Ingo Molnar | b49f1a4 | 2015-02-28 10:16:27 +0100 | [diff] [blame] | 68 | $(BUILD) -fstack-protector-all |
Ingo Molnar | 90ac542 | 2013-09-30 13:48:44 +0200 | [diff] [blame] | 69 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 70 | $(OUTPUT)test-fortify-source.bin: |
Ingo Molnar | b49f1a4 | 2015-02-28 10:16:27 +0100 | [diff] [blame] | 71 | $(BUILD) -O2 -D_FORTIFY_SOURCE=2 |
Ingo Molnar | 1ea6f99 | 2013-10-07 09:38:28 +0200 | [diff] [blame] | 72 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 73 | $(OUTPUT)test-bionic.bin: |
Ingo Molnar | 78e9d65 | 2013-09-30 14:11:46 +0200 | [diff] [blame] | 74 | $(BUILD) |
75 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 76 | $(OUTPUT)test-libelf.bin: |
Ingo Molnar | 8f7f800 | 2013-09-30 14:20:25 +0200 | [diff] [blame] | 77 | $(BUILD) -lelf |
78 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 79 | $(OUTPUT)test-glibc.bin: |
Ingo Molnar | e12762c | 2013-10-07 10:34:20 +0200 | [diff] [blame] | 80 | $(BUILD) |
81 | |||||
Andi Kleen | 7aec51c | 2015-08-12 15:48:37 -0700 | [diff] [blame] | 82 | DWARFLIBS := -ldw |
83 | ifeq ($(findstring -static,${LDFLAGS}),-static) | ||||
84 | DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 | ||||
85 | endif | ||||
86 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 87 | $(OUTPUT)test-dwarf.bin: |
Andi Kleen | 7aec51c | 2015-08-12 15:48:37 -0700 | [diff] [blame] | 88 | $(BUILD) $(DWARFLIBS) |
Ingo Molnar | 8295d4e | 2013-10-07 10:35:39 +0200 | [diff] [blame] | 89 | |
Arnaldo Carvalho de Melo | bd0419e | 2016-04-05 11:33:41 -0300 | [diff] [blame] | 90 | $(OUTPUT)test-dwarf_getlocations.bin: |
91 | $(BUILD) $(DWARFLIBS) | ||||
92 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 93 | $(OUTPUT)test-libelf-mmap.bin: |
Ingo Molnar | 8869b17 | 2013-09-30 15:02:28 +0200 | [diff] [blame] | 94 | $(BUILD) -lelf |
95 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 96 | $(OUTPUT)test-libelf-getphdrnum.bin: |
Ingo Molnar | b7bcef6 | 2013-09-30 14:35:27 +0200 | [diff] [blame] | 97 | $(BUILD) -lelf |
98 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 99 | $(OUTPUT)test-libnuma.bin: |
Ingo Molnar | 3ae069c | 2013-09-30 13:37:10 +0200 | [diff] [blame] | 100 | $(BUILD) -lnuma |
101 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 102 | $(OUTPUT)test-numa_num_possible_cpus.bin: |
Arnaldo Carvalho de Melo | f8ac860 | 2015-09-17 12:20:28 -0300 | [diff] [blame] | 103 | $(BUILD) -lnuma |
104 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 105 | $(OUTPUT)test-libunwind.bin: |
Jean Pihet | 1448fef | 2013-12-10 13:24:04 +0100 | [diff] [blame] | 106 | $(BUILD) -lelf |
Ingo Molnar | 058f952 | 2013-09-30 14:45:44 +0200 | [diff] [blame] | 107 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 108 | $(OUTPUT)test-libunwind-debug-frame.bin: |
Jean Pihet | 1448fef | 2013-12-10 13:24:04 +0100 | [diff] [blame] | 109 | $(BUILD) -lelf |
He Kuang | b1d9600 | 2016-05-10 07:40:31 +0000 | [diff] [blame^] | 110 | $(OUTPUT)test-libunwind-x86.bin: |
111 | $(BUILD) -lelf -lunwind-x86 | ||||
112 | |||||
113 | $(OUTPUT)test-libunwind-x86_64.bin: | ||||
114 | $(BUILD) -lelf -lunwind-x86_64 | ||||
115 | |||||
116 | $(OUTPUT)test-libunwind-arm.bin: | ||||
117 | $(BUILD) -lelf -lunwind-arm | ||||
118 | |||||
119 | $(OUTPUT)test-libunwind-aarch64.bin: | ||||
120 | $(BUILD) -lelf -lunwind-aarch64 | ||||
121 | |||||
Ingo Molnar | e310718 | 2013-11-14 08:25:24 +0100 | [diff] [blame] | 122 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 123 | $(OUTPUT)test-libaudit.bin: |
Ingo Molnar | d795a65 | 2013-09-30 14:55:31 +0200 | [diff] [blame] | 124 | $(BUILD) -laudit |
125 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 126 | $(OUTPUT)test-libslang.bin: |
Ingo Molnar | b9498b5 | 2013-09-30 14:57:54 +0200 | [diff] [blame] | 127 | $(BUILD) -I/usr/include/slang -lslang |
128 | |||||
Stephane Eranian | 8ee4646 | 2015-11-30 10:02:21 +0100 | [diff] [blame] | 129 | $(OUTPUT)test-libcrypto.bin: |
130 | $(BUILD) -lcrypto | ||||
131 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 132 | $(OUTPUT)test-gtk2.bin: |
Mark Rutland | a8a5cd8 | 2014-01-15 10:44:08 +0000 | [diff] [blame] | 133 | $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) |
Ingo Molnar | 7ef9e05 | 2013-09-30 15:01:56 +0200 | [diff] [blame] | 134 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 135 | $(OUTPUT)test-gtk2-infobar.bin: |
Mark Rutland | a8a5cd8 | 2014-01-15 10:44:08 +0000 | [diff] [blame] | 136 | $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) |
Ingo Molnar | c7a79e9 | 2013-09-30 15:08:30 +0200 | [diff] [blame] | 137 | |
Ingo Molnar | 7181a67 | 2013-09-30 15:15:36 +0200 | [diff] [blame] | 138 | grep-libs = $(filter -l%,$(1)) |
139 | strip-libs = $(filter-out -l%,$(1)) | ||||
140 | |||||
141 | PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) | ||||
142 | PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) | ||||
143 | PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) | ||||
144 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` | ||||
145 | FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) | ||||
146 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 147 | $(OUTPUT)test-libperl.bin: |
Ingo Molnar | 7181a67 | 2013-09-30 15:15:36 +0200 | [diff] [blame] | 148 | $(BUILD) $(FLAGS_PERL_EMBED) |
149 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 150 | $(OUTPUT)test-libpython.bin: |
Namhyung Kim | 56c7d79 | 2014-07-29 15:57:19 +0900 | [diff] [blame] | 151 | $(BUILD) |
Ingo Molnar | 9734163 | 2013-09-30 15:18:37 +0200 | [diff] [blame] | 152 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 153 | $(OUTPUT)test-libpython-version.bin: |
Namhyung Kim | 56c7d79 | 2014-07-29 15:57:19 +0900 | [diff] [blame] | 154 | $(BUILD) |
Ingo Molnar | 95d061c | 2013-09-30 15:40:04 +0200 | [diff] [blame] | 155 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 156 | $(OUTPUT)test-libbfd.bin: |
Andi Kleen | 280e7c4 | 2014-01-11 11:42:51 -0800 | [diff] [blame] | 157 | $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl |
Ingo Molnar | 3b7646e | 2013-09-30 15:53:31 +0200 | [diff] [blame] | 158 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 159 | $(OUTPUT)test-liberty.bin: |
160 | $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty | ||||
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 161 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 162 | $(OUTPUT)test-liberty-z.bin: |
163 | $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz | ||||
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 164 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 165 | $(OUTPUT)test-cplus-demangle.bin: |
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 166 | $(BUILD) -liberty |
167 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 168 | $(OUTPUT)test-backtrace.bin: |
Ingo Molnar | 4cc9117 | 2013-09-30 16:49:38 +0200 | [diff] [blame] | 169 | $(BUILD) |
170 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 171 | $(OUTPUT)test-timerfd.bin: |
David Ahern | 87419c9 | 2013-10-29 10:43:16 -0600 | [diff] [blame] | 172 | $(BUILD) |
173 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 174 | $(OUTPUT)test-libdw-dwarf-unwind.bin: |
Jiri Olsa | 53d0a57 | 2015-02-20 23:16:58 +0100 | [diff] [blame] | 175 | $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind) |
176 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 177 | $(OUTPUT)test-libbabeltrace.bin: |
Jiri Olsa | 53d0a57 | 2015-02-20 23:16:58 +0100 | [diff] [blame] | 178 | $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace) |
Jiri Olsa | 4575789 | 2014-02-19 16:52:56 +0100 | [diff] [blame] | 179 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 180 | $(OUTPUT)test-sync-compare-and-swap.bin: |
Ingo Molnar | b49f1a4 | 2015-02-28 10:16:27 +0100 | [diff] [blame] | 181 | $(BUILD) |
Adrian Hunter | f6d3136 | 2014-07-14 13:02:53 +0300 | [diff] [blame] | 182 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 183 | $(OUTPUT)test-compile-32.bin: |
184 | $(CC) -m32 -o $@ test-compile.c | ||||
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 185 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 186 | $(OUTPUT)test-compile-x32.bin: |
187 | $(CC) -mx32 -o $@ test-compile.c | ||||
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 188 | |
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 189 | $(OUTPUT)test-zlib.bin: |
Namhyung Kim | e92ce12 | 2014-10-31 16:51:38 +0900 | [diff] [blame] | 190 | $(BUILD) -lz |
191 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 192 | $(OUTPUT)test-lzma.bin: |
Jiri Olsa | 6c6f0f6 | 2015-03-04 11:35:47 +0100 | [diff] [blame] | 193 | $(BUILD) -llzma |
194 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 195 | $(OUTPUT)test-get_cpuid.bin: |
Arnaldo Carvalho de Melo | b0063db | 2015-09-17 12:54:30 -0300 | [diff] [blame] | 196 | $(BUILD) |
197 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 198 | $(OUTPUT)test-bpf.bin: |
Wang Nan | 1b76c13 | 2015-07-01 02:13:51 +0000 | [diff] [blame] | 199 | $(BUILD) |
200 | |||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 201 | -include $(OUTPUT)*.d |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 202 | |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 203 | ############################### |
204 | |||||
205 | clean: | ||||
Josh Poimboeuf | 1925459 | 2015-12-15 09:39:32 -0600 | [diff] [blame] | 206 | rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output) |