Loading...
Note: File does not exist in v3.5.6.
1
2FILES= \
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 \
30 test-libdw-dwarf-unwind.bin
31
32CC := $(CROSS_COMPILE)gcc -MD
33PKG_CONFIG := $(CROSS_COMPILE)pkg-config
34
35all: $(FILES)
36
37BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS)
38
39###############################
40
41test-all.bin:
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
43
44test-hello.bin:
45 $(BUILD)
46
47test-stackprotector-all.bin:
48 $(BUILD) -Werror -fstack-protector-all
49
50test-fortify-source.bin:
51 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
52
53test-bionic.bin:
54 $(BUILD)
55
56test-libelf.bin:
57 $(BUILD) -lelf
58
59test-glibc.bin:
60 $(BUILD)
61
62test-dwarf.bin:
63 $(BUILD) -ldw
64
65test-libelf-mmap.bin:
66 $(BUILD) -lelf
67
68test-libelf-getphdrnum.bin:
69 $(BUILD) -lelf
70
71test-libnuma.bin:
72 $(BUILD) -lnuma
73
74test-libunwind.bin:
75 $(BUILD) -lelf
76
77test-libunwind-debug-frame.bin:
78 $(BUILD) -lelf
79
80test-libaudit.bin:
81 $(BUILD) -laudit
82
83test-libslang.bin:
84 $(BUILD) -I/usr/include/slang -lslang
85
86test-gtk2.bin:
87 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
88
89test-gtk2-infobar.bin:
90 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
91
92grep-libs = $(filter -l%,$(1))
93strip-libs = $(filter-out -l%,$(1))
94
95PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
96PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
97PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
98PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
99FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
100
101test-libperl.bin:
102 $(BUILD) $(FLAGS_PERL_EMBED)
103
104override PYTHON := python
105override PYTHON_CONFIG := python-config
106
107escape-for-shell-sq = $(subst ','\'',$(1))
108shell-sq = '$(escape-for-shell-sq)'
109
110PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
111
112PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
113PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
114PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
115PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
116FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
117
118test-libpython.bin:
119 $(BUILD) $(FLAGS_PYTHON_EMBED)
120
121test-libpython-version.bin:
122 $(BUILD) $(FLAGS_PYTHON_EMBED)
123
124test-libbfd.bin:
125 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
126
127test-liberty.bin:
128 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
129
130test-liberty-z.bin:
131 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
132
133test-cplus-demangle.bin:
134 $(BUILD) -liberty
135
136test-on-exit.bin:
137 $(BUILD)
138
139test-backtrace.bin:
140 $(BUILD)
141
142test-timerfd.bin:
143 $(BUILD)
144
145test-libdw-dwarf-unwind.bin:
146 $(BUILD)
147
148-include *.d
149
150###############################
151
152clean:
153 rm -f $(FILES) *.d