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