Linux 4.1.18
[linux/fpc-iii.git] / tools / build / feature / Makefile
blob463ed8f2a267bd6ad58f0a96656ea342574d3865
2 FILES= \
3 test-all.bin \
4 test-backtrace.bin \
5 test-bionic.bin \
6 test-dwarf.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-mmap.bin \
21 test-libnuma.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
38 CC := $(CROSS_COMPILE)gcc -MD
39 PKG_CONFIG := $(CROSS_COMPILE)pkg-config
41 all: $(FILES)
43 __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS)
44 BUILD = $(__BUILD) > $(OUTPUT)$(@:.bin=.make.output) 2>&1
46 ###############################
48 test-all.bin:
49 $(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
51 test-hello.bin:
52 $(BUILD)
54 test-pthread-attr-setaffinity-np.bin:
55 $(BUILD) -D_GNU_SOURCE -lpthread
57 test-stackprotector-all.bin:
58 $(BUILD) -fstack-protector-all
60 test-fortify-source.bin:
61 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
63 test-bionic.bin:
64 $(BUILD)
66 test-libelf.bin:
67 $(BUILD) -lelf
69 test-glibc.bin:
70 $(BUILD)
72 test-dwarf.bin:
73 $(BUILD) -ldw
75 test-libelf-mmap.bin:
76 $(BUILD) -lelf
78 test-libelf-getphdrnum.bin:
79 $(BUILD) -lelf
81 test-libnuma.bin:
82 $(BUILD) -lnuma
84 test-libunwind.bin:
85 $(BUILD) -lelf
87 test-libunwind-debug-frame.bin:
88 $(BUILD) -lelf
90 test-libaudit.bin:
91 $(BUILD) -laudit
93 test-libslang.bin:
94 $(BUILD) -I/usr/include/slang -lslang
96 test-gtk2.bin:
97 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
99 test-gtk2-infobar.bin:
100 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
102 grep-libs = $(filter -l%,$(1))
103 strip-libs = $(filter-out -l%,$(1))
105 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
106 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
107 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
108 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
109 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
111 test-libperl.bin:
112 $(BUILD) $(FLAGS_PERL_EMBED)
114 test-libpython.bin:
115 $(BUILD)
117 test-libpython-version.bin:
118 $(BUILD)
120 test-libbfd.bin:
121 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
123 test-liberty.bin:
124 $(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
126 test-liberty-z.bin:
127 $(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
129 test-cplus-demangle.bin:
130 $(BUILD) -liberty
132 test-backtrace.bin:
133 $(BUILD)
135 test-timerfd.bin:
136 $(BUILD)
138 test-libdw-dwarf-unwind.bin:
139 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
141 test-libbabeltrace.bin:
142 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
144 test-sync-compare-and-swap.bin:
145 $(BUILD)
147 test-compile-32.bin:
148 $(CC) -m32 -o $(OUTPUT)$@ test-compile.c
150 test-compile-x32.bin:
151 $(CC) -mx32 -o $(OUTPUT)$@ test-compile.c
153 test-zlib.bin:
154 $(BUILD) -lz
156 test-lzma.bin:
157 $(BUILD) -llzma
159 -include *.d
161 ###############################
163 clean:
164 rm -f $(FILES) *.d $(FILES:.bin=.make.output)