~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to Makefile.am

  • Committer: Michael Hope
  • Date: 2012-06-12 03:33:40 UTC
  • Revision ID: michael.hope@linaro.org-20120612033340-p4ednk452cnshhts
Add a benchmark stub for memcmp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (c) 2011, Linaro Limited
2
2
# All rights reserved.
3
 
#
 
3
4
4
# Redistribution and use in source and binary forms, with or without
5
5
# modification, are permitted provided that the following conditions are met:
6
6
#     * Redistributions of source code must retain the above copyright
11
11
#     * Neither the name of the Linaro nor the
12
12
#       names of its contributors may be used to endorse or promote products
13
13
#       derived from this software without specific prior written permission.
14
 
#
 
14
15
15
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
16
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
17
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
21
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
22
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
23
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
 
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
24
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
25
25
#
26
26
 
27
27
# Top level Makefile for cortex-strings
29
29
# Used to record the compiler version in the executables
30
30
COMPILER = $(shell $(CC) --version 2>&1 | head -n1)
31
31
 
 
32
if WITH_NEON
 
33
# Pull in the NEON specific files
 
34
neon_sources = \
 
35
        src/linaro-a9/memcpy-hybrid.S
 
36
neon_bionic_sources = \
 
37
        reference/bionic/memcpy.S
 
38
neon_cppflags = -mfpu=neon
 
39
neon_dirs = neon
 
40
else
 
41
alternate_sources = \
 
42
        src/linaro-a9/memcpy.S
 
43
endif
 
44
 
32
45
# The main library
33
46
lib_LTLIBRARIES = \
34
47
        libcortex-strings.la
35
48
 
36
 
## Test suite
 
49
# Test suite
37
50
check_PROGRAMS = \
38
51
        tests/test-memchr \
39
 
        tests/test-memcmp \
40
52
        tests/test-memcpy \
41
 
        tests/test-memmove \
42
53
        tests/test-memset \
43
54
        tests/test-strchr \
44
55
        tests/test-strcmp \
45
56
        tests/test-strcpy \
46
 
        tests/test-strlen \
47
 
        tests/test-strncmp
 
57
        tests/test-strlen
 
58
 
 
59
# Benchmarks and example programs
 
60
noinst_PROGRAMS = \
 
61
        dhry \
 
62
        dhry-native \
 
63
        try-none \
 
64
        try-this \
 
65
        try-bionic \
 
66
        try-bionic-c \
 
67
        try-csl \
 
68
        try-glibc \
 
69
        try-glibc-c \
 
70
        try-newlib \
 
71
        try-newlib-c \
 
72
        try-newlib-xscale \
 
73
        try-plain
 
74
 
 
75
# Libraries used in the benchmarks and examples
 
76
noinst_LIBRARIES = \
 
77
        libbionic.a \
 
78
        libbionic-c.a \
 
79
        libcsl.a \
 
80
        libglibc.a \
 
81
        libglibc-c.a \
 
82
        libnewlib.a \
 
83
        libnewlib-c.a \
 
84
        libnewlib-xscale.a \
 
85
        libplain.a \
 
86
        libmulti.a
 
87
 
 
88
# Main library
 
89
libcortex_strings_la_SOURCES = \
 
90
        $(neon_sources) \
 
91
        $(alternate_sources) \
 
92
        src/thumb-2/strcpy.c \
 
93
        src/linaro-a9/memchr.s \
 
94
        src/linaro-a9/strchr.s \
 
95
        src/linaro-a9/strlen.s \
 
96
        src/linaro-a9/memset.S
 
97
 
 
98
libcortex_strings_la_LDFLAGS = -version-info 1:0:0
48
99
 
49
100
# Options for the tests
50
101
tests_cflags = -I$(srcdir)/tests $(AM_CFLAGS)
51
102
tests_ldadd = libcortex-strings.la
52
 
tests_test_memchr_LDADD = $(tests_ldadd)
53
 
tests_test_memchr_CFLAGS = $(tests_cflags)
54
 
tests_test_memcmp_LDADD = $(tests_ldadd)
55
 
tests_test_memcmp_CFLAGS = $(tests_cflags)
56
103
tests_test_memcpy_LDADD = $(tests_ldadd)
57
104
tests_test_memcpy_CFLAGS = $(tests_cflags)
58
 
tests_test_memmove_LDADD = $(tests_ldadd)
59
 
