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