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