summaryrefslogtreecommitdiff
path: root/mpi/Makefile.am
blob: 7588f1ca43eb631f5a9021e90236d511ac414a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
## Process this file with automake to produce Makefile.in
# Copyright (C) 1992, 1999, 2000, 2002 Free Software Foundation, Inc.
#
# This file is part of Libgcrypt.
#
# Libgcrypt is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# Libgcrypt is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

# 1.5 leads to a combinatorial explosion due to all the conditionals
# I was not able to build it with 64Megs - 1.6 fixes this.
AUTOMAKE_OPTIONS = 1.6

INCLUDES =  -I$(top_srcdir)/src
CFLAGS = @CFLAGS@ @MPI_OPT_FLAGS@
ASFLAGS = @MPI_SFLAGS@

# We don't have .S sources listed, so automake does not autocreate these
CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)


EXTRA_DIST = config.links
DISTCLEANFILES = mpi-asm-defs.h \
                 mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S  \
		 mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h
# Note: we only use .S files so we should delete all left over .s
CLEANFILES = _*.s __*.s

# Beware: The following list is not a comment but grepped by
#         config.links to get the list of symlinked modules
#         Optional modules are marked with a 0 in the second column.
#BEGIN_ASM_LIST
# mpih-add1    C
# mpih-sub1    C
# mpih-mul1    C
# mpih-mul2    C
# mpih-mul3    C
# mpih-lshift  C
# mpih-rshift  C
# udiv         O
# udiv-qrnnd   O
#END_ASM_LIST

# Note: This function has not yet been implemented.  There is only a dummy in
# generic/
# udiv-w-sdiv  O

# And we need to have conditionals for all modules because
# we don't know whether they are .c or .S.  Very ugly; I know.
# Remember to define them all in configure.ac
# if MPI_MOD_ASM_MPIH_ADD1
# mpih_add1 = mpih-add1.S
# else
# if MPI_MOD_C_MPIH_ADD1
# mpih_add1 = mpih-add1.c
# else
# mpih_add1 = 
# endif
# endif
# 
# if MPI_MOD_ASM_MPIH_SUB1
# mpih_sub1 = mpih-sub1.S
# else
# if MPI_MOD_C_MPIH_SUB1
# mpih_sub1 = mpih-sub1.c
# else
# mpih_sub1 = 
# endif
# endif
# 
# if MPI_MOD_ASM_MPIH_MUL1
# mpih_mul1 = mpih-mul1.S
# else
# if MPI_MOD_C_MPIH_MUL1
# mpih_mul1 = mpih-mul1.c
# else
# mpih_mul1 = 
# endif
# endif
# 
# if MPI_MOD_ASM_MPIH_MUL2
# mpih_mul2 = mpih-mul2.S
# else
# if MPI_MOD_C_MPIH_MUL2
# mpih_mul2 = mpih-mul2.c
# else
# mpih_mul2 = 
# endif
# endif
# 
# if MPI_MOD_ASM_MPIH_MUL3
# mpih_mul3 = mpih-mul3.S
# else
# if MPI_MOD_C_MPIH_MUL3
# mpih_mul3 = mpih-mul3.c
# else
# mpih_mul3 = 
# endif
# endif
# 
# if MPI_MOD_ASM_MPIH_LSHIFT
# mpih_lshift = mpih-lshift.S
# else
# if MPI_MOD_C_MPIH_LSHIFT
# mpih_lshift = mpih-lshift.c
# else
# mpih_lshift = 
# endif
# endif
# 
# if MPI_MOD_ASM_MPIH_RSHIFT
# mpih_rshift = mpih-rshift.S
# else
# if MPI_MOD_C_MPIH_RSHIFT
# mpih_rshift = mpih-rshift.c
# else
# mpih_rshift = 
# endif
# endif
# 
# if MPI_MOD_ASM_UDIV
# udiv = udiv.S
# else
# if MPI_MOD_C_UDIV
# udiv = udiv.c
# else
# udiv = 
# endif
# endif
# 
# if MPI_MOD_ASM_UDIV_QRNND
# udiv_qrnnd = udiv-qrnnd.S
# else
# if MPI_MOD_C_UDIV_QRNND
# udiv_qrnnd = udiv-qrnnd.c
# else
# udiv_qrnnd = 
# endif
# endif

noinst_LTLIBRARIES = libmpi.la

libmpi_la_LDFLAGS =
libmpi_la_SOURCES = longlong.h	   \
	      mpi-add.c      \
	      mpi-bit.c      \
	      mpi-cmp.c      \
	      mpi-div.c      \
	      mpi-gcd.c      \
	      mpi-internal.h \
	      mpi-inline.h   \
	      mpi-inline.c   \
	      mpi-inv.c      \
	      mpi-mul.c      \
	      mpi-pow.c      \
	      mpi-mpow.c     \
	      mpi-scan.c     \
	      mpicoder.c     \
	      mpih-div.c     \
	      mpih-mul.c     \
	      mpiutil.c 

libmpi_la_LIBADD = @MPI_MOD_LIST_LO@
libmpi_la_DEPENDENCIES = @MPI_MOD_LIST_LO@

# we need our own rules here to preprocess the .S files
# libtool has now working support for assembiles. It does for example not
# work when building only a static library.
.S.o:
	 $(CPP) $(INCLUDES) $(DEFS) `test -f '$<' || echo '$(srcdir)/'`$< | grep -v '^#' > _$*.s
	 $(CCASCOMPILE) -c _$*.s
	 mv -f _$*.o $@

.S.lo:
	 $(CPP) $(INCLUDES) $(DEFS) -DPIC `test -f '$<' || echo '$(srcdir)/'`$< | grep -v '^#' > __$*.s
	 $(CCASCOMPILE) -c __$*.s
	 mv -f __$*.o $@