of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / tools / build / feature / Makefile
blobbf8f0352264dcc8a5a1286bc4add2ca9de481357
1 FILES= \
2 test-all.bin \
3 test-backtrace.bin \
4 test-bionic.bin \
5 test-dwarf.bin \
6 test-fortify-source.bin \
7 test-sync-compare-and-swap.bin \
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 \
21 test-numa_num_possible_cpus.bin \
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 \
28 test-pthread-attr-setaffinity-np.bin \
29 test-stackprotector-all.bin \
30 test-timerfd.bin \
31 test-libdw-dwarf-unwind.bin \
32 test-libbabeltrace.bin \
33 test-compile-32.bin \
34 test-compile-x32.bin \
35 test-zlib.bin \
36 test-lzma.bin \
37 test-bpf.bin \
38 test-get_cpuid.bin
40 FILES := $(addprefix $(OUTPUT),$(FILES))
42 CC := $(CROSS_COMPILE)gcc -MD
43 PKG_CONFIG := $(CROSS_COMPILE)pkg-config
45 all: $(FILES)
47 __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
48 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
50 ###############################
52 $(OUTPUT)test-all.bin:
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
55 $(OUTPUT)test-hello.bin:
56 $(BUILD)
58 $(OUTPUT)test-pthread-attr-setaffinity-np.bin:
59 $(BUILD) -D_GNU_SOURCE -lpthread
61 $(OUTPUT)test-stackprotector-all.bin:
62 $(BUILD) -fstack-protector-all
64 $(OUTPUT)test-fortify-source.bin:
65 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
67 $(OUTPUT)test-bionic.bin:
68 $(BUILD)
70 $(OUTPUT)test-libelf.bin:
71 $(BUILD) -lelf
73 $(OUTPUT)test-glibc.bin:
74 $(BUILD)
76 DWARFLIBS := -ldw
77 ifeq ($(findstring -static,${LDFLAGS}),-static)
78 DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
79 endif
81 $(OUTPUT)test-dwarf.bin:
82 $(BUILD) $(DWARFLIBS)
84 $(OUTPUT)test-libelf-mmap.bin:
85 $(BUILD) -lelf
87 $(OUTPUT)test-libelf-getphdrnum.bin:
88 $(BUILD) -lelf
90 $(OUTPUT)test-libnuma.bin:
91 $(BUILD) -lnuma
93 $(OUTPUT)test-numa_num_possible_cpus.bin:
94 $(BUILD) -lnuma
96 $(OUTPUT)test-libunwind.bin:
97 $(BUILD) -lelf
99 $(OUTPUT)test-libunwind-debug-frame.bin:
100 $(BUILD) -lelf
102 $(OUTPUT)test-libaudit.bin:
103 $(BUILD) -laudit
105 $(OUTPUT)test-libslang.bin:
106 $(BUILD) -I/usr/include/slang -lslang
108 $(OUTPUT)test-gtk2.bin:
109 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
111 $(OUTPUT)test-gtk2-infobar.bin:
112 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
114 grep-libs = $(filter -l%,$(1))
115 strip-libs = $(filter-out -l%,$(1))
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)
123 $(OUTPUT)test-libperl.bin:
124 $(BUILD) $(FLAGS_PERL_EMBED)
126 $(OUTPUT)test-libpython.bin:
127 $(BUILD)
129 $(OUTPUT)test-libpython-version.bin:
130 $(BUILD)
132 $(OUTPUT)test-libbfd.bin:
133 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
135 $(OUTPUT)test-liberty.bin:
136 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
138 $(OUTPUT)test-liberty-z.bin:
139 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
141 $(OUTPUT)test-cplus-demangle.bin:
142 $(BUILD) -liberty
144 $(OUTPUT)test-backtrace.bin:
145 $(BUILD)
147 $(OUTPUT)test-timerfd.bin:
148 $(BUILD)
150 $(OUTPUT)test-libdw-dwarf-unwind.bin:
151 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
153 $(OUTPUT)test-libbabeltrace.bin:
154 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
156 $(OUTPUT)test-sync-compare-and-swap.bin:
157 $(BUILD)
159 $(OUTPUT)test-compile-32.bin:
160 $(CC) -m32 -o $@ test-compile.c
162 $(OUTPUT)test-compile-x32.bin:
163 $(CC) -mx32 -o $@ test-compile.c
165 $(OUTPUT)test-zlib.bin:
166 $(BUILD) -lz
168 $(OUTPUT)test-lzma.bin:
169 $(BUILD) -llzma
171 $(OUTPUT)test-get_cpuid.bin:
172 $(BUILD)
174 $(OUTPUT)test-bpf.bin:
175 $(BUILD)
177 -include $(OUTPUT)*.d
179 ###############################
181 clean:
182 rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)