Makefile revision 1.8
11.8Schs#	$NetBSD: Makefile,v 1.8 2001/10/02 06:34:52 chs Exp $
21.4Scgd
31.1Smycroft#	MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
41.1Smycroft#	M68000 Hi-Performance Microprocessor Division
51.1Smycroft#	M68040 Software Package 
61.1Smycroft#
71.1Smycroft#	M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
81.1Smycroft#	All rights reserved.
91.1Smycroft#
101.1Smycroft#	THE SOFTWARE is provided on an "AS IS" basis and without warranty.
111.1Smycroft#	To the maximum extent permitted by applicable law,
121.1Smycroft#	MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
131.1Smycroft#	INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
141.1Smycroft#	PARTICULAR PURPOSE and any warranty against infringement with
151.1Smycroft#	regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
161.1Smycroft#	and any accompanying written materials. 
171.1Smycroft#
181.1Smycroft#	To the maximum extent permitted by applicable law,
191.1Smycroft#	IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
201.1Smycroft#	(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
211.1Smycroft#	PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
221.1Smycroft#	OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
231.1Smycroft#	SOFTWARE.  Motorola assumes no responsibility for the maintenance
241.1Smycroft#	and support of the SOFTWARE.  
251.1Smycroft#
261.1Smycroft#	You are hereby granted a copyright license to use, modify, and
271.1Smycroft#	distribute the SOFTWARE so long as this entire notice is retained
281.1Smycroft#	without alteration in any modified and/or redistributed versions,
291.1Smycroft#	and that such modified versions are clearly identified as such.
301.1Smycroft#	No licenses are granted by implication, estoppel or otherwise
311.1Smycroft#	under any patents or trademarks of Motorola, Inc.
321.1Smycroft
331.1Smycroft#
341.1Smycroft#	Makefile 3.3 3/27/91
351.1Smycroft#
361.1Smycroft#	Makefile for 68040 Floating Point Software Package
371.1Smycroft#
381.1Smycroft
391.2SmycroftTARGET = fpsp
401.1Smycroft
411.8Schs.SUFFIXES:	.o .s .sa .defs .h
421.8Schs
431.8Schs.PATH.h: ${FPSPDIR}
441.8Schs.PATH.s: ${FPSPDIR}
451.8Schs.PATH.sa: ${FPSPDIR}
461.8Schs
471.7SjeremyAS		= ${CC} -x assembler-with-cpp -traditional-cpp -c -m68040 -I${.CURDIR}
481.7SjeremyLD?		= ld
491.1Smycroft
501.1Smycroft#
511.1Smycroft# For the Library Version:
521.1Smycroft#
531.7SjeremyAR?		= ar
541.2SmycroftLIB_FILTER 	= sed 's/fpsp.defs/l_fpsp.defs/'
551.2SmycroftLIB_TARGET	= lib$(TARGET).a
561.1Smycroft#
571.1Smycroft# SYS selects the template set to use
581.1Smycroft#	templates are supplied for R3V6, CI5 and GEN(generic)
591.1Smycroft# PREFIX is a string that begins a temporary label in the assembler
601.1Smycroft#	R3V6 uses 'L%', CI5 likes '.L'
611.1Smycroft#
621.1Smycroft#SYS		= R3V6
631.1Smycroft#PREFIX		= L%%
641.1Smycroft#
651.1Smycroft#SYS		= CI5
661.1Smycroft#PREFIX		= .L
671.1Smycroft#
681.2Smycroft#SYS		= GEN
691.2Smycroft#PREFIX		= L_
701.2Smycroft#
711.2SmycroftSYS		= GCC
721.1SmycroftPREFIX		= L_
731.1Smycroft
741.1Smycroft.sa.s:
751.8Schs	sh ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET}
761.2Smycroft.h.defs:
771.8Schs	sh ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET}
781.2Smycroft.s.o:
791.3Smycroft	$(AS) -o ${.TARGET} ${.IMPSRC}
801.1Smycroft
811.2SmycroftH_FILES = \
821.2Smycroft	fpsp.defs \
831.2Smycroft	l_fpsp.defs
841.1Smycroft
851.2SmycroftO_FILES = \
861.3Smycroft	copyright.o \
871.2Smycroft	netbsd.o \
881.2Smycroft	bindec.o \
891.2Smycroft	binstr.o \
901.2Smycroft	decbin.o \
911.2Smycroft	do_func.o \
921.2Smycroft	gen_except.o \
931.2Smycroft	get_op.o \
941.2Smycroft	kernel_ex.o \
951.2Smycroft	res_func.o \
961.2Smycroft	round.o \
971.2Smycroft	sacos.o \
981.2Smycroft	sasin.o \
991.2Smycroft	satan.o \
1001.2Smycroft	satanh.o \
1011.2Smycroft	scosh.o \
1021.2Smycroft	setox.o \
1031.2Smycroft	sgetem.o \
1041.2Smycroft	sint.o \
1051.2Smycroft	slogn.o \
1061.2Smycroft	slog2.o \
1071.2Smycroft	smovecr.o \
1081.2Smycroft	srem_mod.o \
1091.2Smycroft	scale.o \
1101.2Smycroft	ssin.o \
1111.2Smycroft	ssinh.o \
1121.2Smycroft	stan.o \
1131.2Smycroft	stanh.o \
1141.2Smycroft	sto_res.o \
1151.2Smycroft	stwotox.o \
1161.2Smycroft	tbldo.o \
1171.2Smycroft	util.o \
1181.2Smycroft	x_bsun.o \
1191.2Smycroft	x_fline.o \
1201.2Smycroft	x_operr.o \
1211.2Smycroft	x_ovfl.o \
1221.2Smycroft	x_snan.o \
1231.2Smycroft	x_store.o \
1241.2Smycroft	x_unfl.o \
1251.2Smycroft	x_unimp.o \
1261.2Smycroft	x_unsupp.o \
1271.2Smycroft	bugfix.o
1281.2Smycroft
1291.2SmycroftLIB_O_FILES	= \
1301.3Smycroft	l_copyright.o \
1311.2Smycroft	l_entry.o \
1321.2Smycroft	l_do_func.o \
1331.2Smycroft	l_round.o \
1341.2Smycroft	l_sacos.o \
1351.2Smycroft	l_sasin.o \
1361.2Smycroft	l_satan.o \
1371.2Smycroft	l_satanh.o \
1381.2Smycroft	l_scale.o \
1391.2Smycroft	l_scosh.o \
1401.2Smycroft	l_setox.o \
1411.2Smycroft	l_sgetem.o \
1421.2Smycroft	l_sint.o \
1431.2Smycroft	l_slog2.o \
1441.2Smycroft	l_slogn.o \
1451.2Smycroft	l_srem_mod.o \
1461.2Smycroft	l_ssin.o \
1471.2Smycroft	l_ssinh.o \
1481.2Smycroft	l_stan.o \
1491.2Smycroft	l_stanh.o \
1501.2Smycroft	l_stwotox.o \
1511.2Smycroft	l_support.o
1521.1Smycroft
1531.2SmycroftS_FILES = \
1541.2Smycroft	netbsd.s \
1551.1Smycroft	bindec.s \
1561.1Smycroft	binstr.s \
1571.1Smycroft	decbin.s \
1581.1Smycroft	do_func.s \
1591.1Smycroft	get_op.s \
1601.1Smycroft	gen_except.s \
1611.1Smycroft	kernel_ex.s \
1621.1Smycroft	res_func.s \
1631.1Smycroft	round.s \
1641.1Smycroft	sacos.s \
1651.1Smycroft	sasin.s \
1661.1Smycroft	satan.s \
1671.1Smycroft	satanh.s \
1681.1Smycroft	scosh.s \
1691.1Smycroft	setox.s \
1701.1Smycroft	sgetem.s \
1711.1Smycroft	sint.s \
1721.1Smycroft	slogn.s \
1731.1Smycroft	slog2.s \
1741.1Smycroft	smovecr.s \
1751.1Smycroft	srem_mod.s \
1761.1Smycroft	scale.s \
1771.1Smycroft	ssin.s \
1781.1Smycroft	ssinh.s \
1791.1Smycroft	stan.s \
1801.1Smycroft	stanh.s \
1811.1Smycroft	sto_res.s \
1821.1Smycroft	stwotox.s \
1831.1Smycroft	tbldo.s \
1841.1Smycroft	util.s \
1851.1Smycroft	x_bsun.s \
1861.1Smycroft	x_fline.s \
1871.1Smycroft	x_operr.s \
1881.1Smycroft	x_ovfl.s \
1891.1Smycroft	x_snan.s \
1901.1Smycroft	x_store.s \
1911.1Smycroft	x_unfl.s \
1921.1Smycroft	x_unimp.s \
1931.1Smycroft	x_unsupp.s \
1941.2Smycroft	bugfix.s
1951.2Smycroft
1961.2SmycroftLIB_S_FILES	= \
1971.2Smycroft	l_entry.sa l_entry.s \
1981.1Smycroft	l_do_func.s \
1991.1Smycroft	l_round.s \
2001.1Smycroft	l_sacos.s \
2011.1Smycroft	l_sasin.s \
2021.1Smycroft	l_satan.s \
2031.1Smycroft	l_satanh.s \
2041.1Smycroft	l_scale.s \
2051.1Smycroft	l_scosh.s \
2061.1Smycroft	l_setox.s \
2071.1Smycroft	l_sgetem.s \
2081.1Smycroft	l_sint.s \
2091.1Smycroft	l_slog2.s \
2101.1Smycroft	l_slogn.s \
2111.1Smycroft	l_srem_mod.s \
2121.1Smycroft	l_ssin.s \
2131.1Smycroft	l_ssinh.s \
2141.1Smycroft	l_stan.s \
2151.1Smycroft	l_stanh.s \
2161.1Smycroft	l_stwotox.s \
2171.2Smycroft	l_support.s
2181.1Smycroft
2191.1Smycroft#
2201.1Smycroft#	Build the target object.  The linkfile is created on the fly.
2211.1Smycroft#	Change the SEG directives to suit your system.
2221.1Smycroft#
2231.2Smycroft$(TARGET).o:	$(O_FILES)
2241.2Smycroft	$(LD) -r -o $(TARGET).o $(O_FILES)
2251.1Smycroft
2261.1Smycroft#
2271.1Smycroft#	Just about every file needs fpsp.h so:
2281.1Smycroft#
2291.2Smycroft$(O_FILES):	fpsp.defs
2301.1Smycroft
2311.1Smycroft#
2321.1Smycroft#-----------------------------------------------------------------------
2331.1Smycroft#
2341.1Smycroft#	For making a library version of the FPSP:
2351.1Smycroft#
2361.1Smycroftlibrary:	$(LIB_TARGET)
2371.1Smycroft
2381.2Smycroft$(LIB_TARGET):	$(LIB_O_FILES)
2391.1Smycroft	rm -f $(LIB_TARGET)
2401.2Smycroft	$(AR) crv $(LIB_TARGET) $(LIB_O_FILES)
2411.1Smycroft
2421.2Smycroft$(LIB_O_FILES): l_fpsp.defs
2431.1Smycroft
2441.1Smycroft#
2451.1Smycroft# The entry points to the library version are created here
2461.1Smycroft# by using two template files an awk script and a list of
2471.1Smycroft# the entry routines for each function.
2481.1Smycroft#
2491.1Smycroftl_entry.sa: L_ENTRY.AWK L_LIST MONADIC.$(SYS) DYADIC.$(SYS) l_fpsp.h
2501.1Smycroft	awk -f L_ENTRY.AWK SYS=$(SYS) PREFIX=$(PREFIX) - <L_LIST|sh>l_entry.sa
2511.1Smycroft
2521.1Smycroft#
2531.1Smycroft# Do_func.sa and round.sa need special editing to remove references that
2541.1Smycroft# aren't needed in the library version.  Beware that changes in
2551.1Smycroft# the source code may cause this editing to break....
2561.1Smycroft#
2571.2Smycroftl_do_func.s: do_func.s 
2581.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2591.2Smycroft	echo '/global.*do_func/,/^	rts/d' >.SCRIPT
2601.1Smycroft	echo 'g/smovcr/d' >>.SCRIPT
2611.1Smycroft	echo 'g/tblpre/d' >>.SCRIPT
2621.1Smycroft	echo 'w' >>.SCRIPT
2631.1Smycroft	echo 'q' >>.SCRIPT
2641.3Smycroft	ed - ${.TARGET} <.SCRIPT
2651.1Smycroft	rm .SCRIPT
2661.1Smycroft
2671.2Smycroftl_round.s: round.s 
2681.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2691.1Smycroft	echo '/^not_E3:/-6,/^not_E3:/d' >.SCRIPT
2701.1Smycroft	echo 'w' >>.SCRIPT
2711.1Smycroft	echo 'q' >>.SCRIPT
2721.3Smycroft	ed - ${.TARGET} <.SCRIPT
2731.1Smycroft	rm .SCRIPT
2741.1Smycroft
2751.3Smycroftl_copyright.s: copyright.s 
2761.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2771.3Smycroft
2781.2Smycroftl_sacos.s: sacos.s 
2791.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2801.1Smycroft
2811.2Smycroftl_sasin.s: sasin.s 
2821.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2831.1Smycroft
2841.2Smycroftl_satan.s: satan.s 
2851.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2861.1Smycroft
2871.2Smycroftl_satanh.s: satanh.s 
2881.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2891.1Smycroft
2901.2Smycroftl_scale.s: scale.s 
2911.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2921.1Smycroft
2931.2Smycroftl_scosh.s: scosh.s 
2941.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2951.1Smycroft
2961.2Smycroftl_setox.s: setox.s 
2971.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2981.1Smycroft
2991.2Smycroftl_sgetem.s: sgetem.s 
3001.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3011.1Smycroft
3021.2Smycroftl_sint.s: sint.s 
3031.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3041.1Smycroft
3051.2Smycroftl_slog2.s: slog2.s 
3061.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3071.1Smycroft
3081.2Smycroftl_slogn.s: slogn.s 
3091.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3101.1Smycroft
3111.2Smycroftl_srem_mod.s: srem_mod.s 
3121.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3131.1Smycroft
3141.2Smycroftl_ssin.s: ssin.s 
3151.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3161.1Smycroft
3171.2Smycroftl_ssinh.s: ssinh.s 
3181.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3191.1Smycroft
3201.2Smycroftl_stan.s: stan.s 
3211.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3221.1Smycroft
3231.2Smycroftl_stanh.s: stanh.s 
3241.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3251.1Smycroft
3261.2Smycroftl_stwotox.s: stwotox.s 
3271.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3281.1Smycroft
3291.1Smycroft#
3301.1Smycroft#	Extract all files from SCCS directory
3311.1Smycroft#
3321.1Smycroftclean:
3331.2Smycroft	rm -f $(H_FILES)
3341.2Smycroft	rm -f $(S_FILES)
3351.2Smycroft	rm -f $(O_FILES)
3361.2Smycroft	rm -f $(TARGET).o
3371.2Smycroft	rm -f $(LIB_S_FILES)
3381.2Smycroft	rm -f $(LIB_O_FILES)
3391.2Smycroft	rm -f $(LIB_TARGET)
3401.1Smycroft
3411.1Smycroftclobber:	clean
3421.1Smycroft
343