mm, oom: do not rely on TIF_MEMDIE for memory reserves access
[linux/fpc-iii.git] / tools / build / feature / Makefile
blobee2546ddf02831c587ef1d217c69a3d17b140705
1 FILES= \
2 test-all.bin \
3 test-backtrace.bin \
4 test-bionic.bin \
5 test-dwarf.bin \
6 test-dwarf_getlocations.bin \
7 test-fortify-source.bin \
8 test-sync-compare-and-swap.bin \
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-gelf_getnote.bin \
21 test-libelf-getshdrstrndx.bin \
22 test-libelf-mmap.bin \
23 test-libnuma.bin \
24 test-numa_num_possible_cpus.bin \
25 test-libperl.bin \
26 test-libpython.bin \
27 test-libpython-version.bin \
28 test-libslang.bin \
29 test-libcrypto.bin \
30 test-libunwind.bin \
31 test-libunwind-debug-frame.bin \
32 test-libunwind-x86.bin \
33 test-libunwind-x86_64.bin \
34 test-libunwind-arm.bin \
35 test-libunwind-aarch64.bin \
36 test-libunwind-debug-frame-arm.bin \
37 test-libunwind-debug-frame-aarch64.bin \
38 test-pthread-attr-setaffinity-np.bin \
39 test-stackprotector-all.bin \
40 test-timerfd.bin \
41 test-libdw-dwarf-unwind.bin \
42 test-libbabeltrace.bin \
43 test-compile-32.bin \
44 test-compile-x32.bin \
45 test-zlib.bin \
46 test-lzma.bin \
47 test-bpf.bin \
48 test-get_cpuid.bin \
49 test-sdt.bin \
50 test-cxx.bin \
51 test-jvmti.bin \
52 test-sched_getcpu.bin \
53 test-setns.bin
55 FILES := $(addprefix $(OUTPUT),$(FILES))
57 CC ?= $(CROSS_COMPILE)gcc
58 CXX ?= $(CROSS_COMPILE)g++
59 PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
60 LLVM_CONFIG ?= llvm-config
62 all: $(FILES)
64 __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
65 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
67 __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
68 BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
70 ###############################
72 $(OUTPUT)test-all.bin:
73 $(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
75 $(OUTPUT)test-hello.bin:
76 $(BUILD)
78 $(OUTPUT)test-pthread-attr-setaffinity-np.bin:
79 $(BUILD) -D_GNU_SOURCE -lpthread
81 $(OUTPUT)test-stackprotector-all.bin:
82 $(BUILD) -fstack-protector-all
84 $(OUTPUT)test-fortify-source.bin:
85 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
87 $(OUTPUT)test-bionic.bin:
88 $(BUILD)
90 $(OUTPUT)test-libelf.bin:
91 $(BUILD) -lelf
93 $(OUTPUT)test-glibc.bin:
94 $(BUILD)
96 $(OUTPUT)test-sched_getcpu.bin:
97 $(BUILD)
99 $(OUTPUT)test-setns.bin:
100 $(BUILD)
102 DWARFLIBS := -ldw
103 ifeq ($(findstring -static,${LDFLAGS}),-static)
104 DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
105 endif
107 $(OUTPUT)test-dwarf.bin:
108 $(BUILD) $(DWARFLIBS)
110 $(OUTPUT)test-dwarf_getlocations.bin:
111 $(BUILD) $(DWARFLIBS)
113 $(OUTPUT)test-libelf-mmap.bin:
114 $(BUILD) -lelf
116 $(OUTPUT)test-libelf-getphdrnum.bin:
117 $(BUILD) -lelf
119 $(OUTPUT)test-libelf-gelf_getnote.bin:
120 $(BUILD) -lelf
122 $(OUTPUT)test-libelf-getshdrstrndx.bin:
123 $(BUILD) -lelf
125 $(OUTPUT)test-libnuma.bin:
126 $(BUILD) -lnuma
128 $(OUTPUT)test-numa_num_possible_cpus.bin:
129 $(BUILD) -lnuma
131 $(OUTPUT)test-libunwind.bin:
132 $(BUILD) -lelf
134 $(OUTPUT)test-libunwind-debug-frame.bin:
135 $(BUILD) -lelf
136 $(OUTPUT)test-libunwind-x86.bin:
137 $(BUILD) -lelf -lunwind-x86
139 $(OUTPUT)test-libunwind-x86_64.bin:
140 $(BUILD) -lelf -lunwind-x86_64
142 $(OUTPUT)test-libunwind-arm.bin:
143 $(BUILD) -lelf -lunwind-arm
145 $(OUTPUT)test-libunwind-aarch64.bin:
146 $(BUILD) -lelf -lunwind-aarch64
148 $(OUTPUT)test-libunwind-debug-frame-arm.bin:
149 $(BUILD) -lelf -lunwind-arm
151 $(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
152 $(BUILD) -lelf -lunwind-aarch64
154 $(OUTPUT)test-libaudit.bin:
155 $(BUILD) -laudit
157 $(OUTPUT)test-libslang.bin:
158 $(BUILD) -I/usr/include/slang -lslang
160 $(OUTPUT)test-libcrypto.bin:
161 $(BUILD) -lcrypto
163 $(OUTPUT)test-gtk2.bin:
164 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
166 $(OUTPUT)test-gtk2-infobar.bin:
167 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
169 grep-libs = $(filter -l%,$(1))
170 strip-libs = $(filter-out -l%,$(1))
172 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
173 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
174 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
175 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
176 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
178 $(OUTPUT)test-libperl.bin:
179 $(BUILD) $(FLAGS_PERL_EMBED)
181 $(OUTPUT)test-libpython.bin:
182 $(BUILD) $(FLAGS_PYTHON_EMBED)
184 $(OUTPUT)test-libpython-version.bin:
185 $(BUILD)
187 $(OUTPUT)test-libbfd.bin:
188 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
190 $(OUTPUT)test-liberty.bin:
191 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
193 $(OUTPUT)test-liberty-z.bin:
194 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
196 $(OUTPUT)test-cplus-demangle.bin:
197 $(BUILD) -liberty
199 $(OUTPUT)test-backtrace.bin:
200 $(BUILD)
202 $(OUTPUT)test-timerfd.bin:
203 $(BUILD)
205 $(OUTPUT)test-libdw-dwarf-unwind.bin:
206 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
208 $(OUTPUT)test-libbabeltrace.bin:
209 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
211 $(OUTPUT)test-sync-compare-and-swap.bin:
212 $(BUILD)
214 $(OUTPUT)test-compile-32.bin:
215 $(CC) -m32 -o $@ test-compile.c
217 $(OUTPUT)test-compile-x32.bin:
218 $(CC) -mx32 -o $@ test-compile.c
220 $(OUTPUT)test-zlib.bin:
221 $(BUILD) -lz
223 $(OUTPUT)test-lzma.bin:
224 $(BUILD) -llzma
226 $(OUTPUT)test-get_cpuid.bin:
227 $(BUILD)
229 $(OUTPUT)test-bpf.bin:
230 $(BUILD)
232 $(OUTPUT)test-sdt.bin:
233 $(BUILD)
235 $(OUTPUT)test-cxx.bin:
236 $(BUILDXX) -std=gnu++11
238 $(OUTPUT)test-jvmti.bin:
239 $(BUILD)
241 $(OUTPUT)test-llvm.bin:
242 $(BUILDXX) -std=gnu++11 \
243 -I$(shell $(LLVM_CONFIG) --includedir) \
244 -L$(shell $(LLVM_CONFIG) --libdir) \
245 $(shell $(LLVM_CONFIG) --libs Core BPF) \
246 $(shell $(LLVM_CONFIG) --system-libs)
248 $(OUTPUT)test-llvm-version.bin:
249 $(BUILDXX) -std=gnu++11 \
250 -I$(shell $(LLVM_CONFIG) --includedir)
252 $(OUTPUT)test-clang.bin:
253 $(BUILDXX) -std=gnu++11 \
254 -I$(shell $(LLVM_CONFIG) --includedir) \
255 -L$(shell $(LLVM_CONFIG) --libdir) \
256 -Wl,--start-group -lclangBasic -lclangDriver \
257 -lclangFrontend -lclangEdit -lclangLex \
258 -lclangAST -Wl,--end-group \
259 $(shell $(LLVM_CONFIG) --libs Core option) \
260 $(shell $(LLVM_CONFIG) --system-libs)
262 -include $(OUTPUT)*.d
264 ###############################
266 clean:
267 rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)