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

« back to all changes in this revision

Viewing changes to Makefile.am

  • Committer: Michael Hope
  • Date: 2010-09-13 07:53:58 UTC
  • Revision ID: michael.hope@linaro.org-20100913075358-386yj5lqacpw2hh5
Minor readme update before 0.1.1

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
1
# Top level Makefile for cortex-strings
28
2
 
29
3
# Used to record the compiler version in the executables
33
7
lib_LTLIBRARIES = \
34
8
        libcortex-strings.la
35
9
 
36
 
## Test suite
 
10
# Test suite
37
11
check_PROGRAMS = \
38
 
        tests/test-memchr \
39
 
        tests/test-memcmp \
40
12
        tests/test-memcpy \
41
 
        tests/test-memmove \
42
13
        tests/test-memset \
43
 
        tests/test-strchr \
44
14
        tests/test-strcmp \
45
15
        tests/test-strcpy \
46
 
        tests/test-strlen \
47
 
        tests/test-strncmp
48
 
 
49
 
# Options for the tests
50
 
tests_cflags = -I$(srcdir)/tests $(AM_CFLAGS)
51
 
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
 
tests_test_memcpy_LDADD = $(tests_ldadd)
57
 
tests_test_memcpy_CFLAGS = $(tests_cflags)
58
 
tests_test_memmove_LDADD = $(tests_ldadd)
59
 
tests_test_memmove_CFLAGS = $(tests_cflags)
60
 
tests_test_memset_LDADD = $(tests_ldadd)
61
 
tests_test_memset_CFLAGS = $(tests_cflags)
62
 
tests_test_strchr_LDADD = $(tests_ldadd)
63
 
tests_test_strchr_CFLAGS = $(tests_cflags)
64
 
tests_test_strcmp_LDADD = $(tests_ldadd)
65
 
tests_test_strcmp_CFLAGS = $(tests_cflags)
66
 
tests_test_strcpy_LDADD = $(tests_ldadd)
67
 
tests_test_strcpy_CFLAGS = $(tests_cflags)
68
 
tests_test_strlen_LDADD = $(tests_ldadd)
69
 
tests_test_strlen_CFLAGS = $(tests_cflags)
70
 
tests_test_strncmp_LDADD = $(tests_ldadd)
71
 
tests_test_strncmp_CFLAGS = $(tests_cflags)
72
 
 
73
 
TESTS = $(check_PROGRAMS)
74
 
 
75
 
## Benchmarks
 
16
        tests/test-strlen
 
17
 
 
18
# Benchmarks and example programs
76
19
noinst_PROGRAMS = \
77
20
        dhry \
78
21
        dhry-native \
79
22
        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
112
 
libbionic_c_a_SOURCES = \
113
 
        reference/bionic-c/bcopy.c \
114
 
        reference/bionic-c/memchr.c \
115
 
        reference/bionic-c/memcmp.c \
116
 
        reference/bionic-c/memcpy.c \
117
 
        reference/bionic-c/memset.c \
118
 
        reference/bionic-c/strchr.c \
119
 
        reference/bionic-c/strcmp.c \
120
 
        reference/bionic-c/strcpy.c \
121
 
        reference/bionic-c/strlen.c
122
 
 
123
 
libglibc_c_a_SOURCES = \
124
 
        reference/glibc-c/memchr.c \
125
 
        reference/glibc-c/memcmp.c \
126
 
        reference/glibc-c/memcpy.c \
127
 
        reference/glibc-c/memset.c \
128
 
        reference/glibc-c/strchr.c \
129
 
        reference/glibc-c/strcmp.c \
130
 
        reference/glibc-c/strcpy.c \
131
 
        reference/glibc-c/strlen.c \
132
 
        reference/glibc-c/wordcopy.c \
133
 
        reference/glibc-c/bp-checks.h \
134
 
        reference/glibc-c/memcopy.h \
135
 
        reference/glibc-c/pagecopy.h
136
 
 
137
 
libnewlib_c_a_SOURCES = \
138
 
        reference/newlib-c/memchr.c \
139
 
        reference/newlib-c/memcmp.c \
140
 
        reference/newlib-c/memcpy.c \
141
 
        reference/newlib-c/memset.c \
142
 
        reference/newlib-c/strchr.c \
