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