Makefile revision 1.7
1#	$NetBSD: Makefile,v 1.7 1997/09/18 22:55:56 jeremy Exp $
2
3#	MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
4#	M68000 Hi-Performance Microprocessor Division
5#	M68040 Software Package 
6#
7#	M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
8#	All rights reserved.
9#
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. 
17#
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.  
25#
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.
32
33#
34#	Makefile 3.3 3/27/91
35#
36#	Makefile for 68040 Floating Point Software Package
37#
38
39TARGET = fpsp
40
41AS		= ${CC} -x assembler-with-cpp -traditional-cpp -c -m68040 -I${.CURDIR}
42LD?		= ld
43
44#
45# For the Library Version:
46#
47AR?		= ar
48LIB_FILTER 	= sed 's/fpsp.defs/l_fpsp.defs/'
49LIB_TARGET	= lib$(TARGET).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#
65SYS		= GCC
66PREFIX		= L_
67
68.SUFFIXES:	.o .s .sa .defs .h
69
70.sa.s:
71	sh ${.CURDIR}/asm2gas ${.IMPSRC} >${.TARGET}
72.h.defs:
73	sh ${.CURDIR}/asm2gas ${.IMPSRC} >${.TARGET}
74.s.o:
75	$(AS) -o ${.TARGET} ${.IMPSRC}
76
77H_FILES = \
78	fpsp.defs \
79	l_fpsp.defs
80
81O_FILES = \
82	copyright.o \
83	netbsd.o \
84	bindec.o \
85	binstr.o \
86	decbin.o \
87	do_func.o \
88	gen_except.o \
89	get_op.o \
90	kernel_ex.o \
91	res_func.o \
92	round.o \
93	sacos.o \
94	sasin.o \
95	satan.o \
96	satanh.o \
97	scosh.o \
98	setox.o \
99	sgetem.o \
100	sint.o \
101	slogn.o \
102	slog2.o \
103	smovecr.o \
104	srem_mod.o \
105	scale.o \
106	ssin.o \
107	ssinh.o \
108	stan.o \
109	stanh.o \
110	sto_res.o \
111	stwotox.o \
112	tbldo.o \
113	util.o \
114	x_bsun.o \
115	x_fline.o \
116	x_operr.o \
117	x_ovfl.o \
118	x_snan.o \
119	x_store.o \
120	x_unfl.o \
121	x_unimp.o \
122	x_unsupp.o \
123	bugfix.o
124
125LIB_O_FILES	= \
126	l_copyright.o \
127	l_entry.o \
128	l_do_func.o \
129	l_round.o \
130	l_sacos.o \
131	l_sasin.o \
132	l_satan.o \
133	l_satanh.o \
134	l_scale.o \
135	l_scosh.o \
136	l_setox.o \
137	l_sgetem.o \
138	l_sint.o \
139	l_slog2.o \
140	l_slogn.o \
141	l_srem_mod.o \
142	l_ssin.o \
143	l_ssinh.o \
144	l_stan.o \
145	l_stanh.o \
146	l_stwotox.o \
147	l_support.o
148
149S_FILES = \
150	netbsd.s \
151	bindec.s \
152	binstr.s \
153	decbin.s \
154	do_func.s \
155	get_op.s \
156	gen_except.s \
157	kernel_ex.s \
158	res_func.s \
159	round.s \
160	sacos.s \
161	sasin.s \
162	satan.s \
163	satanh.s \
164	scosh.s \
165	setox.s \
166	sgetem.s \
167	sint.s \
168	slogn.s \
169	slog2.s \
170	smovecr.s \
171	srem_mod.s \
172	scale.s \
173	ssin.s \
174	ssinh.s \
175	stan.s \
176	stanh.s \
177	sto_res.s \
178	stwotox.s \
179	tbldo.s \
180	util.s \
181	x_bsun.s \
182	x_fline.s \
183	x_operr.s \
184	x_ovfl.s \
185	x_snan.s \
186	x_store.s \
187	x_unfl.s \
188	x_unimp.s \
189	x_unsupp.s \
190	bugfix.s
191
192LIB_S_FILES	= \
193	l_entry.sa l_entry.s \
194	l_do_func.s \
195	l_round.s \
196	l_sacos.s \
197	l_sasin.s \
198	l_satan.s \
199	l_satanh.s \
200	l_scale.s \
201	l_scosh.s \
202	l_setox.s \
203	l_sgetem.s \
204	l_sint.s \
205	l_slog2.s \
206	l_slogn.s \
207	l_srem_mod.s \
208	l_ssin.s \
209	l_ssinh.s \
210	l_stan.s \
211	l_stanh.s \
212	l_stwotox.s \
213	l_support.s
214
215#
216#	Build the target object.  The linkfile is created on the fly.
217#	Change the SEG directives to suit your system.
218#
219$(TARGET).o:	$(O_FILES)
220	$(LD) -r -o $(TARGET).o $(O_FILES)
221
222#
223#	Just about every file needs fpsp.h so:
224#
225$(O_FILES):	fpsp.defs
226
227#
228#-----------------------------------------------------------------------
229#
230#	For making a library version of the FPSP:
231#
232library:	$(LIB_TARGET)
233
234$(LIB_TARGET):	$(LIB_O_FILES)
235	rm -f $(LIB_TARGET)
236	$(AR) crv $(LIB_TARGET) $(LIB_O_FILES)
237
238$(LIB_O_FILES): l_fpsp.defs
239
240#
241# The entry points to the library version are created here
242# by using two template files an awk script and a list of
243# the entry routines for each function.
244#
245l_entry.sa: L_ENTRY.AWK L_LIST MONADIC.$(SYS) DYADIC.$(SYS) l_fpsp.h
246	awk -f L_ENTRY.AWK SYS=$(SYS) PREFIX=$(PREFIX) - <L_LIST|sh>l_entry.sa
247
248#
249# Do_func.sa and round.sa need special editing to remove references that
250# aren't needed in the library version.  Beware that changes in
251# the source code may cause this editing to break....
252#
253l_do_func.s: do_func.s 
254	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
255	echo '/global.*do_func/,/^	rts/d' >.SCRIPT
256	echo 'g/smovcr/d' >>.SCRIPT
257	echo 'g/tblpre/d' >>.SCRIPT
258	echo 'w' >>.SCRIPT
259	echo 'q' >>.SCRIPT
260	ed - ${.TARGET} <.SCRIPT
261	rm .SCRIPT
262
263l_round.s: round.s 
264	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
265	echo '/^not_E3:/-6,/^not_E3:/d' >.SCRIPT
266	echo 'w' >>.SCRIPT
267	echo 'q' >>.SCRIPT
268	ed - ${.TARGET} <.SCRIPT
269	rm .SCRIPT
270
271l_copyright.s: copyright.s 
272	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
273
274l_sacos.s: sacos.s 
275	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
276
277l_sasin.s: sasin.s 
278	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
279
280l_satan.s: satan.s 
281	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
282
283l_satanh.s: satanh.s 
284	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
285
286l_scale.s: scale.s 
287	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
288
289l_scosh.s: scosh.s 
290	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
291
292l_setox.s: setox.s 
293	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
294
295l_sgetem.s: sgetem.s 
296	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
297
298l_sint.s: sint.s 
299	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
300
301l_slog2.s: slog2.s 
302	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
303
304l_slogn.s: slogn.s 
305	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
306
307l_srem_mod.s: srem_mod.s 
308	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
309
310l_ssin.s: ssin.s 
311	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
312
313l_ssinh.s: ssinh.s 
314	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
315
316l_stan.s: stan.s 
317	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
318
319l_stanh.s: stanh.s 
320	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
321
322l_stwotox.s: stwotox.s 
323	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
324
325#
326#	Extract all files from SCCS directory
327#
328clean:
329	rm -f $(H_FILES)
330	rm -f $(S_FILES)
331	rm -f $(O_FILES)
332	rm -f $(TARGET).o
333	rm -f $(LIB_S_FILES)
334	rm -f $(LIB_O_FILES)
335	rm -f $(LIB_TARGET)
336
337clobber:	clean
338
339