tests_test_memmove_CFLAGS = $(tests_cflags)
60
105
tests_test_memset_LDADD = $(tests_ldadd)
61
106
tests_test_memset_CFLAGS = $(tests_cflags)
62
 
tests_test_strchr_LDADD = $(tests_ldadd)
63
 
tests_test_strchr_CFLAGS = $(tests_cflags)
64
107
tests_test_strcmp_LDADD = $(tests_ldadd)
65
108
tests_test_strcmp_CFLAGS = $(tests_cflags)
66
109
tests_test_strcpy_LDADD = $(tests_ldadd)
67
110
tests_test_strcpy_CFLAGS = $(tests_cflags)
68
111
tests_test_strlen_LDADD = $(tests_ldadd)
69
112
tests_test_strlen_CFLAGS = $(tests_cflags)
70
 
tests_test_strncmp_LDADD = $(tests_ldadd)
71
 
tests_test_strncmp_CFLAGS = $(tests_cflags)
72
113
 
73
114
TESTS = $(check_PROGRAMS)
74
115
 
75
 
## Benchmarks
76
 
noinst_PROGRAMS = \
77
 
        dhry \
78
 
        dhry-native \
79
 
        try-none \
80
 
        try-this \
81
 
        try-plain \
82
 
        try-newlib-c \
83
 
        try-bionic-c \
84
 
        try-glibc-c
85
 
 
86
 
# Good 'ol Dhrystone
87
 
dhry_SOURCES = \
88
 
        benchmarks/dhry/dhry_1.c \
89
 
        benchmarks/dhry/dhry_2.c \
90
 
        benchmarks/dhry/dhry.h
91
 
 
92
 
dhry_CFLAGS = -Dcompiler="\"$(COMPILER)\"" -Doptions="\"$(CFLAGS)\""
93
 
dhry_LDADD = libcortex-strings.la
94
 
 
95
 
dhry_native_SOURCES = $(dhry_SOURCES)
96
 
dhry_native_CFLAGS = $(dhry_CFLAGS)
97
 
 
98
 
# Benchmark harness
99
 
noinst_LIBRARIES = \
100
 
        libmulti.a \
101
 
        libbionic-c.a \
102
 
        libglibc-c.a \
103
 
        libnewlib-c.a \
104
 
        libplain.a
105
 
 
106
 
libmulti_a_SOURCES = \
107
 
        benchmarks/multi/harness.c
108
 
 
109
 
libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS)
110
 
 
111
 
## Other architecture independant implementaions
 
116
# Libraries containing the difference reference versions
 
117
libbionic_a_SOURCES = \
 
118
        $(neon_bionic_sources) \
 
119
        reference/bionic/memcmp.S \
 
120
        reference/bionic/memset.S \
 
121
        reference/bionic/strcmp.S \
 
122
        reference/bionic/strcpy.S \
 
123
        reference/bionic/strlen.c
 
124
 
 
125
libbionic_a_CFLAGS = -Wa,-mimplicit-it=thumb
 
126
 
112
127
libbionic_c_a_SOURCES = \
113
128
        reference/bionic-c/bcopy.c \
114
129
        reference/bionic-c/memchr.c \
120
135
        reference/bionic-c/strcpy.c \
121
136
        reference/bionic-c/strlen.c
122
137
 
 
138
libcsl_a_SOURCES = \
 
139
        reference/csl/memcpy.c \
 
140
        reference/csl/memset.c \
 
141
        reference/csl/arm_asm.h
 
142
 
 
143
libglibc_a_SOURCES = \
 
144
        reference/glibc/memcpy.S \
 
145
        reference/glibc/memset.S \
 
146
        reference/glibc/strlen.S
 
147
 
123
148
libglibc_c_a_SOURCES = \
124
149
        reference/glibc-c/memchr.c \
125
150
        reference/glibc-c/memcmp.c \
134
159
        reference/glibc-c/memcopy.h \
135
160
        reference/glibc-c/pagecopy.h
136
161
 
 
162
libnewlib_a_SOURCES = \
 
163
        reference/newlib/memcpy.S \
 
164
        reference/newlib/strcmp.S \
 
165
        reference/newlib/strcpy.c \
 
166
        reference/newlib/strlen.c \
 
167
        reference/newlib/arm_asm.h \
 
168
        reference/newlib/shim.h
 
169
 
