tools/perf/build: Fix timerfd feature check
[linux-2.6-block.git] / tools / perf / config / feature-checks / Makefile
CommitLineData
b6aa9979 1
3ae069cf 2FILES= \
f1138ec6
IM
3 test-all \
4 test-backtrace \
78e9d655 5 test-bionic \
8295d4e2 6 test-dwarf \
f1138ec6
IM
7 test-fortify-source \
8 test-glibc \
7ef9e055 9 test-gtk2 \
c7a79e96 10 test-gtk2-infobar \
f1138ec6
IM
11 test-hello \
12 test-libaudit \
13 test-libbfd \
1c47661a
IM
14 test-liberty \
15 test-liberty-z \
16 test-cplus-demangle \
f1138ec6
IM
17 test-libelf \
18 test-libelf-getphdrnum \
19 test-libelf-mmap \
20 test-libnuma \
7181a671 21 test-libperl \
9734163b 22 test-libpython \
95d061c8 23 test-libpython-version \
f1138ec6
IM
24 test-libslang \
25 test-libunwind \
f47671e2 26 test-libunwind-debug-frame \
34ef2162 27 test-on-exit \
f1138ec6 28 test-stackprotector-all \
87419c9a
DA
29 test-stackprotector \
30 test-timerfd
b6aa9979 31
8b6eb56a
IM
32CC := $(CC) -MD
33
b6aa9979
IM
34all: $(FILES)
35
28e962b9 36BUILD = $(CC) $(CFLAGS) $(LDFLAGS) -o $(OUTPUT)$@ $@.c
b6aa9979
IM
37
38###############################
39
baa9c30e 40test-all:
8a0c4c28 41 $(BUILD) -Werror -fstack-protector -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma $(LIBUNWIND_LIBS) -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
8b6eb56a 43test-hello:
b6aa9979
IM
44 $(BUILD)
45
90ac5422
IM
46test-stackprotector-all:
47 $(BUILD) -Werror -fstack-protector-all
48
430be5ab 49test-stackprotector:
046fa7ae 50 $(BUILD) -Werror -fstack-protector -Wstack-protector
430be5ab 51
1ea6f99e
IM
52test-fortify-source:
53 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
54
78e9d655
IM
55test-bionic:
56 $(BUILD)
57
8f7f8005
IM
58test-libelf:
59 $(BUILD) -lelf
60
e12762cf
IM
61test-glibc:
62 $(BUILD)
63
8295d4e2
IM
64test-dwarf:
65 $(BUILD) -ldw
66
8869b17e
IM
67test-libelf-mmap:
68 $(BUILD) -lelf
69
b7bcef6f
IM
70test-libelf-getphdrnum:
71 $(BUILD) -lelf
72
3ae069cf
IM
73test-libnuma:
74 $(BUILD) -lnuma
75
058f952d 76test-libunwind:
8a0c4c28 77 $(BUILD) $(LIBUNWIND_LIBS) -lelf
058f952d 78
d795a658
IM
79test-libaudit:
80 $(BUILD) -laudit
81
b9498b50
IM
82test-libslang:
83 $(BUILD) -I/usr/include/slang -lslang
84
7ef9e055
IM
85test-gtk2:
86 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
87
c7a79e96
IM
88test-gtk2-infobar:
89 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
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
100test-libperl:
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
117test-libpython:
118 $(BUILD) $(FLAGS_PYTHON_EMBED)
119
95d061c8
IM
120test-libpython-version:
121 $(BUILD) $(FLAGS_PYTHON_EMBED)
122
3b7646e4 123test-libbfd:
0dc09742 124 $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
3b7646e4 125
1c47661a 126test-liberty:
0dc09742 127 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
1c47661a
IM
128
129test-liberty-z:
0dc09742 130 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
1c47661a
IM
131
132test-cplus-demangle:
133 $(BUILD) -liberty
134
34ef2162
IM
135test-on-exit:
136 $(BUILD)
137
4cc9117a
IM
138test-backtrace:
139 $(BUILD)
140
87419c9a
DA
141test-timerfd:
142 $(BUILD)
143
231486a5 144-include *.d
8b6eb56a 145
b6aa9979
IM
146###############################
147
148clean:
8b6eb56a 149 rm -f $(FILES) *.d