]> git.karo-electronics.de Git - karo-tx-linux.git/blob - tools/perf/config/feature-checks/Makefile
tools/perf/build: Split out feature check: 'libperl'
[karo-tx-linux.git] / tools / perf / config / feature-checks / Makefile
1
2 FILES=                                  \
3         test-hello                      \
4         test-stackprotector-all         \
5         test-stackprotector             \
6         test-volatile-register-var      \
7         test-fortify-source             \
8         test-bionic                     \
9         test-libelf                     \
10         test-glibc                      \
11         test-dwarf                      \
12         test-libelf-mmap                \
13         test-libelf-getphdrnum          \
14         test-libunwind                  \
15         test-libaudit                   \
16         test-libslang                   \
17         test-gtk2                       \
18         test-gtk2-infobar               \
19         test-libperl                    \
20         test-libnuma
21
22 CC := $(CC) -MD
23
24 all: $(FILES)
25
26 BUILD = $(CC) -o $(OUTPUT)$@ $@.c
27
28 ###############################
29
30 test-hello:
31         $(BUILD)
32
33 test-stackprotector-all:
34         $(BUILD) -Werror -fstack-protector-all
35
36 test-stackprotector:
37         $(BUILD) -Werror -fstack-protector
38
39 test-volatile-register-var:
40         $(BUILD) -Werror -Wvolatile-register-var
41
42 test-fortify-source:
43         $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
44
45 test-bionic:
46         $(BUILD)
47
48 test-libelf:
49         $(BUILD) -lelf
50
51 test-glibc:
52         $(BUILD)
53
54 test-dwarf:
55         $(BUILD) -ldw
56
57 test-libelf-mmap:
58         $(BUILD) -lelf
59
60 test-libelf-getphdrnum:
61         $(BUILD) -lelf
62
63 test-libnuma:
64         $(BUILD) -lnuma
65
66 test-libunwind:
67         $(BUILD) -lunwind -lunwind-x86_64 -lelf
68
69 test-libaudit:
70         $(BUILD) -laudit
71
72 test-libslang:
73         $(BUILD) -I/usr/include/slang -lslang
74
75 test-gtk2:
76         $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
77
78 test-gtk2-infobar:
79         $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
80
81 grep-libs  = $(filter -l%,$(1))
82 strip-libs = $(filter-out -l%,$(1))
83
84 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
85 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
86 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
87 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
88 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
89
90 test-libperl:
91         $(BUILD) $(FLAGS_PERL_EMBED)
92
93 -include *.d */*.d
94
95 ###############################
96
97 clean:
98         rm -f $(FILES) *.d