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

« back to all changes in this revision

Viewing changes to Makefile.am

  • Committer: Michael Hope
  • Date: 2012-12-12 00:59:50 UTC
  • Revision ID: michael.hope@linaro.org-20121212005950-g13oj3cqahsp52zx
Support for --host=TRIPLE to configure which is convenient for cross
building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 \
48
 
        tests/test-strnlen
 
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
49
99
 
50
100
# Options for the tests
51
101
tests_cflags = -I$(srcdir)/tests $(AM_CFLAGS)
52
102
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
103
tests_test_memcpy_LDADD = $(tests_ldadd)
58
104
tests_test_memcpy_CFLAGS = $(tests_cflags)
59
 
tests_test_memmove_LDADD = $(tests_ldadd)
60
 
tests_test_memmove_CFLAGS = $(tests_cflags)
61
105
tests_test_memset_LDADD = $(tests_ldadd)
62
106
tests_test_memset_CFLAGS = $(tests_cflags)
63
 
tests_test_strchr_LDADD = $(tests_ldadd)
64
 
tests_test_strchr_CFLAGS = $(tests_cflags)
65
107
tests_test_strcmp_LDADD = $(tests_ldadd)
66
108
tests_test_strcmp_CFLAGS = $(tests_cflags)
67
109
tests_test_strcpy_LDADD = $(tests_ldadd)
68
110
tests_test_strcpy_CFLAGS = $(tests_cflags)
69
111
tests_test_strlen_LDADD = $(tests_ldadd)
70
112
tests_test_strlen_CFLAGS = $(tests_cflags)
71
 
tests_test_strncmp_LDADD = $(tests_ldadd)
72
 
tests_test_strncmp_CFLAGS = $(tests_cflags)
73
113
 
74
114
TESTS = $(check_PROGRAMS)
75
115
 
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
 
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
 
113
127
libbionic_c_a_SOURCES = \
114
128
        reference/bionic-c/bcopy.c \
115
129
        reference/bionic-c/memchr.c \
121
135
        reference/bionic-c/strcpy.c \
122
136
        reference/bionic-c/strlen.c
123
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
 
124
148
libglibc_c_a_SOURCES = \
125
149
        reference/glibc-c/memchr.c \
126
150
        reference/glibc-c/memcmp.c \
135
159
        reference/glibc-c/memcopy.h \
136
160
        reference/glibc-c/pagecopy.h
137
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
 
138
170
libnewlib_c_a_SOURCES = \
139
171
        reference/newlib-c/memchr.c \
140
172
        reference/newlib-c/memcmp.c \
146
178
        reference/newlib-c/strlen.c \
147
179
        reference/newlib-c/shim.h
148
180
 
 
181
libnewlib_xscale_a_SOURCES = \
 
182
        reference/newlib-xscale/memchr.c \
 
183
        reference/newlib-xscale/memcpy.c \
 
184
        reference/newlib-xscale/memset.c \
 
185
        reference/newlib-xscale/strchr.c \
 
186
        reference/newlib-xscale/strcmp.c \
 
187
        reference/newlib-xscale/strcpy.c \
 
188
        reference/newlib-xscale/strlen.c \
 
189
        reference/newlib-xscale/xscale.h
 
190
 
149
191
libplain_a_SOURCES = \
150
192
        reference/plain/memset.c \
151
193
        reference/plain/memcpy.c \
152
194
        reference/plain/strcmp.c \
153
195
        reference/plain/strcpy.c
154
196
 
 
197
libmulti_a_SOURCES = \
 
198
        benchmarks/multi/harness.c
 
199
 
 
200
libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS)
 
201
 
 
202
# Flags for the benchmark helpers
155
203
try_none_SOURCES =
156
204
try_none_LDADD = libmulti.a -lrt
157
205
try_this_SOURCES =
158
206
try_this_LDADD = libmulti.a libcortex-strings.la -lrt
 
207
try_bionic_SOURCES =
 
208
try_bionic_LDADD = libmulti.a libbionic.a -lrt
159
209
try_bionic_c_SOURCES =
160
210
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_bionic_a9_sources = \
175
 
        reference/bionic-a9/memcpy.S \
176
 
        reference/bionic-a9/memset.S
177
 
neon_bionic_a15_sources = \
178
 
        reference/bionic-a15/memcpy.S \
179
 
        reference/bionic-a15/memset.S
180
 
fpu_flags = -mfpu=neon
181
 
else
182
 
if WITH_VFP
183
 
fpu_flags = -mfpu=vfp
184
 
else
185
 
fpu_flags = -msoft-float
186
 
endif
187
 
endif
188
 
 
189
 
# Benchmarks and example programs
190
 
noinst_PROGRAMS += \
191
 
        try-bionic-a9 \
192
 
        try-bionic-a15 \
193
 
        try-csl \
194
 
        try-glibc \
195
 
        try-newlib \
196
 
        try-newlib-xscale
197
 
 
198
 
# Libraries used in the benchmarks and examples
199
 
noinst_LIBRARIES += \
200
 
        libbionic-a9.a \
201
 
        libbionic-a15.a \
202
 
        libcsl.a \
203
 
        libglibc.a \
204
 
        libnewlib.a \
