Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / tools / perf / config / feature-checks / 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 \
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-libperl.bin \
22 test-libpython.bin \
23 test-libpython-version.bin \
24 test-libslang.bin \
25 test-libunwind.bin \
26 test-libunwind-debug-frame.bin \
27 test-on-exit.bin \
28 test-stackprotector-all.bin \
29 test-timerfd.bin
b6aa9979 30
a8a5cd8b
MR
31CC := $(CROSS_COMPILE)gcc -MD
32PKG_CONFIG := $(CROSS_COMPILE)pkg-config
8b6eb56a 33
b6aa9979
IM
34all: $(FILES)
35
56560ec6 36BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS)
b6aa9979
IM
37
38###############################
39
56560ec6 40test-all.bin:
a8a5cd8b 41 $(BUILD) -Werror -fstack-protector-all -O2 -Werror -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
baa9c30e 42
56560ec6 43test-hello.bin:
b6aa9979
IM
44 $(BUILD)
45
56560ec6 46test-stackprotector-all.bin:
90ac5422
IM
47 $(BUILD) -Werror -fstack-protector-all
48
56560ec6 49test-fortify-source.bin:
1ea6f99e
IM
50 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
51
56560ec6 52test-bionic.bin:
78e9d655
IM
53 $(BUILD)
54
56560ec6 55test-libelf.bin:
8f7f8005
IM
56 $(BUILD) -lelf
57
56560ec6 58test-glibc.bin:
e12762cf
IM
59 $(BUILD)
60
56560ec6 61test-dwarf.bin:
8295d4e2
IM
62 $(BUILD) -ldw
63
56560ec6 64test-libelf-mmap.bin:
8869b17e
IM
65 $(BUILD) -lelf
66
56560ec6 67test-libelf-getphdrnum.bin:
b7bcef6f
IM
68 $(BUILD) -lelf
69
56560ec6 70test-libnuma.bin:
3ae069cf
IM
71 $(BUILD) -lnuma
72
56560ec6 73test-libunwind.bin:
1448fef4 74 $(BUILD) -lelf
058f952d 75
56560ec6 76test-libunwind-debug-frame.bin:
1448fef4 77 $(BUILD) -lelf
e310718d 78
56560ec6 79test-libaudit.bin:
d795a658
IM
80 $(BUILD) -laudit
81
56560ec6 82test-libslang.bin:
b9498b50
IM
83 $(BUILD) -I/usr/include/slang -lslang
84
56560ec6 85test-gtk2.bin:
a8a5cd8b 86 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
7ef9e055 87
56560ec6 88test-gtk2-infobar.bin:
a8a5cd8b 89 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
c7a79e96 90
7181a671
IM
91grep-libs = $(filter -l%,$(1))
92strip-libs = $(filter-out -l%,$(1))
93
94PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
95PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
96PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
97PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
98FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
99
56560ec6 100test-libperl.bin:
7181a671
IM
101 $(BUILD) $(FLAGS_PERL_EMBED)
102
9734163b
IM
103override PYTHON := python
104override PYTHON_CONFIG := python-config
105
106escape-for-shell-sq = $(subst ','\'',$(1))
107shell-sq = '$(escape-for-shell-sq)'
108
109PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
110
111PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
112PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
113PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
114PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
115FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
116
56560ec6 117test-libpython.bin:
9734163b
IM
118 $(BUILD) $(FLAGS_PYTHON_EMBED)
119
56560ec6 120test-libpython-version.bin:
95d061c8
IM
121 $(BUILD) $(FLAGS_PYTHON_EMBED)
122
56560ec6 123test-libbfd.bin:
0dc09742 124 $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
3b7646e4 125
56560ec6 126test-liberty.bin:
0dc09742 127 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
1c47661a 128
56560ec6 129test-liberty-z.bin:
0dc09742 130 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
1c47661a 131
56560ec6 132test-cplus-demangle.bin:
1c47661a
IM
133 $(BUILD) -liberty
134
56560ec6 135test-on-exit.bin:
34ef2162
IM
136 $(BUILD)
137
56560ec6 138test-backtrace.bin:
4cc9117a
IM
139 $(BUILD)
140
56560ec6 141test-timerfd.bin:
87419c9a
DA
142 $(BUILD)
143
231486a5 144-include *.d
8b6eb56a 145
b6aa9979
IM
146###############################
147
148clean:
8b6eb56a 149 rm -f $(FILES) *.d