tools/perf/build: Fix feature-libunwind-debug-frame handling
[deliverable/linux.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
e310718d
IM
79test-libunwind-debug-frame:
80 $(BUILD) $(LIBUNWIND_LIBS) -lelf
81
d795a658
IM
82test-libaudit:
83 $(BUILD) -laudit
84
b9498b50
IM
85test-libslang:
86 $(BUILD) -I/usr/include/slang -lslang
87
7ef9e055
IM
88test-gtk2:
89 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
90
c7a79e96
IM
91test-gtk2-infobar:
92 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
93
7181a671
IM
94grep-libs = $(filter -l%,$(1))
95strip-libs = $(filter-out -l%,$(1))
96
97PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
98PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
99PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
100PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
101FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
102
103test-libperl:
104 $(BUILD) $(FLAGS_PERL_EMBED)
105
9734163b
IM
106override PYTHON := python
107override PYTHON_CONFIG := python-config
108
109escape-for-shell-sq = $(subst ','\'',$(1))
110shell-sq = '$(escape-for-shell-sq)'
111
112PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
113
114PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
115PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
116PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
117PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
118FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
119
120test-libpython:
121 $(BUILD) $(FLAGS_PYTHON_EMBED)
122
95d061c8
IM
123test-libpython-version:
124 $(BUILD) $(FLAGS_PYTHON_EMBED)
125
3b7646e4 126test-libbfd:
0dc09742 127 $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
3b7646e4 128
1c47661a 129test-liberty:
0dc09742 130 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
1c47661a
IM
131
132test-liberty-z:
0dc09742 133 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
1c47661a
IM
134
135test-cplus-demangle:
136 $(BUILD) -liberty
137
34ef2162
IM
138test-on-exit:
139 $(BUILD)
140
4cc9117a
IM
141test-backtrace:
142 $(BUILD)
143
87419c9a
DA
144test-timerfd:
145 $(BUILD)
146
231486a5 147-include *.d
8b6eb56a 148
b6aa9979
IM
149###############################
150
151clean:
8b6eb56a 152 rm -f $(FILES) *.d
This page took 0.082047 seconds and 5 git commands to generate.