205
 
        libnewlib-xscale.a
206
 
 
207
 
# Main library
208
 
libcortex_strings_la_SOURCES = \
209
 
        src/thumb-2/strcpy.c \
210
 
        src/linaro-a9/memchr.S \
211
 
        src/linaro-a9/strchr.S \
212
 
        src/thumb-2/strlen.S \
213
 
        src/linaro-a9/memset.S \
214
 
        src/linaro-a9/memcpy.S
215
 
 
216
 
# Libraries containing the difference reference versions
217
 
libbionic_a9_a_SOURCES = \
218
 
        $(neon_bionic_a9_sources) \
219
 
        reference/bionic-a9/memcmp.S \
220
 
        reference/bionic-a9/strcmp.S \
221
 
        reference/bionic-a9/strcpy.S \
222
 
        reference/bionic-a9/strlen.c
223
 
 
224
 
libbionic_a9_a_CFLAGS = -Wa,-mimplicit-it=thumb
225
 
 
226
 
libbionic_a15_a_SOURCES = \
227
 
        $(neon_bionic_a15_sources) \
228
 
        reference/bionic-a15/memcmp.S \
229
 
        reference/bionic-a15/strcmp.S \
230
 
        reference/bionic-a15/strcpy.S \
231
 
        reference/bionic-a15/strlen.c
232
 
 
233
 
libbionic_a15_a_CFLAGS = -Wa,-mimplicit-it=thumb
234
 
 
235
 
libcsl_a_SOURCES = \
236
 
        reference/csl/memcpy.c \
237
 
        reference/csl/memset.c \
238
 
        reference/csl/arm_asm.h
239
 
 
240
 
libglibc_a_SOURCES = \
241
 
        reference/glibc/memcpy.S \
242
 
        reference/glibc/memset.S \
243
 
        reference/glibc/strlen.S
244
 
 
245
 
libnewlib_a_SOURCES = \
246
 
        reference/newlib/memcpy.S \
247
 
        reference/newlib/strcmp.S \
248
 
        reference/newlib/strcpy.c \
249
 
        reference/newlib/strlen.c \
250
 
        reference/newlib/arm_asm.h \
251
 
        reference/newlib/shim.h
252
 
 
253
 
libnewlib_xscale_a_SOURCES = \
254
 
        reference/newlib-xscale/memchr.c \
255
 
        reference/newlib-xscale/memcpy.c \
256
 
        reference/newlib-xscale/memset.c \
257
 
        reference/newlib-xscale/strchr.c \
258
 
        reference/newlib-xscale/strcmp.c \
259
 
        reference/newlib-xscale/strcpy.c \
260
 
        reference/newlib-xscale/strlen.c \
261
 
        reference/newlib-xscale/xscale.h
262
 
 
263
 
# Flags for the benchmark helpers
264
 
try_bionic_a9_SOURCES =
265
 
try_bionic_a9_LDADD = libmulti.a libbionic-a9.a -lrt
266
 
try_bionic_a15_SOURCES =
267
 
try_bionic_a15_LDADD = libmulti.a libbionic-a15.a -lrt
268
211
try_csl_SOURCES =
269
212
try_csl_LDADD = libmulti.a libcsl.a -lrt
270
213
try_glibc_SOURCES =
271
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
272
217
try_newlib_SOURCES =
273
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
274
221
try_newlib_xscale_SOURCES =
275
222
try_newlib_xscale_LDADD = libmulti.a libnewlib-xscale.a -lrt
276
 
 
277
 
AM_CPPFLAGS = $(fpu_flags)
278
 
AM_LDFLAGS = $(fpu_flags)
279
 
 
280
 
endif
281
 
 
282
 
# aarch64 specific
283
 
if HOST_AARCH64
284
 
 
285
 
libcortex_strings_la_SOURCES = \
286
 
        src/aarch64/memcmp.S \
287
 
        src/aarch64/memcpy.S \
288
 
        src/aarch64/memmove.S \
289
 
        src/aarch64/memset.S \
290
 
        src/aarch64/strcmp.S \
291
 
        src/aarch64/strlen.S \
292
 
        src/aarch64/strncmp.S \
293
 
        src/aarch64/strnlen.S
294
 
 
295
 
endif
296
 
 
297
 
libcortex_strings_la_LDFLAGS = -version-info 1:0:0
298
 
 
299
 
AM_CFLAGS = \
300
 
        -std=gnu99 -Wall \
 
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)
 
237
 
 
238
AM_CPPFLAGS = $(neon_cppflags)
 
239
AM_CFLAGS = -std=gnu99 -Wall \
301
240
        -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE \
302
 
        $(AM_CPPFLAGS)
303
 
 
304
 
if WITH_SUBMACHINE
305
 
AM_CFLAGS += \
306
 
        -mtune=$(submachine)
307
 
endif
 
241
        -mtune=$(submachine) $(AM_CPPFLAGS)
308
242
 
309
243
EXTRA_DIST = \
310
244
        tests/hp-timing.h \
320
254
        scripts/plot-top.py \
321
255
        scripts/trim.sh \
322
256
        autogen.sh
 
257
 
 
258
AM_DISTCHECK_CONFIGURE_FLAGS = --host=arm-linux-gnueabi