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