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