143
 
        reference/newlib-c/strcmp.c \
144
 
        reference/newlib-c/strcpy.c \
145
 
        reference/newlib-c/strlen.c \
146
 
        reference/newlib-c/shim.h
147
 
 
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 += \
 
23
        try-all \
186
24
        try-bionic \
187
25
        try-csl \
188
26
        try-glibc \
189
27
        try-newlib \
190
 
        try-newlib-xscale
 
28
        try-plain
191
29
 
192
30
# Libraries used in the benchmarks and examples
193
 
noinst_LIBRARIES += \
 
31
noinst_LIBRARIES = \
194
32
        libbionic.a \
195
33
        libcsl.a \
196
34
        libglibc.a \
197
35
        libnewlib.a \
198
 
        libnewlib-xscale.a
 
36
        libplain.a \
 
37
        libmulti.a
199
38
 
200
39
# Main library
201
40
libcortex_strings_la_SOURCES = \
202
 
        $(neon_sources) \
203
 
        $(alternate_sources) \
 
41
        src/neon/memcpy.S \
 
42
        src/neon/memset.S \
 
43
        src/thumb-2/strcmp.c \
204
44
        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
 
45
        src/thumb-2/strlen.c
 
46
 
 
47
# Options for the tests
 
48
tests_test_memcpy_LDADD = libcortex-strings.la
 
49
tests_test_memcpy_CFLAGS = -Itests $(AM_CFLAGS)
 
50
tests_test_memset_LDADD = libcortex-strings.la
 
51
tests_test_memset_CFLAGS = -Itests $(AM_CFLAGS)
 
52
tests_test_strcmp_LDADD = libcortex-strings.la
 
53
tests_test_strcmp_CFLAGS = -Itests $(AM_CFLAGS)
 
54
tests_test_strcpy_LDADD = libcortex-strings.la
 
55
tests_test_strcpy_CFLAGS = -Itests $(AM_CFLAGS)
 
56
tests_test_strlen_LDADD = libcortex-strings.la
 
57
tests_test_strlen_CFLAGS = -Itests $(AM_CFLAGS)
 
58
 
 
59
TESTS = $(check_PROGRAMS)
209
60
 
210
61
# Libraries containing the difference reference versions
211
62
libbionic_a_SOURCES = \
212
 
        $(neon_bionic_sources) \
213
63
        reference/bionic/memcmp.S \
 
64
        reference/bionic/memcmp16.S \
 
65
        reference/bionic/strlen.c \
214
66
        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
 
67
        reference/bionic/memcpy.S
220
68
 
221
69
libcsl_a_SOURCES = \
222
70
        reference/csl/memcpy.c \
223
 
        reference/csl/memset.c \
224
 
        reference/csl/arm_asm.h
 
71
        reference/csl/memset.c
225
72
 
226
73
libglibc_a_SOURCES = \
227
 
        reference/glibc/memcpy.S \
 
74
        reference/glibc/memmove.S \
228
75
        reference/glibc/memset.S \
229
 
        reference/glibc/strlen.S
 
76
        reference/glibc/strlen.S \
 
77
        reference/glibc/memcpy.S
230
78
 
231
79
libnewlib_a_SOURCES = \
232
 
        reference/newlib/memcpy.S \
233
 
        reference/newlib/strcmp.S \
234
 
        reference/newlib/strcpy.c \
 
80
        reference/newlib/strcmp.c \
235
81
        reference/newlib/strlen.c \
236
 
        reference/newlib/arm_asm.h \
237
 
        reference/newlib/shim.h
238
 
 
239
 
libnewlib_xscale_a_SOURCES = \
240
 
        reference/newlib-xscale/memchr.c \
241
 
        reference/newlib-xscale/memcpy.c \
242
 
        reference/newlib-xscale/memset.c \
243
 
        reference/newlib-xscale/strchr.c \
244
 
        reference/newlib-xscale/strcmp.c \
245
 
        reference/newlib-xscale/strcpy.c \
246
 
        reference/newlib-xscale/strlen.c \
247
 
        reference/newlib-xscale/xscale.h
 
82
        reference/newlib/strcpy.c
 
83
 
 
84
libplain_a_SOURCES = \
 
85
        reference/plain/memset.c \
 
86
        reference/plain/memcpy.c \
 
