perf symbols: add Java demangling support
[linux-2.6-block.git] / tools / build / feature / Makefile
CommitLineData
3ae069cf 1FILES= \
56560ec6
CC
2 test-all.bin \
3 test-backtrace.bin \
4 test-bionic.bin \
5 test-dwarf.bin \
6 test-fortify-source.bin \
f6d31369 7 test-sync-compare-and-swap.bin \
56560ec6
CC
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 \
f8ac8606 21 test-numa_num_possible_cpus.bin \
56560ec6
CC
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 \
459a3df7 28 test-pthread-attr-setaffinity-np.bin \
56560ec6 29 test-stackprotector-all.bin \
45757895 30 test-timerfd.bin \
e477f3f0 31 test-libdw-dwarf-unwind.bin \
53d0a573 32 test-libbabeltrace.bin \
e477f3f0 33 test-compile-32.bin \
e92ce12e 34 test-compile-x32.bin \
6c6f0f61 35 test-zlib.bin \
1b76c13e 36 test-lzma.bin \
b0063dbf
ACM
37 test-bpf.bin \
38 test-get_cpuid.bin
b6aa9979 39
1925459b
JP
40FILES := $(addprefix $(OUTPUT),$(FILES))
41
a8a5cd8b
MR
42CC := $(CROSS_COMPILE)gcc -MD
43PKG_CONFIG := $(CROSS_COMPILE)pkg-config
8b6eb56a 44
b6aa9979
IM
45all: $(FILES)
46
1925459b
JP
47__BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
48 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
b6aa9979
IM
49
50###############################
51
1925459b 52$(OUTPUT)test-all.bin:
6c6f0f61 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
baa9c30e 54
1925459b 55$(OUTPUT)test-hello.bin:
b6aa9979
IM
56 $(BUILD)
57
1925459b 58$(OUTPUT)test-pthread-attr-setaffinity-np.bin:
b49f1a4b 59 $(BUILD) -D_GNU_SOURCE -lpthread
459a3df7 60
1925459b 61$(OUTPUT)test-stackprotector-all.bin:
b49f1a4b 62 $(BUILD) -fstack-protector-all
90ac5422 63
1925459b 64$(OUTPUT)test-fortify-source.bin:
b49f1a4b 65 $(BUILD) -O2 -D_FORTIFY_SOURCE=2
1ea6f99e 66
1925459b 67$(OUTPUT)test-bionic.bin:
78e9d655
IM
68 $(BUILD)
69
1925459b 70$(OUTPUT)test-libelf.bin:
8f7f8005
IM
71 $(BUILD) -lelf
72
1925459b 73$(OUTPUT)test-glibc.bin:
e12762cf
IM
74 $(BUILD)
75
7aec51cb
AK
76DWARFLIBS := -ldw
77ifeq ($(findstring -static,${LDFLAGS}),-static)
78DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
79endif
80
1925459b 81$(OUTPUT)test-dwarf.bin:
7aec51cb 82 $(BUILD) $(DWARFLIBS)
8295d4e2 83
1925459b 84$(OUTPUT)test-libelf-mmap.bin:
8869b17e
IM
85 $(BUILD) -lelf
86
1925459b 87$(OUTPUT)test-libelf-getphdrnum.bin:
b7bcef6f
IM
88 $(BUILD) -lelf
89
1925459b 90$(OUTPUT)test-libnuma.bin:
3ae069cf
IM
91 $(BUILD) -lnuma
92
1925459b 93$(OUTPUT)test-numa_num_possible_cpus.bin:
f8ac8606
ACM
94 $(BUILD) -lnuma
95
1925459b 96$(OUTPUT)test-libunwind.bin:
1448fef4 97 $(BUILD) -lelf
058f952d 98
1925459b 99$(OUTPUT)test-libunwind-debug-frame.bin:
1448fef4 100 $(BUILD) -lelf
e310718d 101
1925459b 102$(OUTPUT)test-libaudit.bin:
d795a658
IM
103 $(BUILD) -laudit
104
1925459b 105$(OUTPUT)test-libslang.bin:
b9498b50
IM
106 $(BUILD) -I/usr/include/slang -lslang
107
1925459b 108$(OUTPUT)test-gtk2.bin:
a8a5cd8b 109 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
7ef9e055 110
1925459b 111$(OUTPUT)test-gtk2-infobar.bin:
a8a5cd8b 112 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
c7a79e96 113
7181a671
IM
114grep-libs = $(filter -l%,$(1))
115strip-libs = $(filter-out -l%,$(1))
116
117PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
118PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
119PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
120PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
121FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
122
1925459b 123$(OUTPUT)test-libperl.bin:
7181a671
IM
124 $(BUILD) $(FLAGS_PERL_EMBED)
125
1925459b 126$(OUTPUT)test-libpython.bin:
56c7d79e 127 $(BUILD)
9734163b 128
1925459b 129$(OUTPUT)test-libpython-version.bin:
56c7d79e 130 $(BUILD)
95d061c8 131
1925459b 132$(OUTPUT)test-libbfd.bin:
280e7c48 133 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
3b7646e4 134
1925459b
JP
135$(OUTPUT)test-liberty.bin:
136 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
1c47661a 137
1925459b
JP
138$(OUTPUT)test-liberty-z.bin:
139 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
1c47661a 140
1925459b 141$(OUTPUT)test-cplus-demangle.bin:
1c47661a
IM
142 $(BUILD) -liberty
143
1925459b 144$(OUTPUT)test-backtrace.bin:
4cc9117a
IM
145 $(BUILD)
146
1925459b 147$(OUTPUT)test-timerfd.bin:
87419c9a
DA
148 $(BUILD)
149
1925459b 150$(OUTPUT)test-libdw-dwarf-unwind.bin:
53d0a573
JO
151 $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
152
1925459b 153$(OUTPUT)test-libbabeltrace.bin:
53d0a573 154 $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
45757895 155
1925459b 156$(OUTPUT)test-sync-compare-and-swap.bin:
b49f1a4b 157 $(BUILD)
f6d31369 158
1925459b
JP
159$(OUTPUT)test-compile-32.bin:
160 $(CC) -m32 -o $@ test-compile.c
e477f3f0 161
1925459b
JP
162$(OUTPUT)test-compile-x32.bin:
163 $(CC) -mx32 -o $@ test-compile.c
e477f3f0 164
1925459b 165$(OUTPUT)test-zlib.bin:
e92ce12e
NK
166 $(BUILD) -lz
167
1925459b 168$(OUTPUT)test-lzma.bin:
6c6f0f61
JO
169 $(BUILD) -llzma
170
1925459b 171$(OUTPUT)test-get_cpuid.bin:
b0063dbf
ACM
172 $(BUILD)
173
1925459b 174$(OUTPUT)test-bpf.bin:
1b76c13e
WN
175 $(BUILD)
176
1925459b 177-include $(OUTPUT)*.d
8b6eb56a 178
b6aa9979
IM
179###############################
180
181clean:
1925459b 182 rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)