Makefile revision 1.1 1 # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
2 # M68000 Hi-Performance Microprocessor Division
3 # M68040 Software Package
4 #
5 # M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
6 # All rights reserved.
7 #
8 # THE SOFTWARE is provided on an "AS IS" basis and without warranty.
9 # To the maximum extent permitted by applicable law,
10 # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
11 # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
12 # PARTICULAR PURPOSE and any warranty against infringement with
13 # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
14 # and any accompanying written materials.
15 #
16 # To the maximum extent permitted by applicable law,
17 # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
18 # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
19 # PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
20 # OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
21 # SOFTWARE. Motorola assumes no responsibility for the maintenance
22 # and support of the SOFTWARE.
23 #
24 # You are hereby granted a copyright license to use, modify, and
25 # distribute the SOFTWARE so long as this entire notice is retained
26 # without alteration in any modified and/or redistributed versions,
27 # and that such modified versions are clearly identified as such.
28 # No licenses are granted by implication, estoppel or otherwise
29 # under any patents or trademarks of Motorola, Inc.
30
31 #
32 # Makefile 3.3 3/27/91
33 #
34 # Makefile for 68040 Floating Point Software Package
35 #
36
37 TARGET = FPSP
38
39 ASM = ./pasm
40 ASMOPTS = +p=68020/68881 +l +C +M
41 PLINK = ./plink
42 PLINKOPTS = dummy +q$(TARGET) +w32 +x +i +m$(TARGET).linkmap
43
44 #
45 # For the Library Version:
46 #
47 AR = ar
48 LIB_FILTER = sed 's/fpsp.h/l_fpsp.h/'
49 LIB_TARGET = libFPSP.a
50 #
51 # SYS selects the template set to use
52 # templates are supplied for R3V6, CI5 and GEN(generic)
53 # PREFIX is a string that begins a temporary label in the assembler
54 # R3V6 uses 'L%', CI5 likes '.L'
55 #
56 #SYS = R3V6
57 #PREFIX = L%%
58 #
59 #SYS = CI5
60 #PREFIX = .L
61 #
62 SYS = GEN
63 PREFIX = L_
64
65 .SUFFIXES: .s .s~ .sa .sa~ .ro .h .h~
66
67 .sa.ro:
68 $(ASM) $(ASMOPTS) $*.sa
69
70 .sa~.ro:
71 sccs get SCCS/s.$*.sa
72 $(ASM) $(ASMOPTS) $*.sa
73 rm -f $*.sa
74
75 .sa.s:
76 asm2as $*.sa >$*.s
77
78 .sa~.sa:
79 sccs get SCCS/s.$*.sa
80
81 .s~.s:
82 sccs get SCCS/s.$*.s
83
84 .h~.h:
85 sccs get SCCS/s.$*.h
86
87 RO_FILES = \
88 skeleton.ro \
89 bindec.ro \
90 binstr.ro \
91 decbin.ro \
92 do_func.ro \
93 gen_except.ro \
94 get_op.ro \
95 kernel_ex.ro \
96 res_func.ro \
97 round.ro \
98 sacos.ro \
99 sasin.ro \
100 satan.ro \
101 satanh.ro \
102 scosh.ro \
103 setox.ro \
104 sgetem.ro \
105 sint.ro \
106 slogn.ro \
107 slog2.ro \
108 smovecr.ro \
109 srem_mod.ro \
110 scale.ro \
111 ssin.ro \
112 ssinh.ro \
113 stan.ro \
114 stanh.ro \
115 sto_res.ro \
116 stwotox.ro \
117 tbldo.ro \
118 util.ro \
119 x_bsun.ro \
120 x_fline.ro \
121 x_operr.ro \
122 x_ovfl.ro \
123 x_snan.ro \
124 x_store.ro \
125 x_unfl.ro \
126 x_unimp.ro \
127 x_unsupp.ro \
128 bugfix.ro \
129 FPSP.ro
130
131 LIB_RO_FILES = \
132 l_entry.ro \
133 l_do_func.ro \
134 l_round.ro \
135 l_sacos.ro \
136 l_sasin.ro \
137 l_satan.ro \
138 l_satanh.ro \
139 l_scale.ro \
140 l_scosh.ro \
141 l_setox.ro \
142 l_sgetem.ro \
143 l_sint.ro \
144 l_slog2.ro \
145 l_slogn.ro \
146 l_srem_mod.ro \
147 l_ssin.ro \
148 l_ssinh.ro \
149 l_stan.ro \
150 l_stanh.ro \
151 l_stwotox.ro \
152 l_support.ro
153
154 SA_FILES = \
155 skeleton.sa \
156 bindec.sa \
157 binstr.sa \
158 decbin.sa \
159 do_func.sa \
160 get_op.sa \
161 gen_except.sa \
162 kernel_ex.sa \
163 res_func.sa \
164 round.sa \
165 sacos.sa \
166 sasin.sa \
167 satan.sa \
168 satanh.sa \
169 scosh.sa \
170 setox.sa \
171 sgetem.sa \
172 sint.sa \
173 slogn.sa \
174 slog2.sa \
175 smovecr.sa \
176 srem_mod.sa \
177 scale.sa \
178 ssin.sa \
179 ssinh.sa \
180 stan.sa \
181 stanh.sa \
182 sto_res.sa \
183 stwotox.sa \
184 tbldo.sa \
185 util.sa \
186 x_bsun.sa \
187 x_fline.sa \
188 x_operr.sa \
189 x_ovfl.sa \
190 x_snan.sa \
191 x_store.sa \
192 x_unfl.sa \
193 x_unimp.sa \
194 x_unsupp.sa \
195 bugfix.sa \
196 FPSP.sa
197
198 LIB_SA_FILES = \
199 l_entry.sa \
200 l_do_func.sa \
201 l_round.sa \
202 l_sacos.sa \
203 l_sasin.sa \
204 l_satan.sa \
205 l_satanh.sa \
206 l_scale.sa \
207 l_scosh.sa \
208 l_setox.sa \
209 l_sgetem.sa \
210 l_sint.sa \
211 l_slog2.sa \
212 l_slogn.sa \
213 l_srem_mod.sa \
214 l_ssin.sa \
215 l_ssinh.sa \
216 l_stan.sa \
217 l_stanh.sa \
218 l_stwotox.sa
219
220 H_FILES = \
221 fpsp.h \
222 l_fpsp.h
223
224 U_FILES = \
225 unix.s \
226 bindec.s \
227 binstr.s \
228 decbin.s \
229 do_func.s \
230 get_op.s \
231 gen_except.s \
232 kernel_ex.s \
233 res_func.s \
234 round.s \
235 sacos.s \
236 sasin.s \
237 satan.s \
238 satanh.s \
239 scosh.s \
240 setox.s \
241 sgetem.s \
242 sint.s \
243 slogn.s \
244 slog2.s \
245 smovecr.s \
246 srem_mod.s \
247 scale.s \
248 ssin.s \
249 ssinh.s \
250 stan.s \
251 stanh.s \
252 sto_res.s \
253 stwotox.s \
254 tbldo.s \
255 util.s \
256 x_bsun.s \
257 x_fline.s \
258 x_operr.s \
259 x_ovfl.s \
260 x_snan.s \
261 x_store.s \
262 x_unfl.s \
263 x_unimp.s \
264 x_unsupp.s \
265 bugfix.s \
266 fpsp.mk \
267 fpsp.defs \
268 l_entry.s \
269 l_do_func.s \
270 l_round.s \
271 l_sacos.s \
272 l_sasin.s \
273 l_satan.s \
274 l_satanh.s \
275 l_scale.s \
276 l_scosh.s \
277 l_setox.s \
278 l_sgetem.s \
279 l_sint.s \
280 l_slog2.s \
281 l_slogn.s \
282 l_srem_mod.s \
283 l_ssin.s \
284 l_ssinh.s \
285 l_stan.s \
286 l_stanh.s \
287 l_stwotox.s \
288 l_support.s \
289 l_fpsp.defs
290
291 #
292 # Build the target object. The linkfile is created on the fly.
293 # Change the SEG directives to suit your system.
294 #
295 $(TARGET).mx: $(RO_FILES)
296 rm -f linkfile
297 echo 'IDENT FPSP,2,1,68040 Floating Point Software Package'>linkfile
298 echo 'SEG SEG0(G):7 $$00004000' >>linkfile
299 echo 'SEG SEG1(G):8 $$000D0000' >>linkfile
300 echo 'SEG SEG2(G):15 $$000E0000' >>linkfile
301 echo $(RO_FILES) | tr ' ' '\012' | sed 's/^/INPUT /' >>linkfile
302 echo 'END' >>linkfile
303 $(PLINK) $(PLINKOPTS) <linkfile
304
305 #
306 # Just about every file needs fpsp.h so:
307 #
308 $(RO_FILES): fpsp.h
309
310 fpsp.defs: fpsp.h
311 asm2as fpsp.h >fpsp.defs
312
313 unix.s:
314 sccs get unix.s
315
316 fpsp.mk:
317 sccs get fpsp.mk
318
319 #
320 #-----------------------------------------------------------------------
321 #
322 # For making a library version of the FPSP:
323 #
324 library: $(LIB_TARGET)
325
326 $(LIB_TARGET): $(LIB_RO_FILES)
327 rm -f $(LIB_TARGET)
328 $(AR) crv $(LIB_TARGET) $(LIB_RO_FILES)
329
330 $(LIB_RO_FILES): l_fpsp.h
331
332 l_fpsp.defs: l_fpsp.h
333 asm2as l_fpsp.h >l_fpsp.defs
334
335 #
336 # The entry points to the library version are created here
337 # by using two template files an awk script and a list of
338 # the entry routines for each function.
339 #
340 l_entry.sa: L_ENTRY.AWK L_LIST MONADIC.$(SYS) DYADIC.$(SYS) l_fpsp.h
341 awk -f L_ENTRY.AWK SYS=$(SYS) PREFIX=$(PREFIX) - <L_LIST|sh>l_entry.sa
342
343 #
344 # Do_func.sa and round.sa need special editing to remove references that
345 # aren't needed in the library version. Beware that changes in
346 # the source code may cause this editing to break....
347 #
348 l_do_func.sa: do_func.sa
349 $(LIB_FILTER) do_func.sa >l_do_func.sa
350 echo '/xdef.*do_func/,/^ rts/d' >.SCRIPT
351 echo 'g/smovcr/d' >>.SCRIPT
352 echo 'g/tblpre/d' >>.SCRIPT
353 echo 'w' >>.SCRIPT
354 echo 'q' >>.SCRIPT
355 ed - l_do_func.sa <.SCRIPT
356 rm .SCRIPT
357
358 l_round.sa: round.sa
359 $(LIB_FILTER) round.sa >l_round.sa
360 echo '/^not_E3:/-6,/^not_E3:/d' >.SCRIPT
361 echo 'w' >>.SCRIPT
362 echo 'q' >>.SCRIPT
363 ed - l_round.sa <.SCRIPT
364 rm .SCRIPT
365
366 l_sacos.sa: sacos.sa
367 $(LIB_FILTER) sacos.sa >l_sacos.sa
368
369 l_sasin.sa: sasin.sa
370 $(LIB_FILTER) sasin.sa >l_sasin.sa
371
372 l_satan.sa: satan.sa
373 $(LIB_FILTER) satan.sa >l_satan.sa
374
375 l_satanh.sa: satanh.sa
376 $(LIB_FILTER) satanh.sa >l_satanh.sa
377
378 l_scale.sa: scale.sa
379 $(LIB_FILTER) scale.sa >l_scale.sa
380
381 l_scosh.sa: scosh.sa
382 $(LIB_FILTER) scosh.sa >l_scosh.sa
383
384 l_setox.sa: setox.sa
385 $(LIB_FILTER) setox.sa >l_setox.sa
386
387 l_sgetem.sa: sgetem.sa
388 $(LIB_FILTER) sgetem.sa >l_sgetem.sa
389
390 l_sint.sa: sint.sa
391 $(LIB_FILTER) sint.sa >l_sint.sa
392
393 l_slog2.sa: slog2.sa
394 $(LIB_FILTER) slog2.sa >l_slog2.sa
395
396 l_slogn.sa: slogn.sa
397 $(LIB_FILTER) slogn.sa >l_slogn.sa
398
399 l_srem_mod.sa: srem_mod.sa
400 $(LIB_FILTER) srem_mod.sa >l_srem_mod.sa
401
402 l_ssin.sa: ssin.sa
403 $(LIB_FILTER) ssin.sa >l_ssin.sa
404
405 l_ssinh.sa: ssinh.sa
406 $(LIB_FILTER) ssinh.sa >l_ssinh.sa
407
408 l_stan.sa: stan.sa
409 $(LIB_FILTER) stan.sa >l_stan.sa
410
411 l_stanh.sa: stanh.sa
412 $(LIB_FILTER) stanh.sa >l_stanh.sa
413
414 l_stwotox.sa: stwotox.sa
415 $(LIB_FILTER) stwotox.sa >l_stwotox.sa
416
417 #
418 # Extract all files from SCCS directory
419 #
420 getall: $(SA_FILES) $(H_FILES)
421
422 convert: $(U_FILES)
423
424 clean:
425 rm -f $(RO_FILES)
426 rm -f $(U_FILES)
427 rm -f *.ls linkfile $(TARGET).linkmap
428 rm -f FPSP.mx
429 rm -f $(LIB_TARGET) .SCRIPT
430 rm -f $(LIB_RO_FILES)
431 rm -f $(LIB_SA_FILES)
432
433 clobber: clean
434
435