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

« back to all changes in this revision

Viewing changes to src/Makefile.am

  • Committer: Michael Hope
  • Date: 2010-09-02 00:46:57 UTC
  • Revision ID: michael.hope@linaro.org-20100902004657-4q6rn5888130zr3o
Pulled in the routines and packaged them up.

Show diffs side-by-side

added added

removed removed

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