137
170
libnewlib_c_a_SOURCES = \
138
171
        reference/newlib-c/memchr.c \
139
172
        reference/newlib-c/memcmp.c \
145
178
        reference/newlib-c/strlen.c \
146
179
        reference/newlib-c/shim.h
147
180
 
148
 
libplain_a_SOURCES = \
149
 
        reference/plain/memset.c \
150
 
        reference/plain/memcpy.c \
151
 
        reference/plain/strcmp.c \
152
 
        reference/plain/strcpy.c
153
 
 
154
 
try_none_SOURCES =
155
 
try_none_LDADD = libmulti.a -lrt
156
 
try_this_SOURCES =
157
 
try_this_LDADD = libmulti.a libcortex-strings.la -lrt
158
 
try_bionic_c_SOURCES =
159
 
try_bionic_c_LDADD = libmulti.a libbionic-c.a -lrt
160
 
try_glibc_c_SOURCES =
161
 
try_glibc_c_LDADD = libmulti.a libglibc-c.a -lrt
162
 
try_newlib_c_SOURCES =
163
 
try_newlib_c_LDADD = libmulti.a libnewlib-c.a -lrt
164
 
try_plain_SOURCES =
165
 
try_plain_LDADD = libmulti.a libplain.a -lrt
166
 
 
167
 
# Architecture specific
168
 
 
169
 
if HOST_AARCH32
170
 
 
171
 
if WITH_NEON
172
 
# Pull in the NEON specific files
173
 
neon_sources = \
174
 
        src/linaro-a9/memcpy-hybrid.S
175
 
neon_bionic_sources = \
176
 
        reference/bionic/memcpy.S
177
 
neon_cppflags = -mfpu=neon
178
 
neon_dirs = neon
179
 
else
180
 
alternate_sources = \
181
 
        src/linaro-a9/memcpy.S
182
 
endif
183
 
 
184
 
# Benchmarks and example programs
185
 
noinst_PROGRAMS += \
186
 
        try-bionic \
187
 
        try-csl \
188
 
        try-glibc \
189
 
        try-newlib \
190
 
        try-newlib-xscale
191
 
 
192
 
# Libraries used in the benchmarks and examples
193
 
noinst_LIBRARIES += \
194
 
        libbionic.a \
195
 
        libcsl.a \
196
 
        libglibc.a \
197
 
        libnewlib.a \
198
 
        libnewlib-xscale.a
199
 
 
200
 
# Main library
201
 
libcortex_strings_la_SOURCES = \
202
 
        $(neon_sources) \
203
 
        $(alternate_sources) \
204
 
        src/thumb-2/strcpy.c \
205
 
        src/linaro-a9/memchr.S \
206
 
        src/linaro-a9/strchr.S \
207
 
        src/linaro-a9/strlen.S \
208
 
        src/linaro-a9/memset.S
209
 
 
210
 
# Libraries containing the difference reference versions
211
 
libbionic_a_SOURCES = \
212
 
        $(neon_bionic_sources) \
213
 
        reference/bionic/memcmp.S \
214
 
        reference/bionic/memset.S \
215
 
        reference/bionic/strcmp.S \
216
 
        reference/bionic/strcpy.S \
217
 
        reference/bionic/strlen.c
218
 
 
219
 
libbionic_a_CFLAGS = -Wa,-mimplicit-it=thumb
220
 
 
221
 
libcsl_a_SOURCES = \
222
 
        reference/csl/memcpy.c \
223
 
        reference/csl/memset.c \
224
 
        reference/csl/arm_asm.h
225
 
 
226
 
libglibc_a_SOURCES = \
227
 
        reference/glibc/memcpy.S \
228
 
        reference/glibc/memset.S \
229
 
        reference/glibc/strlen.S
230
 
 
231
 
libnewlib_a_SOURCES = \
232
 
        reference/newlib/memcpy.S \
233
 
        reference/newlib/strcmp.S \
234
 
        reference/newlib/strcpy.c \
235
 
        reference/newlib/strlen.c \
236
 
        reference/newlib/arm_asm.h \
237
 
        reference/newlib/shim.h
238
 
 
239
181
libnewlib_xscale_a_SOURCES = \
240
182
        reference/newlib-xscale/memchr.c \
241
183
        reference/newlib-xscale/memcpy.c \
246
188
        reference/newlib-xscale/strlen.c \
