config: fix build with external compiler by passing the sysroot where needed
[AROS.git] / arch / m68k-all / m680x0 / fpsp / Makefile
blobba9d62e18488585419527f5327ee4da0932b0853
1 # $NetBSD: Makefile,v 1.17 2008/10/25 22:27:37 apb Exp $
3 # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
4 # M68000 Hi-Performance Microprocessor Division
5 # M68040 Software Package
7 # M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
8 # All rights reserved.
10 # THE SOFTWARE is provided on an "AS IS" basis and without warranty.
11 # To the maximum extent permitted by applicable law,
12 # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
13 # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
14 # PARTICULAR PURPOSE and any warranty against infringement with
15 # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
16 # and any accompanying written materials.
18 # To the maximum extent permitted by applicable law,
19 # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
20 # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
21 # PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
22 # OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
23 # SOFTWARE. Motorola assumes no responsibility for the maintenance
24 # and support of the SOFTWARE.
26 # You are hereby granted a copyright license to use, modify, and
27 # distribute the SOFTWARE so long as this entire notice is retained
28 # without alteration in any modified and/or redistributed versions,
29 # and that such modified versions are clearly identified as such.
30 # No licenses are granted by implication, estoppel or otherwise
31 # under any patents or trademarks of Motorola, Inc.
34 # Makefile 3.3 3/27/91
36 # Makefile for 68040 Floating Point Software Package
39 .include <bsd.prog.mk>
41 TARGET = fpsp
43 CPPFLAGS= ${FPSPCPPFLAGS} ${FPSPMISCCPPFLAGS}
44 .SUFFIXES: .o .s .sa .defs .h
46 .PATH.h: ${FPSPDIR}
47 .PATH.s: ${FPSPDIR}
48 .PATH.sa: ${FPSPDIR}
50 AS? = as
51 LD? = ld
52 AFLAGS = -x assembler-with-cpp -m68040
55 # For the Library Version:
57 AR? = ar
58 LIB_FILTER = ${TOOL_SED} 's/fpsp.defs/l_fpsp.defs/'
59 LIB_TARGET = lib$(TARGET).a
61 # SYS selects the template set to use
62 # templates are supplied for R3V6, CI5 and GEN(generic)
63 # PREFIX is a string that begins a temporary label in the assembler
64 # R3V6 uses 'L%', CI5 likes '.L'
66 #SYS = R3V6
67 #PREFIX = L%%
69 #SYS = CI5
70 #PREFIX = .L
72 #SYS = GEN
73 #PREFIX = L_
75 SYS = GCC
76 PREFIX = L_
78 .sa.s:
79 SED=${TOOL_SED:Q} ${HOST_SH} ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET}
80 .h.defs:
81 SED=${TOOL_SED:Q} ${HOST_SH} ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET}
82 .s.o:
83 ${CC} ${AFLAGS} ${CPPFLAGS} -c -o ${.TARGET} ${.IMPSRC}
85 H_FILES = \
86 fpsp.defs \
87 l_fpsp.defs
89 O_FILES = \
90 copyright.o \
91 netbsd.o \
92 bindec.o \
93 binstr.o \
94 decbin.o \
95 do_func.o \
96 gen_except.o \
97 get_op.o \
98 kernel_ex.o \
99 res_func.o \
100 round.o \
101 sacos.o \
102 sasin.o \
103 satan.o \
104 satanh.o \
105 scosh.o \
106 setox.o \
107 sgetem.o \
108 sint.o \
109 slogn.o \
110 slog2.o \
111 smovecr.o \
112 srem_mod.o \
113 scale.o \
114 ssin.o \
115 ssinh.o \
116 stan.o \
117 stanh.o \
118 sto_res.o \
119 stwotox.o \
120 tbldo.o \
121 util.o \
122 x_bsun.o \
123 x_fline.o \
124 x_operr.o \
125 x_ovfl.o \
126 x_snan.o \
127 x_store.o \
128 x_unfl.o \
129 x_unimp.o \
130 x_unsupp.o \
131 bugfix.o
133 LIB_O_FILES = \
134 l_copyright.o \
135 l_entry.o \
136 l_do_func.o \
137 l_round.o \
138 l_sacos.o \
139 l_sasin.o \
140 l_satan.o \
141 l_satanh.o \
142 l_scale.o \
143 l_scosh.o \
144 l_setox.o \
145 l_sgetem.o \
146 l_sint.o \
147 l_slog2.o \
148 l_slogn.o \
149 l_srem_mod.o \
150 l_ssin.o \
151 l_ssinh.o \
152 l_stan.o \
153 l_stanh.o \
154 l_stwotox.o \
155 l_support.o
157 S_FILES = \
158 netbsd.s \
159 bindec.s \
160 binstr.s \
161 decbin.s \
162 do_func.s \
163 get_op.s \
164 gen_except.s \
165 kernel_ex.s \
166 res_func.s \
167 round.s \
168 sacos.s \
169 sasin.s \
170 satan.s \
171 satanh.s \
172 scosh.s \
173 setox.s \
174 sgetem.s \
175 sint.s \
176 slogn.s \
177 slog2.s \
178 smovecr.s \
179 srem_mod.s \
180 scale.s \
181 ssin.s \
182 ssinh.s \
183 stan.s \
184 stanh.s \
185 sto_res.s \
186 stwotox.s \
187 tbldo.s \
188 util.s \
189 x_bsun.s \
190 x_fline.s \
191 x_operr.s \
192 x_ovfl.s \
193 x_snan.s \
194 x_store.s \
195 x_unfl.s \
196 x_unimp.s \
197 x_unsupp.s \
198 bugfix.s
200 LIB_S_FILES = \
201 l_entry.sa l_entry.s \
202 l_do_func.s \
203 l_round.s \
204 l_sacos.s \
205 l_sasin.s \
206 l_satan.s \
207 l_satanh.s \
208 l_scale.s \
209 l_scosh.s \
210 l_setox.s \
211 l_sgetem.s \
212 l_sint.s \
213 l_slog2.s \
214 l_slogn.s \
215 l_srem_mod.s \
216 l_ssin.s \
217 l_ssinh.s \
218 l_stan.s \
219 l_stanh.s \
220 l_stwotox.s \
221 l_support.s
224 # Build the target object. The linkfile is created on the fly.
225 # Change the SEG directives to suit your system.
227 $(TARGET).o: $(O_FILES)
228 $(LD) -r -o $(TARGET).o $(O_FILES)
231 # Just about every file needs fpsp.h so:
233 $(O_FILES): fpsp.defs
236 #-----------------------------------------------------------------------
238 # For making a library version of the FPSP:
240 library: $(LIB_TARGET)
242 $(LIB_TARGET): $(LIB_O_FILES)
243 rm -f $(LIB_TARGET)
244 $(AR) crv $(LIB_TARGET) $(LIB_O_FILES)
246 $(LIB_O_FILES): l_fpsp.defs
249 # The entry points to the library version are created here
250 # by using two template files an awk script and a list of
251 # the entry routines for each function.
253 l_entry.sa: L_ENTRY.AWK L_LIST MONADIC.$(SYS) DYADIC.$(SYS) l_fpsp.h
254 ${TOOL_AWK} -f L_ENTRY.AWK SYS=$(SYS) PREFIX=$(PREFIX) - \
255 <L_LIST | ${HOST_SH} >l_entry.sa
258 # Do_func.sa and round.sa need special editing to remove references that
259 # aren't needed in the library version. Beware that changes in
260 # the source code may cause this editing to break....
262 l_do_func.s: do_func.s
263 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
264 echo '/global.*do_func/,/^ rts/d' >.SCRIPT
265 echo 'g/smovcr/d' >>.SCRIPT
266 echo 'g/tblpre/d' >>.SCRIPT
267 echo 'w' >>.SCRIPT
268 echo 'q' >>.SCRIPT
269 ed - ${.TARGET} <.SCRIPT
270 rm .SCRIPT
272 l_round.s: round.s
273 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
274 echo '/^not_E3:/-6,/^not_E3:/d' >.SCRIPT
275 echo 'w' >>.SCRIPT
276 echo 'q' >>.SCRIPT
277 ed - ${.TARGET} <.SCRIPT
278 rm .SCRIPT
280 l_copyright.s: copyright.s
281 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
283 l_sacos.s: sacos.s
284 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
286 l_sasin.s: sasin.s
287 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
289 l_satan.s: satan.s
290 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
292 l_satanh.s: satanh.s
293 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
295 l_scale.s: scale.s
296 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
298 l_scosh.s: scosh.s
299 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
301 l_setox.s: setox.s
302 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
304 l_sgetem.s: sgetem.s
305 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
307 l_sint.s: sint.s
308 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
310 l_slog2.s: slog2.s
311 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
313 l_slogn.s: slogn.s
314 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
316 l_srem_mod.s: srem_mod.s
317 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
319 l_ssin.s: ssin.s
320 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
322 l_ssinh.s: ssinh.s
323 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
325 l_stan.s: stan.s
326 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
328 l_stanh.s: stanh.s
329 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
331 l_stwotox.s: stwotox.s
332 $(LIB_FILTER) ${.ALLSRC} >${.TARGET}
335 # Extract all files from SCCS directory
337 clean:
338 rm -f $(H_FILES)
339 rm -f $(S_FILES)
340 rm -f $(O_FILES)
341 rm -f $(TARGET).o
342 rm -f $(LIB_S_FILES)
343 rm -f $(LIB_O_FILES)
344 rm -f $(LIB_TARGET)
346 clobber: clean