Makefile revision 1.10
11.10Sthorpej#	$NetBSD: Makefile,v 1.10 2002/06/04 21:39:10 thorpej 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.9StsutsuiCPPFLAGS=	${FPSPCPPFLAGS} ${FPSPMISCCPPFLAGS}
421.8Schs.SUFFIXES:	.o .s .sa .defs .h
431.8Schs
441.8Schs.PATH.h: ${FPSPDIR}
451.8Schs.PATH.s: ${FPSPDIR}
461.8Schs.PATH.sa: ${FPSPDIR}
471.8Schs
481.9StsutsuiAS?		= as
491.7SjeremyLD?		= ld
501.10Sthorpej.if defined(HAVE_GCC3)
511.10SthorpejAFLAGS		= -x assembler-with-cpp -m68040
521.10Sthorpej.else
531.9StsutsuiAFLAGS		= -x assembler-with-cpp -traditional-cpp -m68040
541.10Sthorpej.endif
551.1Smycroft
561.1Smycroft#
571.1Smycroft# For the Library Version:
581.1Smycroft#
591.7SjeremyAR?		= ar
601.2SmycroftLIB_FILTER 	= sed 's/fpsp.defs/l_fpsp.defs/'
611.2SmycroftLIB_TARGET	= lib$(TARGET).a
621.1Smycroft#
631.1Smycroft# SYS selects the template set to use
641.1Smycroft#	templates are supplied for R3V6, CI5 and GEN(generic)
651.1Smycroft# PREFIX is a string that begins a temporary label in the assembler
661.1Smycroft#	R3V6 uses 'L%', CI5 likes '.L'
671.1Smycroft#
681.1Smycroft#SYS		= R3V6
691.1Smycroft#PREFIX		= L%%
701.1Smycroft#
711.1Smycroft#SYS		= CI5
721.1Smycroft#PREFIX		= .L
731.1Smycroft#
741.2Smycroft#SYS		= GEN
751.2Smycroft#PREFIX		= L_
761.2Smycroft#
771.2SmycroftSYS		= GCC
781.1SmycroftPREFIX		= L_
791.1Smycroft
801.1Smycroft.sa.s:
811.8Schs	sh ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET}
821.2Smycroft.h.defs:
831.8Schs	sh ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET}
841.2Smycroft.s.o:
851.9Stsutsui	${CC} ${AFLAGS} ${CPPFLAGS} -c -o ${.TARGET} ${.IMPSRC}
861.1Smycroft
871.2SmycroftH_FILES = \
881.2Smycroft	fpsp.defs \
891.2Smycroft	l_fpsp.defs
901.1Smycroft
911.2SmycroftO_FILES = \
921.3Smycroft	copyright.o \
931.2Smycroft	netbsd.o \
941.2Smycroft	bindec.o \
951.2Smycroft	binstr.o \
961.2Smycroft	decbin.o \
971.2Smycroft	do_func.o \
981.2Smycroft	gen_except.o \
991.2Smycroft	get_op.o \
1001.2Smycroft	kernel_ex.o \
1011.2Smycroft	res_func.o \
1021.2Smycroft	round.o \
1031.2Smycroft	sacos.o \
1041.2Smycroft	sasin.o \
1051.2Smycroft	satan.o \
1061.2Smycroft	satanh.o \
1071.2Smycroft	scosh.o \
1081.2Smycroft	setox.o \
1091.2Smycroft	sgetem.o \
1101.2Smycroft	sint.o \
1111.2Smycroft	slogn.o \
1121.2Smycroft	slog2.o \
1131.2Smycroft	smovecr.o \
1141.2Smycroft	srem_mod.o \
1151.2Smycroft	scale.o \
1161.2Smycroft	ssin.o \
1171.2Smycroft	ssinh.o \
1181.2Smycroft	stan.o \
1191.2Smycroft	stanh.o \
1201.2Smycroft	sto_res.o \
1211.2Smycroft	stwotox.o \
1221.2Smycroft	tbldo.o \
1231.2Smycroft	util.o \
1241.2Smycroft	x_bsun.o \
1251.2Smycroft	x_fline.o \
1261.2Smycroft	x_operr.o \
1271.2Smycroft	x_ovfl.o \
1281.2Smycroft	x_snan.o \
1291.2Smycroft	x_store.o \
1301.2Smycroft	x_unfl.o \
1311.2Smycroft	x_unimp.o \
1321.2Smycroft	x_unsupp.o \
1331.2Smycroft	bugfix.o
1341.2Smycroft
1351.2SmycroftLIB_O_FILES	= \
1361.3Smycroft	l_copyright.o \
1371.2Smycroft	l_entry.o \
1381.2Smycroft	l_do_func.o \
1391.2Smycroft	l_round.o \
1401.2Smycroft	l_sacos.o \
1411.2Smycroft	l_sasin.o \
1421.2Smycroft	l_satan.o \
1431.2Smycroft	l_satanh.o \
1441.2Smycroft	l_scale.o \
1451.2Smycroft	l_scosh.o \
1461.2Smycroft	l_setox.o \
1471.2Smycroft	l_sgetem.o \
1481.2Smycroft	l_sint.o \
1491.2Smycroft	l_slog2.o \
1501.2Smycroft	l_slogn.o \
1511.2Smycroft	l_srem_mod.o \
1521.2Smycroft	l_ssin.o \
1531.2Smycroft	l_ssinh.o \
1541.2Smycroft	l_stan.o \
1551.2Smycroft	l_stanh.o \
1561.2Smycroft	l_stwotox.o \
1571.2Smycroft	l_support.o
1581.1Smycroft
1591.2SmycroftS_FILES = \
1601.2Smycroft	netbsd.s \
1611.1Smycroft	bindec.s \
1621.1Smycroft	binstr.s \
1631.1Smycroft	decbin.s \
1641.1Smycroft	do_func.s \
1651.1Smycroft	get_op.s \
1661.1Smycroft	gen_except.s \
1671.1Smycroft	kernel_ex.s \
1681.1Smycroft	res_func.s \
1691.1Smycroft	round.s \
1701.1Smycroft	sacos.s \
1711.1Smycroft	sasin.s \
1721.1Smycroft	satan.s \
1731.1Smycroft	satanh.s \
1741.1Smycroft	scosh.s \
1751.1Smycroft	setox.s \
1761.1Smycroft	sgetem.s \
1771.1Smycroft	sint.s \
1781.1Smycroft	slogn.s \
1791.1Smycroft	slog2.s \
1801.1Smycroft	smovecr.s \
1811.1Smycroft	srem_mod.s \
1821.1Smycroft	scale.s \
1831.1Smycroft	ssin.s \
1841.1Smycroft	ssinh.s \
1851.1Smycroft	stan.s \
1861.1Smycroft	stanh.s \
1871.1Smycroft	sto_res.s \
1881.1Smycroft	stwotox.s \
1891.1Smycroft	tbldo.s \
1901.1Smycroft	util.s \
1911.1Smycroft	x_bsun.s \
1921.1Smycroft	x_fline.s \
1931.1Smycroft	x_operr.s \
1941.1Smycroft	x_ovfl.s \
1951.1Smycroft	x_snan.s \
1961.1Smycroft	x_store.s \
1971.1Smycroft	x_unfl.s \
1981.1Smycroft	x_unimp.s \
1991.1Smycroft	x_unsupp.s \
2001.2Smycroft	bugfix.s
2011.2Smycroft
2021.2SmycroftLIB_S_FILES	= \
2031.2Smycroft	l_entry.sa l_entry.s \
2041.1Smycroft	l_do_func.s \
2051.1Smycroft	l_round.s \
2061.1Smycroft	l_sacos.s \
2071.1Smycroft	l_sasin.s \
2081.1Smycroft	l_satan.s \
2091.1Smycroft	l_satanh.s \
2101.1Smycroft	l_scale.s \
2111.1Smycroft	l_scosh.s \
2121.1Smycroft	l_setox.s \
2131.1Smycroft	l_sgetem.s \
2141.1Smycroft	l_sint.s \
2151.1Smycroft	l_slog2.s \
2161.1Smycroft	l_slogn.s \
2171.1Smycroft	l_srem_mod.s \
2181.1Smycroft	l_ssin.s \
2191.1Smycroft	l_ssinh.s \
2201.1Smycroft	l_stan.s \
2211.1Smycroft	l_stanh.s \
2221.1Smycroft	l_stwotox.s \
2231.2Smycroft	l_support.s
2241.1Smycroft
2251.1Smycroft#
2261.1Smycroft#	Build the target object.  The linkfile is created on the fly.
2271.1Smycroft#	Change the SEG directives to suit your system.
2281.1Smycroft#
2291.2Smycroft$(TARGET).o:	$(O_FILES)
2301.2Smycroft	$(LD) -r -o $(TARGET).o $(O_FILES)
2311.1Smycroft
2321.1Smycroft#
2331.1Smycroft#	Just about every file needs fpsp.h so:
2341.1Smycroft#
2351.2Smycroft$(O_FILES):	fpsp.defs
2361.1Smycroft
2371.1Smycroft#
2381.1Smycroft#-----------------------------------------------------------------------
2391.1Smycroft#
2401.1Smycroft#	For making a library version of the FPSP:
2411.1Smycroft#
2421.1Smycroftlibrary:	$(LIB_TARGET)
2431.1Smycroft
2441.2Smycroft$(LIB_TARGET):	$(LIB_O_FILES)
2451.1Smycroft	rm -f $(LIB_TARGET)
2461.2Smycroft	$(AR) crv $(LIB_TARGET) $(LIB_O_FILES)
2471.1Smycroft
2481.2Smycroft$(LIB_O_FILES): l_fpsp.defs
2491.1Smycroft
2501.1Smycroft#
2511.1Smycroft# The entry points to the library version are created here
2521.1Smycroft# by using two template files an awk script and a list of
2531.1Smycroft# the entry routines for each function.
2541.1Smycroft#
2551.1Smycroftl_entry.sa: L_ENTRY.AWK L_LIST MONADIC.$(SYS) DYADIC.$(SYS) l_fpsp.h
2561.1Smycroft	awk -f L_ENTRY.AWK SYS=$(SYS) PREFIX=$(PREFIX) - <L_LIST|sh>l_entry.sa
2571.1Smycroft
2581.1Smycroft#
2591.1Smycroft# Do_func.sa and round.sa need special editing to remove references that
2601.1Smycroft# aren't needed in the library version.  Beware that changes in
2611.1Smycroft# the source code may cause this editing to break....
2621.1Smycroft#
2631.2Smycroftl_do_func.s: do_func.s 
2641.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2651.2Smycroft	echo '/global.*do_func/,/^	rts/d' >.SCRIPT
2661.1Smycroft	echo 'g/smovcr/d' >>.SCRIPT
2671.1Smycroft	echo 'g/tblpre/d' >>.SCRIPT
2681.1Smycroft	echo 'w' >>.SCRIPT
2691.1Smycroft	echo 'q' >>.SCRIPT
2701.3Smycroft	ed - ${.TARGET} <.SCRIPT
2711.1Smycroft	rm .SCRIPT
2721.1Smycroft
2731.2Smycroftl_round.s: round.s 
2741.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2751.1Smycroft	echo '/^not_E3:/-6,/^not_E3:/d' >.SCRIPT
2761.1Smycroft	echo 'w' >>.SCRIPT
2771.1Smycroft	echo 'q' >>.SCRIPT
2781.3Smycroft	ed - ${.TARGET} <.SCRIPT
2791.1Smycroft	rm .SCRIPT
2801.1Smycroft
2811.3Smycroftl_copyright.s: copyright.s 
2821.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2831.3Smycroft
2841.2Smycroftl_sacos.s: sacos.s 
2851.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2861.1Smycroft
2871.2Smycroftl_sasin.s: sasin.s 
2881.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2891.1Smycroft
2901.2Smycroftl_satan.s: satan.s 
2911.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2921.1Smycroft
2931.2Smycroftl_satanh.s: satanh.s 
2941.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2951.1Smycroft
2961.2Smycroftl_scale.s: scale.s 
2971.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
2981.1Smycroft
2991.2Smycroftl_scosh.s: scosh.s 
3001.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3011.1Smycroft
3021.2Smycroftl_setox.s: setox.s 
3031.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3041.1Smycroft
3051.2Smycroftl_sgetem.s: sgetem.s 
3061.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3071.1Smycroft
3081.2Smycroftl_sint.s: sint.s 
3091.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3101.1Smycroft
3111.2Smycroftl_slog2.s: slog2.s 
3121.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3131.1Smycroft
3141.2Smycroftl_slogn.s: slogn.s 
3151.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3161.1Smycroft
3171.2Smycroftl_srem_mod.s: srem_mod.s 
3181.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3191.1Smycroft
3201.2Smycroftl_ssin.s: ssin.s 
3211.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3221.1Smycroft
3231.2Smycroftl_ssinh.s: ssinh.s 
3241.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3251.1Smycroft
3261.2Smycroftl_stan.s: stan.s 
3271.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3281.1Smycroft
3291.2Smycroftl_stanh.s: stanh.s 
3301.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3311.1Smycroft
3321.2Smycroftl_stwotox.s: stwotox.s 
3331.3Smycroft	$(LIB_FILTER) ${.ALLSRC} >${.TARGET}
3341.1Smycroft
3351.1Smycroft#
3361.1Smycroft#	Extract all files from SCCS directory
3371.1Smycroft#
3381.1Smycroftclean:
3391.2Smycroft	rm -f $(H_FILES)
3401.2Smycroft	rm -f $(S_FILES)
3411.2Smycroft	rm -f $(O_FILES)
3421.2Smycroft	rm -f $(TARGET).o
3431.2Smycroft	rm -f $(LIB_S_FILES)
3441.2Smycroft	rm -f $(LIB_O_FILES)
3451.2Smycroft	rm -f $(LIB_TARGET)
3461.1Smycroft
3471.1Smycroftclobber:	clean
3481.1Smycroft
349