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