87
        reference/plain/strcmp.c \
 
88
        reference/plain/strcpy.c
 
89
 
 
90
libmulti_a_SOURCES = \
 
91
        benchmarks/multi/harness.c
 
92
 
 
93
libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS)
248
94
 
249
95
# Flags for the benchmark helpers
 
96
try_none_SOURCES =
 
97
try_none_LDFLAGS = -lrt
 
98
try_none_LDADD = libmulti.a
 
99
try_all_SOURCES =
 
100
try_all_LDFLAGS = -lrt
 
101
try_all_LDADD = libmulti.a libcortex-strings.la
250
102
try_bionic_SOURCES =
251
 
try_bionic_LDADD = libmulti.a libbionic.a -lrt
 
103
try_bionic_LDFLAGS = -lrt
 
104
try_bionic_LDADD = libmulti.a libbionic.a
252
105
try_csl_SOURCES =
253
 
try_csl_LDADD = libmulti.a libcsl.a -lrt
 
106
try_csl_LDFLAGS = -lrt
 
107
try_csl_LDADD = libmulti.a libcsl.a
254
108
try_glibc_SOURCES =
255
 
try_glibc_LDADD = libmulti.a libglibc.a -lrt
 
109
try_glibc_LDFLAGS = -lrt
 
110
try_glibc_LDADD = libmulti.a libglibc.a
256
111
try_newlib_SOURCES =
257
 
try_newlib_LDADD = libmulti.a libnewlib.a -lrt
258
 
try_newlib_xscale_SOURCES =
259
 
try_newlib_xscale_LDADD = libmulti.a libnewlib-xscale.a -lrt
260
 
 
261
 
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 \
280
 
        -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE \
281
 
        $(AM_CPPFLAGS)
282
 
 
283
 
if WITH_SUBMACHINE
284
 
AM_CFLAGS += \
285
 
        -mtune=$(submachine)
286
 
endif
287
 
 
288
 
EXTRA_DIST = \
289
 
        tests/hp-timing.h \
290
 
        tests/test-string.h \
291
 
        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
 
        autogen.sh
 
112
try_newlib_LDFLAGS = -lrt
 
113
try_newlib_LDADD = libmulti.a libnewlib.a
 
114
try_plain_SOURCES =
 
115
try_plain_LDFLAGS = -lrt
 
116
try_plain_LDADD = libmulti.a libplain.a
 
117
 
 
118
# Good 'ol Dhrystone
 
119
dhry_SOURCES = \
 
120
        benchmarks/dhry/dhry_1.c \
 
121
        benchmarks/dhry/dhry_2.c
 
122
 
 
123
dhry_CFLAGS = -Dcompiler="\"$(COMPILER)\"" -Doptions="\"$(CFLAGS)\""
 
124
dhry_LDADD = libcortex-strings.la
 
125
 
 
126
dhry_native_SOURCES = $(dhry_SOURCES)
 
127
dhry_native_CFLAGS = $(dhry_CFLAGS)
 
128
 
 
129
AM_CPPFLAGS = $(if $(filter yes,$(with_neon)),-mfpu=neon)
 
130
AM_CFLAGS = -std=gnu99 -Wall $(AM_CPPFLAGS)
 
131
 
 
132
add_on_dist = add-on-dist
 
133
add_on_dest = $(add_on_dist)/$(PACKAGE)/sysdeps/arm/eabi/arm/$(submachine)
 
134
add_on_dirs = thumb-2 $(submachine) $(if $(filter yes,$(with_neon)),neon)
 
135
add_on_src = \
 
136
        $(wildcard $(add_on_dirs:%=$(srcdir)/src/%/*.c)) \
 
137
        $(wildcard $(add_on_dirs:%=$(srcdir)/src/%/*.S)) \
 
138
        $(wildcard $(add_on_dirs:%=$(srcdir)/src/%/*.h))
 
139
 
 
140
add-on:
 
141
        rm -rf $(add_on_dist)
 
142
        mkdir -p $(add_on_dest)
 
143
        cp -f $(add_on_src) $(add_on_dest)
 
144
        python $(srcdir)/scripts/fixup.py GLIBC $(add_on_dest)/*
 
145
        tar cf $(PACKAGE).tar -C $(add_on_dist) .