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