rtc: stm32: fix misspelling and misalignment issues
[linux/fpc-iii.git] / tools / build / feature / Makefile
blobdac9563b54707c6cb65deb3e609ecc9785d4bf0c
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-liberty.bin \
18 test-liberty-z.bin \
19 test-cplus-demangle.bin \
20 test-libelf.bin \
21 test-libelf-getphdrnum.bin \
22 test-libelf-gelf_getnote.bin \
23 test-libelf-getshdrstrndx.bin \
24 test-libelf-mmap.bin \
25 test-libnuma.bin \
26 test-numa_num_possible_cpus.bin \
27 test-libperl.bin \
28 test-libpython.bin \
29 test-libpython-version.bin \
30 test-libslang.bin \
31 test-libcrypto.bin \
32 test-libunwind.bin \
33 test-libunwind-debug-frame.bin \
34 test-libunwind-x86.bin \
35 test-libunwind-x86_64.bin \
36 test-libunwind-arm.bin \
37 test-libunwind-aarch64.bin \
38 test-libunwind-debug-frame-arm.bin \
39 test-libunwind-debug-frame-aarch64.bin \
40 test-pthread-attr-setaffinity-np.bin \
41 test-pthread-barrier.bin \
42 test-stackprotector-all.bin \
43 test-timerfd.bin \
44 test-libdw-dwarf-unwind.bin \
45 test-libbabeltrace.bin \
46 test-compile-32.bin \
47 test-compile-x32.bin \
48 test-zlib.bin \
49 test-lzma.bin \
50 test-bpf.bin \
51 test-get_cpuid.bin \
52 test-sdt.bin \
53 test-cxx.bin \
54 test-jvmti.bin \
55 test-sched_getcpu.bin \
56 test-setns.bin \
57 test-libopencsd.bin \
58 test-clang.bin \
59 test-llvm.bin \
60 test-llvm-version.bin
62 FILES := $(addprefix $(OUTPUT),$(FILES))
64 CC ?= $(CROSS_COMPILE)gcc
65 CXX ?= $(CROSS_COMPILE)g++
66 PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
67 LLVM_CONFIG ?= llvm-config
69 all: $(FILES)
71 __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
72 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
74 __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
75 BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
77 ###############################
79 $(OUTPUT)test-all.bin:
80 $(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
82 $(OUTPUT)test-hello.bin:
83 $(BUILD)
85 $(OUTPUT)test-pthread-attr-setaffinity-np.bin:
86 $(BUILD) -D_GNU_SOURCE -lpthread
88 $(OUTPUT)test-pthread-barrier.bin:
89 $(BUILD) -lpthread
91 $(OUTPUT)test-stackprotector-all.bin:
92 $(BUILD) -fstack-protector-all
94 $(OUTPUT)test-fortify-source.bin:
95 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
97 $(OUTPUT)test-bionic.bin:
98 $(BUILD)
100 $(OUTPUT)test-libelf.bin:
101 $(BUILD) -lelf
103 $(OUTPUT)test-glibc.bin:
104 $(BUILD)
106 $(OUTPUT)test-sched_getcpu.bin:
107 $(BUILD)
109 $(OUTPUT)test-setns.bin:
110 $(BUILD)
112 $(OUTPUT)test-libopencsd.bin:
113 $(BUILD) # -lopencsd_c_api -lopencsd provided by
114 # $(FEATURE_CHECK_LDFLAGS-libopencsd)
116 DWARFLIBS := -ldw
117 ifeq ($(findstring -static,${LDFLAGS}),-static)
118 DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
119 endif
121 $(OUTPUT)test-dwarf.bin:
122 $(BUILD) $(DWARFLIBS)
124 $(OUTPUT)test-dwarf_getlocations.bin:
125 $(BUILD) $(DWARFLIBS)
127 $(OUTPUT)test-libelf-mmap.bin:
128 $(BUILD) -lelf
130 $(OUTPUT)test-libelf-getphdrnum.bin:
131 $(BUILD) -lelf
133 $(OUTPUT)test-libelf-gelf_getnote.bin:
134 $(BUILD) -lelf
136 $(OUTPUT)test-libelf-getshdrstrndx.bin:
137 $(BUILD) -lelf
139 $(OUTPUT)test-libnuma.bin:
140 $(BUILD) -lnuma
142 $(OUTPUT)test-numa_num_possible_cpus.bin:
143 $(BUILD) -lnuma
145 $(OUTPUT)test-libunwind.bin:
146 $(BUILD) -lelf
148 $(OUTPUT)test-libunwind-debug-frame.bin:
149 $(BUILD) -lelf
150 $(OUTPUT)test-libunwind-x86.bin:
151 $(BUILD) -lelf -lunwind-x86
153 $(OUTPUT)test-libunwind-x86_64.bin:
154 $(BUILD) -lelf -lunwind-x86_64
156 $(OUTPUT)test-libunwind-arm.bin:
157 $(BUILD) -lelf -lunwind-arm
159 $(OUTPUT)test-libunwind-aarch64.bin:
160 $(BUILD) -lelf -lunwind-aarch64
162 $(OUTPUT)test-libunwind-debug-frame-arm.bin:
163 $(BUILD) -lelf -lunwind-arm
165 $(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
166 $(BUILD) -lelf -lunwind-aarch64
168 $(OUTPUT)test-libaudit.bin:
169 $(BUILD) -laudit
171 $(OUTPUT)test-libslang.bin:
172 $(BUILD) -I/usr/include/slang -lslang
174 $(OUTPUT)test-libcrypto.bin:
175 $(BUILD) -lcrypto
177 $(OUTPUT)test-gtk2.bin:
178 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
180 $(OUTPUT)test-gtk2-infobar.bin:
181 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
183 grep-libs = $(filter -l%,$(1))
184 strip-libs = $(filter-out -l%,$(1))
186 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
187 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
188 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
189 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
190 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
192 $(OUTPUT)test-libperl.bin:
193 $(BUILD) $(FLAGS_PERL_EMBED)
195 $(OUTPUT)test-libpython.bin:
196 $(BUILD) $(FLAGS_PYTHON_EMBED)
198 $(OUTPUT)test-libpython-version.bin:
199 $(BUILD)
201 $(OUTPUT)test-libbfd.bin:
202 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
204 $(OUTPUT)test-disassembler-four-args.bin:
205 $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
207 $(OUTPUT)test-liberty.bin:
208 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
210 $(OUTPUT)test-liberty-z.bin:
211 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
213 $(OUTPUT)test-cplus-demangle.bin:
214 $(BUILD) -liberty
216 $(OUTPUT)test-backtrace.bin:
217 $(BUILD)
219 $(OUTPUT)test-timerfd.bin:
220 $(BUILD)
222 $(OUTPUT)test-libdw-dwarf-unwind.bin:
223 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
225 $(OUTPUT)test-libbabeltrace.bin:
226 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
228 $(OUTPUT)test-sync-compare-and-swap.bin:
229 $(BUILD)
231 $(OUTPUT)test-compile-32.bin:
232 $(CC) -m32 -o $@ test-compile.c
234 $(OUTPUT)test-compile-x32.bin:
235 $(CC) -mx32 -o $@ test-compile.c
237 $(OUTPUT)test-zlib.bin:
238 $(BUILD) -lz
240 $(OUTPUT)test-lzma.bin:
241 $(BUILD) -llzma
243 $(OUTPUT)test-get_cpuid.bin:
244 $(BUILD)
246 $(OUTPUT)test-bpf.bin:
247 $(BUILD)
249 $(OUTPUT)test-sdt.bin:
250 $(BUILD)
252 $(OUTPUT)test-cxx.bin:
253 $(BUILDXX) -std=gnu++11
255 $(OUTPUT)test-jvmti.bin:
256 $(BUILD)
258 $(OUTPUT)test-llvm.bin:
259 $(BUILDXX) -std=gnu++11 \
260 -I$(shell $(LLVM_CONFIG) --includedir) \
261 -L$(shell $(LLVM_CONFIG) --libdir) \
262 $(shell $(LLVM_CONFIG) --libs Core BPF) \
263 $(shell $(LLVM_CONFIG) --system-libs) \
264 > $(@:.bin=.make.output) 2>&1
266 $(OUTPUT)test-llvm-version.bin:
267 $(BUILDXX) -std=gnu++11 \
268 -I$(shell $(LLVM_CONFIG) --includedir) \
269 > $(@:.bin=.make.output) 2>&1
271 $(OUTPUT)test-clang.bin:
272 $(BUILDXX) -std=gnu++11 \
273 -I$(shell $(LLVM_CONFIG) --includedir) \
274 -L$(shell $(LLVM_CONFIG) --libdir) \
275 -Wl,--start-group -lclangBasic -lclangDriver \
276 -lclangFrontend -lclangEdit -lclangLex \
277 -lclangAST -Wl,--end-group \
278 $(shell $(LLVM_CONFIG) --libs Core option) \
279 $(shell $(LLVM_CONFIG) --system-libs) \
280 > $(@:.bin=.make.output) 2>&1
282 -include $(OUTPUT)*.d
284 ###############################
286 clean:
287 rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)