1 1.17 apb # $NetBSD: Makefile,v 1.17 2008/10/25 22:27:37 apb Exp $ 2 1.4 cgd 3 1.1 mycroft # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP 4 1.1 mycroft # M68000 Hi-Performance Microprocessor Division 5 1.1 mycroft # M68040 Software Package 6 1.1 mycroft # 7 1.1 mycroft # M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc. 8 1.1 mycroft # All rights reserved. 9 1.1 mycroft # 10 1.1 mycroft # THE SOFTWARE is provided on an "AS IS" basis and without warranty. 11 1.1 mycroft # To the maximum extent permitted by applicable law, 12 1.1 mycroft # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 13 1.1 mycroft # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A 14 1.1 mycroft # PARTICULAR PURPOSE and any warranty against infringement with 15 1.1 mycroft # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) 16 1.1 mycroft # and any accompanying written materials. 17 1.1 mycroft # 18 1.1 mycroft # To the maximum extent permitted by applicable law, 19 1.1 mycroft # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER 20 1.1 mycroft # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS 21 1.1 mycroft # PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR 22 1.1 mycroft # OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE 23 1.1 mycroft # SOFTWARE. Motorola assumes no responsibility for the maintenance 24 1.1 mycroft # and support of the SOFTWARE. 25 1.1 mycroft # 26 1.1 mycroft # You are hereby granted a copyright license to use, modify, and 27 1.1 mycroft # distribute the SOFTWARE so long as this entire notice is retained 28 1.1 mycroft # without alteration in any modified and/or redistributed versions, 29 1.1 mycroft # and that such modified versions are clearly identified as such. 30 1.1 mycroft # No licenses are granted by implication, estoppel or otherwise 31 1.1 mycroft # under any patents or trademarks of Motorola, Inc. 32 1.1 mycroft 33 1.1 mycroft # 34 1.1 mycroft # Makefile 3.3 3/27/91 35 1.1 mycroft # 36 1.1 mycroft # Makefile for 68040 Floating Point Software Package 37 1.1 mycroft # 38 1.1 mycroft 39 1.14 gdamore .include <bsd.prog.mk> 40 1.11 lukem 41 1.2 mycroft TARGET = fpsp 42 1.1 mycroft 43 1.9 tsutsui CPPFLAGS= ${FPSPCPPFLAGS} ${FPSPMISCCPPFLAGS} 44 1.8 chs .SUFFIXES: .o .s .sa .defs .h 45 1.8 chs 46 1.8 chs .PATH.h: ${FPSPDIR} 47 1.8 chs .PATH.s: ${FPSPDIR} 48 1.8 chs .PATH.sa: ${FPSPDIR} 49 1.8 chs 50 1.9 tsutsui AS? = as 51 1.7 jeremy LD? = ld 52 1.10 thorpej AFLAGS = -x assembler-with-cpp -m68040 53 1.1 mycroft 54 1.1 mycroft # 55 1.1 mycroft # For the Library Version: 56 1.1 mycroft # 57 1.7 jeremy AR? = ar 58 1.17 apb LIB_FILTER = ${TOOL_SED} 's/fpsp.defs/l_fpsp.defs/' 59 1.2 mycroft LIB_TARGET = lib$(TARGET).a 60 1.1 mycroft # 61 1.1 mycroft # SYS selects the template set to use 62 1.1 mycroft # templates are supplied for R3V6, CI5 and GEN(generic) 63 1.1 mycroft # PREFIX is a string that begins a temporary label in the assembler 64 1.1 mycroft # R3V6 uses 'L%', CI5 likes '.L' 65 1.1 mycroft # 66 1.1 mycroft #SYS = R3V6 67 1.1 mycroft #PREFIX = L%% 68 1.1 mycroft # 69 1.1 mycroft #SYS = CI5 70 1.1 mycroft #PREFIX = .L 71 1.1 mycroft # 72 1.2 mycroft #SYS = GEN 73 1.2 mycroft #PREFIX = L_ 74 1.2 mycroft # 75 1.2 mycroft SYS = GCC 76 1.1 mycroft PREFIX = L_ 77 1.1 mycroft 78 1.1 mycroft .sa.s: 79 1.15 tsutsui SED=${TOOL_SED:Q} ${HOST_SH} ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET} 80 1.2 mycroft .h.defs: 81 1.15 tsutsui SED=${TOOL_SED:Q} ${HOST_SH} ${FPSPDIR}/asm2gas ${.IMPSRC} >${.TARGET} 82 1.2 mycroft .s.o: 83 1.9 tsutsui ${CC} ${AFLAGS} ${CPPFLAGS} -c -o ${.TARGET} ${.IMPSRC} 84 1.1 mycroft 85 1.2 mycroft H_FILES = \ 86 1.2 mycroft fpsp.defs \ 87 1.2 mycroft l_fpsp.defs 88 1.1 mycroft 89 1.2 mycroft O_FILES = \ 90 1.3 mycroft copyright.o \ 91 1.2 mycroft netbsd.o \ 92 1.2 mycroft bindec.o \ 93 1.2 mycroft binstr.o \ 94 1.2 mycroft decbin.o \ 95 1.2 mycroft do_func.o \ 96 1.2 mycroft gen_except.o \ 97 1.2 mycroft get_op.o \ 98 1.2 mycroft kernel_ex.o \ 99 1.2 mycroft res_func.o \ 100 1.2 mycroft round.o \ 101 1.2 mycroft sacos.o \ 102 1.2 mycroft sasin.o \ 103 1.2 mycroft satan.o \ 104 1.2 mycroft satanh.o \ 105 1.2 mycroft scosh.o \ 106 1.2 mycroft setox.o \ 107 1.2 mycroft sgetem.o \ 108 1.2 mycroft sint.o \ 109 1.2 mycroft slogn.o \ 110 1.2 mycroft slog2.o \ 111 1.2 mycroft smovecr.o \ 112 1.2 mycroft srem_mod.o \ 113 1.2 mycroft scale.o \ 114 1.2 mycroft ssin.o \ 115 1.2 mycroft ssinh.o \ 116 1.2 mycroft stan.o \ 117 1.2 mycroft stanh.o \ 118 1.2 mycroft sto_res.o \ 119 1.2 mycroft stwotox.o \ 120 1.2 mycroft tbldo.o \ 121 1.2 mycroft util.o \ 122 1.2 mycroft x_bsun.o \ 123 1.2 mycroft x_fline.o \ 124 1.2 mycroft x_operr.o \ 125 1.2 mycroft x_ovfl.o \ 126 1.2 mycroft x_snan.o \ 127 1.2 mycroft x_store.o \ 128 1.2 mycroft x_unfl.o \ 129 1.2 mycroft x_unimp.o \ 130 1.2 mycroft x_unsupp.o \ 131 1.2 mycroft bugfix.o 132 1.2 mycroft 133 1.2 mycroft LIB_O_FILES = \ 134 1.3 mycroft l_copyright.o \ 135 1.2 mycroft l_entry.o \ 136 1.2 mycroft l_do_func.o \ 137 1.2 mycroft l_round.o \ 138 1.2 mycroft l_sacos.o \ 139 1.2 mycroft l_sasin.o \ 140 1.2 mycroft l_satan.o \ 141 1.2 mycroft l_satanh.o \ 142 1.2 mycroft l_scale.o \ 143 1.2 mycroft l_scosh.o \ 144 1.2 mycroft l_setox.o \ 145 1.2 mycroft l_sgetem.o \ 146 1.2 mycroft l_sint.o \ 147 1.2 mycroft l_slog2.o \ 148 1.2 mycroft l_slogn.o \ 149 1.2 mycroft l_srem_mod.o \ 150 1.2 mycroft l_ssin.o \ 151 1.2 mycroft l_ssinh.o \ 152 1.2 mycroft l_stan.o \ 153 1.2 mycroft l_stanh.o \ 154 1.2 mycroft l_stwotox.o \ 155 1.2 mycroft l_support.o 156 1.1 mycroft 157 1.2 mycroft S_FILES = \ 158 1.2 mycroft netbsd.s \ 159 1.1 mycroft bindec.s \ 160 1.1 mycroft binstr.s \ 161 1.1 mycroft decbin.s \ 162 1.1 mycroft do_func.s \ 163 1.1 mycroft get_op.s \ 164 1.1 mycroft gen_except.s \ 165 1.1 mycroft kernel_ex.s \ 166 1.1 mycroft res_func.s \ 167 1.1 mycroft round.s \ 168 1.1 mycroft sacos.s \ 169 1.1 mycroft sasin.s \ 170 1.1 mycroft satan.s \ 171 1.1 mycroft satanh.s \ 172 1.1 mycroft scosh.s \ 173 1.1 mycroft setox.s \ 174 1.1 mycroft sgetem.s \ 175 1.1 mycroft sint.s \ 176 1.1 mycroft slogn.s \ 177 1.1 mycroft slog2.s \ 178 1.1 mycroft smovecr.s \ 179 1.1 mycroft srem_mod.s \ 180 1.1 mycroft scale.s \ 181 1.1 mycroft ssin.s \ 182 1.1 mycroft ssinh.s \ 183 1.1 mycroft stan.s \ 184 1.1 mycroft stanh.s \ 185 1.1 mycroft sto_res.s \ 186 1.1 mycroft stwotox.s \ 187 1.1 mycroft tbldo.s \ 188 1.1 mycroft util.s \ 189 1.1 mycroft x_bsun.s \ 190 1.1 mycroft x_fline.s \ 191 1.1 mycroft x_operr.s \ 192 1.1 mycroft x_ovfl.s \ 193 1.1 mycroft x_snan.s \ 194 1.1 mycroft x_store.s \ 195 1.1 mycroft x_unfl.s \ 196 1.1 mycroft x_unimp.s \ 197 1.1 mycroft x_unsupp.s \ 198 1.2 mycroft bugfix.s 199 1.2 mycroft 200 1.2 mycroft LIB_S_FILES = \ 201 1.2 mycroft l_entry.sa l_entry.s \ 202 1.1 mycroft l_do_func.s \ 203 1.1 mycroft l_round.s \ 204 1.1 mycroft l_sacos.s \ 205 1.1 mycroft l_sasin.s \ 206 1.1 mycroft l_satan.s \ 207 1.1 mycroft l_satanh.s \ 208 1.1 mycroft l_scale.s \ 209 1.1 mycroft l_scosh.s \ 210 1.1 mycroft l_setox.s \ 211 1.1 mycroft l_sgetem.s \ 212 1.1 mycroft l_sint.s \ 213 1.1 mycroft l_slog2.s \ 214 1.1 mycroft l_slogn.s \ 215 1.1 mycroft l_srem_mod.s \ 216 1.1 mycroft l_ssin.s \ 217 1.1 mycroft l_ssinh.s \ 218 1.1 mycroft l_stan.s \ 219 1.1 mycroft l_stanh.s \ 220 1.1 mycroft l_stwotox.s \ 221 1.2 mycroft l_support.s 222 1.1 mycroft 223 1.1 mycroft # 224 1.1 mycroft # Build the target object. The linkfile is created on the fly. 225 1.1 mycroft # Change the SEG directives to suit your system. 226 1.1 mycroft # 227 1.2 mycroft $(TARGET).o: $(O_FILES) 228 1.2 mycroft $(LD) -r -o $(TARGET).o $(O_FILES) 229 1.1 mycroft 230 1.1 mycroft # 231 1.1 mycroft # Just about every file needs fpsp.h so: 232 1.1 mycroft # 233 1.2 mycroft $(O_FILES): fpsp.defs 234 1.1 mycroft 235 1.1 mycroft # 236 1.1 mycroft #----------------------------------------------------------------------- 237 1.1 mycroft # 238 1.1 mycroft # For making a library version of the FPSP: 239 1.1 mycroft # 240 1.1 mycroft library: $(LIB_TARGET) 241 1.1 mycroft 242 1.2 mycroft $(LIB_TARGET): $(LIB_O_FILES) 243 1.1 mycroft rm -f $(LIB_TARGET) 244 1.2 mycroft $(AR) crv $(LIB_TARGET) $(LIB_O_FILES) 245 1.1 mycroft 246 1.2 mycroft $(LIB_O_FILES): l_fpsp.defs 247 1.1 mycroft 248 1.1 mycroft # 249 1.1 mycroft # The entry points to the library version are created here 250 1.1 mycroft # by using two template files an awk script and a list of 251 1.1 mycroft # the entry routines for each function. 252 1.1 mycroft # 253 1.1 mycroft l_entry.sa: L_ENTRY.AWK L_LIST MONADIC.$(SYS) DYADIC.$(SYS) l_fpsp.h 254 1.16 apb ${TOOL_AWK} -f L_ENTRY.AWK SYS=$(SYS) PREFIX=$(PREFIX) - \ 255 1.11 lukem <L_LIST | ${HOST_SH} >l_entry.sa 256 1.1 mycroft 257 1.1 mycroft # 258 1.1 mycroft # Do_func.sa and round.sa need special editing to remove references that 259 1.1 mycroft # aren't needed in the library version. Beware that changes in 260 1.1 mycroft # the source code may cause this editing to break.... 261 1.1 mycroft # 262 1.2 mycroft l_do_func.s: do_func.s 263 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 264 1.2 mycroft echo '/global.*do_func/,/^ rts/d' >.SCRIPT 265 1.1 mycroft echo 'g/smovcr/d' >>.SCRIPT 266 1.1 mycroft echo 'g/tblpre/d' >>.SCRIPT 267 1.1 mycroft echo 'w' >>.SCRIPT 268 1.1 mycroft echo 'q' >>.SCRIPT 269 1.3 mycroft ed - ${.TARGET} <.SCRIPT 270 1.1 mycroft rm .SCRIPT 271 1.1 mycroft 272 1.2 mycroft l_round.s: round.s 273 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 274 1.1 mycroft echo '/^not_E3:/-6,/^not_E3:/d' >.SCRIPT 275 1.1 mycroft echo 'w' >>.SCRIPT 276 1.1 mycroft echo 'q' >>.SCRIPT 277 1.3 mycroft ed - ${.TARGET} <.SCRIPT 278 1.1 mycroft rm .SCRIPT 279 1.1 mycroft 280 1.3 mycroft l_copyright.s: copyright.s 281 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 282 1.3 mycroft 283 1.2 mycroft l_sacos.s: sacos.s 284 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 285 1.1 mycroft 286 1.2 mycroft l_sasin.s: sasin.s 287 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 288 1.1 mycroft 289 1.2 mycroft l_satan.s: satan.s 290 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 291 1.1 mycroft 292 1.2 mycroft l_satanh.s: satanh.s 293 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 294 1.1 mycroft 295 1.2 mycroft l_scale.s: scale.s 296 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 297 1.1 mycroft 298 1.2 mycroft l_scosh.s: scosh.s 299 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 300 1.1 mycroft 301 1.2 mycroft l_setox.s: setox.s 302 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 303 1.1 mycroft 304 1.2 mycroft l_sgetem.s: sgetem.s 305 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 306 1.1 mycroft 307 1.2 mycroft l_sint.s: sint.s 308 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 309 1.1 mycroft 310 1.2 mycroft l_slog2.s: slog2.s 311 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 312 1.1 mycroft 313 1.2 mycroft l_slogn.s: slogn.s 314 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 315 1.1 mycroft 316 1.2 mycroft l_srem_mod.s: srem_mod.s 317 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 318 1.1 mycroft 319 1.2 mycroft l_ssin.s: ssin.s 320 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 321 1.1 mycroft 322 1.2 mycroft l_ssinh.s: ssinh.s 323 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 324 1.1 mycroft 325 1.2 mycroft l_stan.s: stan.s 326 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 327 1.1 mycroft 328 1.2 mycroft l_stanh.s: stanh.s 329 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 330 1.1 mycroft 331 1.2 mycroft l_stwotox.s: stwotox.s 332 1.3 mycroft $(LIB_FILTER) ${.ALLSRC} >${.TARGET} 333 1.1 mycroft 334 1.1 mycroft # 335 1.1 mycroft # Extract all files from SCCS directory 336 1.1 mycroft # 337 1.1 mycroft clean: 338 1.2 mycroft rm -f $(H_FILES) 339 1.2 mycroft rm -f $(S_FILES) 340 1.2 mycroft rm -f $(O_FILES) 341 1.2 mycroft rm -f $(TARGET).o 342 1.2 mycroft rm -f $(LIB_S_FILES) 343 1.2 mycroft rm -f $(LIB_O_FILES) 344 1.2 mycroft rm -f $(LIB_TARGET) 345 1.1 mycroft 346 1.1 mycroft clobber: clean 347