247
189
        reference/newlib-xscale/xscale.h
248
190
 
 
191
libplain_a_SOURCES = \
 
192
        reference/plain/memset.c \
 
193
        reference/plain/memcpy.c \
 
194
        reference/plain/strcmp.c \
 
195
        reference/plain/strcpy.c
 
196
 
 
197
libmulti_a_SOURCES = \
 
198
        benchmarks/multi/harness.c
 
199
 
 
200
libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS)
 
201
 
249
202
# Flags for the benchmark helpers
 
203
try_none_SOURCES =
 
204
try_none_LDADD = libmulti.a -lrt
 
205
try_this_SOURCES =
 
206
try_this_LDADD = libmulti.a libcortex-strings.la -lrt
250
207
try_bionic_SOURCES =
251
208
try_bionic_LDADD = libmulti.a libbionic.a -lrt
 
209
try_bionic_c_SOURCES =
 
210
try_bionic_c_LDADD = libmulti.a libbionic-c.a -lrt
252
211
try_csl_SOURCES =
253
212
try_csl_LDADD = libmulti.a libcsl.a -lrt
254
213
try_glibc_SOURCES =
255
214
try_glibc_LDADD = libmulti.a libglibc.a -lrt
 
215
try_glibc_c_SOURCES =
 
216
try_glibc_c_LDADD = libmulti.a libglibc-c.a -lrt
256
217
try_newlib_SOURCES =
257
218
try_newlib_LDADD = libmulti.a libnewlib.a -lrt
 
219
try_newlib_c_SOURCES =
 
220
try_newlib_c_LDADD = libmulti.a libnewlib-c.a -lrt
258
221
try_newlib_xscale_SOURCES =
259
222
try_newlib_xscale_LDADD = libmulti.a libnewlib-xscale.a -lrt
 
223
try_plain_SOURCES =
 
224
try_plain_LDADD = libmulti.a libplain.a -lrt
 
225
 
 
226
# Good 'ol Dhrystone
 
227
dhry_SOURCES = \
 
228
        benchmarks/dhry/dhry_1.c \
 
229
        benchmarks/dhry/dhry_2.c \
 
230
        benchmarks/dhry/dhry.h
 
231
 
 
232
dhry_CFLAGS = -Dcompiler="\"$(COMPILER)\"" -Doptions="\"$(CFLAGS)\""
 
233
dhry_LDADD = libcortex-strings.la
 
234
 
 
235
dhry_native_SOURCES = $(dhry_SOURCES)
 
236
dhry_native_CFLAGS = $(dhry_CFLAGS)
260
237
 
261
238
AM_CPPFLAGS = $(neon_cppflags)
262
 
 
263
 
endif
264
 
 
265
 
# aarch64 specific
266
 
if HOST_AARCH64
267
 
 
268
 
libcortex_strings_la_SOURCES = \
269
 
        src/aarch64/memcpy.S \
270
 
        src/aarch64/memmove.S \
271
 
        src/aarch64/memset.S \
272
 
        src/aarch64/strcmp.S
273
 
 
274
 
endif
275
 
 
276
 
libcortex_strings_la_LDFLAGS = -version-info 1:0:0
277
 
 
278
 
AM_CFLAGS = \
279
 
        -std=gnu99 -Wall \
 
239
AM_CFLAGS = -std=gnu99 -Wall \
280
240
        -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE \
281
 
        $(AM_CPPFLAGS)
282
 
 
283
 
if WITH_SUBMACHINE
284
 
AM_CFLAGS += \
285
 
        -mtune=$(submachine)
286
 
endif
 
241
        -mtune=$(submachine) $(AM_CPPFLAGS)
287
242
 
288
243
EXTRA_DIST = \
289
244
        tests/hp-timing.h \
290
245
        tests/test-string.h \
291
246
        tests/test-skeleton.c \
292
 
        scripts/add-license.sh \
293
 
        scripts/bench.py \
294
 
        scripts/fixup.py \
295
 
        scripts/libplot.py \
296
 
        scripts/plot-align.py \
297
 
        scripts/plot.py \
298
 
        scripts/plot-sizes.py \
299
 
        scripts/plot-top.py \
300
 
        scripts/trim.sh \
301
247
        autogen.sh
 
248
 
 
249
AM_DISTCHECK_CONFIGURE_FLAGS = --host=arm-linux-gnueabi