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