Delete invalid assignment statements in do_sendfile
[linux/fpc-iii.git] / tools / build / feature / Makefile
blob0516259be70f071f2533496ead690d1ebd5ba3b8
1 # SPDX-License-Identifier: GPL-2.0
2 FILES= \
3 test-all.bin \
4 test-backtrace.bin \
5 test-bionic.bin \
6 test-dwarf.bin \
7 test-dwarf_getlocations.bin \
8 test-fortify-source.bin \
9 test-sync-compare-and-swap.bin \
10 test-glibc.bin \
11 test-gtk2.bin \
12 test-gtk2-infobar.bin \
13 test-hello.bin \
14 test-libaudit.bin \
15 test-libbfd.bin \
16 test-disassembler-four-args.bin \
17 test-reallocarray.bin \
18 test-liberty.bin \
19 test-liberty-z.bin \
20 test-cplus-demangle.bin \
21 test-libelf.bin \
22 test-libelf-getphdrnum.bin \
23 test-libelf-gelf_getnote.bin \
24 test-libelf-getshdrstrndx.bin \
25 test-libelf-mmap.bin \
26 test-libnuma.bin \
27 test-numa_num_possible_cpus.bin \
28 test-libperl.bin \
29 test-libpython.bin \
30 test-libpython-version.bin \
31 test-libslang.bin \
32 test-libcrypto.bin \
33 test-libunwind.bin \
34 test-libunwind-debug-frame.bin \
35 test-libunwind-x86.bin \
36 test-libunwind-x86_64.bin \
37 test-libunwind-arm.bin \
38 test-libunwind-aarch64.bin \
39 test-libunwind-debug-frame-arm.bin \
40 test-libunwind-debug-frame-aarch64.bin \
41 test-pthread-attr-setaffinity-np.bin \
42 test-pthread-barrier.bin \
43 test-stackprotector-all.bin \
44 test-timerfd.bin \
45 test-libdw-dwarf-unwind.bin \
46 test-libbabeltrace.bin \
47 test-compile-32.bin \
48 test-compile-x32.bin \
49 test-zlib.bin \
50 test-lzma.bin \
51 test-bpf.bin \
52 test-get_cpuid.bin \
53 test-sdt.bin \
54 test-cxx.bin \
55 test-jvmti.bin \
56 test-sched_getcpu.bin \
57 test-setns.bin \
58 test-libopencsd.bin \
59 test-clang.bin \
60 test-llvm.bin \
61 test-llvm-version.bin
63 FILES := $(addprefix $(OUTPUT),$(FILES))
65 CC ?= $(CROSS_COMPILE)gcc
66 CXX ?= $(CROSS_COMPILE)g++
67 PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
68 LLVM_CONFIG ?= llvm-config
70 all: $(FILES)
72 __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
73 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
75 __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
76 BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
78 ###############################
80 $(OUTPUT)test-all.bin:
81 $(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
83 $(OUTPUT)test-hello.bin:
84 $(BUILD)
86 $(OUTPUT)test-pthread-attr-setaffinity-np.bin:
87 $(BUILD) -D_GNU_SOURCE -lpthread
89 $(OUTPUT)test-pthread-barrier.bin:
90 $(BUILD) -lpthread
92 $(OUTPUT)test-stackprotector-all.bin:
93 $(BUILD) -fstack-protector-all
95 $(OUTPUT)test-fortify-source.bin:
96 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
98 $(OUTPUT)test-bionic.bin:
99 $(BUILD)
101 $(OUTPUT)test-libelf.bin:
102 $(BUILD) -lelf
104 $(OUTPUT)test-glibc.bin:
105 $(BUILD)
107 $(OUTPUT)test-sched_getcpu.bin:
108 $(BUILD)
110 $(OUTPUT)test-setns.bin:
111 $(BUILD)
113 $(OUTPUT)test-libopencsd.bin:
114 $(BUILD) # -lopencsd_c_api -lopencsd provided by
115 # $(FEATURE_CHECK_LDFLAGS-libopencsd)
117 DWARFLIBS := -ldw
118 ifeq ($(findstring -static,${LDFLAGS}),-static)
119 DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
120 endif
122 $(OUTPUT)test-dwarf.bin:
123 $(BUILD) $(DWARFLIBS)
125 $(OUTPUT)test-dwarf_getlocations.bin:
126 $(BUILD) $(DWARFLIBS)
128 $(OUTPUT)test-libelf-mmap.bin:
129 $(BUILD) -lelf
131 $(OUTPUT)test-libelf-getphdrnum.bin:
132 $(BUILD) -lelf
134 $(OUTPUT)test-libelf-gelf_getnote.bin:
135 $(BUILD) -lelf
137 $(OUTPUT)test-libelf-getshdrstrndx.bin:
138 $(BUILD) -lelf
140 $(OUTPUT)test-libnuma.bin:
141 $(BUILD) -lnuma
143 $(OUTPUT)test-numa_num_possible_cpus.bin:
144 $(BUILD) -lnuma
146 $(OUTPUT)test-libunwind.bin:
147 $(BUILD) -lelf
149 $(OUTPUT)test-libunwind-debug-frame.bin:
150 $(BUILD) -lelf
151 $(OUTPUT)test-libunwind-x86.bin:
152 $(BUILD) -lelf -lunwind-x86
154 $(OUTPUT)test-libunwind-x86_64.bin:
155 $(BUILD) -lelf -lunwind-x86_64
157 $(OUTPUT)test-libunwind-arm.bin:
158 $(BUILD) -lelf -lunwind-arm
160 $(OUTPUT)test-libunwind-aarch64.bin:
161 $(BUILD) -lelf -lunwind-aarch64
163 $(OUTPUT)test-libunwind-debug-frame-arm.bin:
164 $(BUILD) -lelf -lunwind-arm
166 $(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
167 $(BUILD) -lelf -lunwind-aarch64
169 $(OUTPUT)test-libaudit.bin:
170 $(BUILD) -laudit
172 $(OUTPUT)test-libslang.bin:
173 $(BUILD) -I/usr/include/slang -lslang
175 $(OUTPUT)test-libcrypto.bin:
176 $(BUILD) -lcrypto
178 $(OUTPUT)test-gtk2.bin:
179 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
181 $(OUTPUT)test-gtk2-infobar.bin:
182 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
184 grep-libs = $(filter -l%,$(1))
185 strip-libs = $(filter-out -l%,$(1))
187 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
188 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
189 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
190 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
191 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
193 $(OUTPUT)test-libperl.bin:
194 $(BUILD) $(FLAGS_PERL_EMBED)
196 $(OUTPUT)test-libpython.bin:
197 $(BUILD) $(FLAGS_PYTHON_EMBED)
199 $(OUTPUT)test-libpython-version.bin:
200 $(BUILD)
202 $(OUTPUT)test-libbfd.bin:
203 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
205 $(OUTPUT)test-disassembler-four-args.bin:
206 $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
208 $(OUTPUT)test-reallocarray.bin:
209 $(BUILD)
211 $(OUTPUT)test-liberty.bin:
212 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
214 $(OUTPUT)test-liberty-z.bin:
215 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
217 $(OUTPUT)test-cplus-demangle.bin:
218 $(BUILD) -liberty
220 $(OUTPUT)test-backtrace.bin:
221 $(BUILD)
223 $(OUTPUT)test-timerfd.bin:
224 $(BUILD)
226 $(OUTPUT)test-libdw-dwarf-unwind.bin:
227 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
229 $(OUTPUT)test-libbabeltrace.bin:
230 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
232 $(OUTPUT)test-sync-compare-and-swap.bin:
233 $(BUILD)
235 $(OUTPUT)test-compile-32.bin:
236 $(CC) -m32 -o $@ test-compile.c
238 $(OUTPUT)test-compile-x32.bin:
239 $(CC) -mx32 -o $@ test-compile.c
241 $(OUTPUT)test-zlib.bin:
242 $(BUILD) -lz
244 $(OUTPUT)test-lzma.bin:
245 $(BUILD) -llzma
247 $(OUTPUT)test-get_cpuid.bin:
248 $(BUILD)
250 $(OUTPUT)test-bpf.bin:
251 $(BUILD)
253 $(OUTPUT)test-sdt.bin:
254 $(BUILD)
256 $(OUTPUT)test-cxx.bin:
257 $(BUILDXX) -std=gnu++11
259 $(OUTPUT)test-jvmti.bin:
260 $(BUILD)
262 $(OUTPUT)test-llvm.bin:
263 $(BUILDXX) -std=gnu++11 \
264 -I$(shell $(LLVM_CONFIG) --includedir) \
265 -L$(shell $(LLVM_CONFIG) --libdir) \
266 $(shell $(LLVM_CONFIG) --libs Core BPF) \
267 $(shell $(LLVM_CONFIG) --system-libs) \
268 > $(@:.bin=.make.output) 2>&1
270 $(OUTPUT)test-llvm-version.bin:
271 $(BUILDXX) -std=gnu++11 \
272 -I$(shell $(LLVM_CONFIG) --includedir) \
273 > $(@:.bin=.make.output) 2>&1
275 $(OUTPUT)test-clang.bin:
276 $(BUILDXX) -std=gnu++11 \
277 -I$(shell $(LLVM_CONFIG) --includedir) \
278 -L$(shell $(LLVM_CONFIG) --libdir) \
279 -Wl,--start-group -lclangBasic -lclangDriver \
280 -lclangFrontend -lclangEdit -lclangLex \
281 -lclangAST -Wl,--end-group \
282 $(shell $(LLVM_CONFIG) --libs Core option) \
283 $(shell $(LLVM_CONFIG) --system-libs) \
284 > $(@:.bin=.make.output) 2>&1
286 -include $(OUTPUT)*.d
288 ###############################
290 clean:
291 rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)