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

« back to all changes in this revision

Viewing changes to Makefile.am

  • Committer: Dr. David Alan Gilbert
  • Date: 2011-02-10 18:39:03 UTC
  • Revision ID: david.gilbert@linaro.org-20110210183903-35d3te7ercbhv1d4
Import of fast memchr, strlen and simple strchr from Dave Gilbert's repo

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Top level Makefile for cortex-strings
 
2
 
 
3
# Used to record the compiler version in the executables
 
4
COMPILER = $(shell $(CC) --version 2>&1 | head -n1)
 
5
 
 
6
if WITH_NEON
 
7
# Pull in the NEON specific files
 
8
neon_sources = \
 
9
        src/neon/memcpy.S \
 
10
        src/neon/memset.S
 
11
neon_bionic_sources = \
 
12
        reference/bionic/memcpy.S
 
13
neon_cppflags = -mfpu=neon
 
14
neon_dirs = neon
 
15
endif
 
16
 
 
17
# The main library
1
18
lib_LTLIBRARIES = \
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
 
 
 
19
        libcortex-strings.la
 
20
 
 
21
# Test suite
 
22
check_PROGRAMS = \
 
23
        tests/test-memcpy \
 
24
        tests/test-memset \
 
25
        tests/test-strcmp \
 
26
        tests/test-strcpy \
 
27
        tests/test-strlen
 
28
 
 
29
# Benchmarks and example programs
 
30
noinst_PROGRAMS = \
 
31
        dhry \
 
32
        dhry-native \
 
33
        try-none \
 
34
        try-all \
 
35
        try-bionic \
 
36
        try-csl \
 
37
        try-glibc \
 
38
        try-newlib \
 
39
        try-plain
 
40
 
 
41
# Libraries used in the benchmarks and examples
 
42
noinst_LIBRARIES = \
 
43
        libbionic.a \
 
44
        libcsl.a \
 
45
        libglibc.a \
 
46
        libnewlib.a \
 
47
        libplain.a \
 
48
        libmulti.a
 
49
 
 
50
# Main library
 
51
libcortex_strings_la_SOURCES = \
 
52
        $(neon_sources) \
 
53
        src/thumb-2/strcmp.c \
 
54
        src/thumb-2/strcpy.c \
 
55
        src/thumb-2/strlen.c
 
56
 
 
57
# Options for the tests
 
58
tests_cflags = -I$(srcdir)/tests $(AM_CFLAGS)
 
59
tests_ldadd = libcortex-strings.la
 
60
tests_test_memcpy_LDADD = $(tests_ldadd)
 
61
tests_test_memcpy_CFLAGS = $(tests_cflags)
 
62
tests_test_memset_LDADD = $(tests_ldadd)
 
63
tests_test_memset_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
 
 
71
TESTS = $(check_PROGRAMS)
 
72
 
 
73
# Libraries containing the difference reference versions
 
74
libbionic_a_SOURCES = \
 
75
        $(neon_bionic_sources) \
 
76
        reference/bionic/memcmp16.S \
 
77
        reference/bionic/strlen.c \
 
78
        reference/bionic/memset.S \
 
79
        reference/bionic/memcmp.S
 
80
 
 
81
libcsl_a_SOURCES = \
 
82
        reference/csl/memcpy.c \
 
83
        reference/csl/memset.c \
 
84
        reference/csl/arm_asm.h
 
85
 
 
86
libglibc_a_SOURCES = \
 
87
        reference/glibc/memmove.S \
 
88
        reference/glibc/memset.S \
 
89
        reference/glibc/strlen.S \
 
90
        reference/glibc/memcpy.S
 
91
 
 
92
libnewlib_a_SOURCES = \
 
93
        reference/newlib/strcmp.c \
 
94
        reference/newlib/strlen.c \
 
95
        reference/newlib/strcpy.c \
 
96
        reference/newlib/arm_asm.h
 
97
 
 
98
libplain_a_SOURCES = \
 
99
        reference/plain/memset.c \
 
100
        reference/plain/memcpy.c \
 
101
        reference/plain/strcmp.c \
 
102
        reference/plain/strcpy.c
 
103
 
 
104
libmulti_a_SOURCES = \
 
105
        benchmarks/multi/harness.c
 
106
 
 
107
libmulti_a_CFLAGS = -DVERSION=\"$(VERSION)\" $(AM_CFLAGS)
 
108
 
 
109
# Flags for the benchmark helpers
 
110
try_none_SOURCES =
 
111
try_none_LDFLAGS = -lrt
 
112
try_none_LDADD = libmulti.a
 
113
try_all_SOURCES =
 
114
try_all_LDFLAGS = -lrt
 
115
try_all_LDADD = libmulti.a libcortex-strings.la
 
116
try_bionic_SOURCES =
 
117
try_bionic_LDFLAGS = -lrt
 
118
try_bionic_LDADD = libmulti.a libbionic.a
 
119
try_csl_SOURCES =
 
120
try_csl_LDFLAGS = -lrt
 
121
try_csl_LDADD = libmulti.a libcsl.a
 
122
try_glibc_SOURCES =
 
123
try_glibc_LDFLAGS = -lrt
 
124
try_glibc_LDADD = libmulti.a libglibc.a
 
125
try_newlib_SOURCES =
 
126
try_newlib_LDFLAGS = -lrt
 
127
try_newlib_LDADD = libmulti.a libnewlib.a
 
128
try_plain_SOURCES =
 
129
try_plain_LDFLAGS = -lrt
 
130
try_plain_LDADD = libmulti.a libplain.a
 
131
 
 
132
# Good 'ol Dhrystone
 
133
dhry_SOURCES = \
 
134
        benchmarks/dhry/dhry_1.c \
 
135
        benchmarks/dhry/dhry_2.c \
 
136
        benchmarks/dhry/dhry.h
 
137
 
 
138
dhry_CFLAGS = -Dcompiler="\"$(COMPILER)\"" -Doptions="\"$(CFLAGS)\""
 
139
dhry_LDADD = libcortex-strings.la
 
140
 
 
141
dhry_native_SOURCES = $(dhry_SOURCES)
 
142
dhry_native_CFLAGS = $(dhry_CFLAGS)
 
143
 
 
144
AM_CPPFLAGS = $(neon_cppflags)
 
145
AM_CFLAGS = -std=gnu99 -Wall $(AM_CPPFLAGS)
 
146
 
 
147
EXTRA_DIST = \
 
148
        tests/hp-timing.h \
 
149
        tests/test-string.h \
 
150
        tests/test-skeleton.c \
 
151
        autogen.sh
 
152
 
 
153
add_on_dist = add-on-dist
 
154
add_on_dest = $(add_on_dist)/$(PACKAGE)/sysdeps/arm/eabi/arm/$(submachine)
 
155
add_on_dirs = thumb-2 $(submachine) $(neon_dirs)
 
156
 
 
157
add_on_src = \
 
158
        $(wildcard $(add_on_dirs:%=$(srcdir)/src/%/*.c)) \
 
159
        $(wildcard $(add_on_dirs:%=$(srcdir)/src/%/*.S)) \
 
160
        $(wildcard $(add_on_dirs:%=$(srcdir)/src/%/*.h))
 
161
 
 
162
add-on:
 
163
        rm -rf $(add_on_dist)
 
164
        mkdir -p $(add_on_dest)
 
165
        cp -f $(add_on_src) $(add_on_dest)
 
166
        python $(srcdir)/scripts/fixup.py GLIBC $(add_on_dest)/*
 
167
        tar cf $(PACKAGE).tar -C $(add_on_dist) .