Makefile 28.1 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
# Copyright 1996 Acorn Computers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for C and RISC_OS Headers, Libraries and Stubs
#
#---------------------------------------------------------------------------------------------
# Library             Exported as             Macro        Runs in   Type          Use
#---------------------------------------------------------------------------------------------
# lib.stubs           CLib:o.stubs            ${CLIB}       RAM      C_Stubs
# lib.risc_oslib      RISC_OSLib:o.risc_oslib ${RLIB}
# lib.rstubs          RISC_OSLib:o.rstubs     ${RSTUBS}     RAM      RISC_OSStubs
# lib.romcstubs       RISC_OSLib:o.romcstubs  ${ROMCSTUBS}  ROM      C_Stubs       Module_Only
# lib.romstubs        RISC_OSLib:o.romstubs   ${ROMSTUBS}   ROM      RISC_OSStubs  Module_Only
# lib.romastubs                                             ROM      RISC_OSStubs  Apps_Only
# lib.ansilib
Ben Avison's avatar
Ben Avison committed
27
# lib.ansilibm
Neil Turton's avatar
Neil Turton committed
28
# lib.clib
29
# lib.OverMgr         CLib:o.overmgr
Neil Turton's avatar
Neil Turton committed
30 31 32 33 34 35 36 37 38 39 40 41
# lib.riscoslibm
#---------------------------------------------------------------------------------------------
#
# ***********************************
# ***    C h a n g e   L i s t    ***
# ***********************************
# Date       Name         Description
# ----       ----         -----------
# 20-Jul-94  AMcC         Created.
# 28-Sep-94  AMcC         Now exports some internal headers for Edit
#

42 43
# Set default component and target.
# Alternative possible target is RISC_OSLib
Stewart Brodie's avatar
Stewart Brodie committed
44 45
COMPONENT ?= SharedCLibrary
TARGET    ?= CLib
46

Neil Turton's avatar
Neil Turton committed
47 48 49 50 51 52 53 54 55
#
# Paths
#
EXP_HDR = <export$dir>
LIBDIR  = <Lib$Dir>

#
# Generic options:
#
Robert Sprowson's avatar
Robert Sprowson committed
56
include Makefiles:StdTools
Neil Turton's avatar
Neil Turton committed
57

58 59
# Note the output redirection on the end of this macro to enable parameters
# to match those of the old application xtentries.
Ben Avison's avatar
Ben Avison committed
60
XTENT   = ${PERL} build:xtentries >
61

62 63
DIFF    = gnu.diff -df >null:

Jeffrey Lee's avatar
Jeffrey Lee committed
64
AFLAGS  = ${STDTOOLOPTIONS}
65
# The zz switch stops library static data being placed in a zero-init area
Jeffrey Lee's avatar
Jeffrey Lee committed
66
CFLAGS  = -c ${STDTOOLOPTIONS} ${INCLUDES} -DDDE -fK -zz10000000 -jC:
Neil Turton's avatar
Neil Turton committed
67 68 69 70 71 72
CPFLAGS = ~cfr~v
WFLAGS  = ~c~r~v

# create a new library, add symbol table
LIBFLAGS = -c -o

73 74 75 76 77
#
# Flags common to *all* phases of linking
#
LDFLAGS = -linkversion 519

Neil Turton's avatar
Neil Turton committed
78 79 80
#
# Include files
#
Kevin Bracey's avatar
Kevin Bracey committed
81
INCLUDES =
Neil Turton's avatar
Neil Turton committed
82 83 84

STK_EXTN =

85
# RISCOS_Lib txt flags
Neil Turton's avatar
Neil Turton committed
86 87 88 89 90 91 92
DFLAGS =\
 -DFIELDNUM\
 -DBIG_WINDOWS\
 -DSETOPTIONS\
 -DALLOW_OLD_PATTERNS\
 -DSET_MISC_OPTIONS

93
# ANSILib and stub flags
Kevin Bracey's avatar
Kevin Bracey committed
94 95 96 97 98 99 100
CLFLAGS =\
 -DDEFAULT_TEXT

ALFLAGS =\
 -PD "DEFAULT_TEXT SETL {TRUE}"

VLFLAGS =\
101
 -DLIB_SHARED="\"\""
Kevin Bracey's avatar
Kevin Bracey committed
102

Neil Turton's avatar
Neil Turton committed
103 104 105 106
# Shared C Library flags
CSFLAGS =\
 -I@,^.clib\
 -DSHARED_C_LIBRARY\
107 108
 -DUROM\
 ${SCL_APCS}
Neil Turton's avatar
Neil Turton committed
109 110

VSFLAGS =\
111 112 113
 -DLIB_SHARED="\"Shared \""

ASFLAGS =\
114
 -PD "SHARED_C_LIBRARY SETL {TRUE}"\
115
 ${SCL_APCS}
Neil Turton's avatar
Neil Turton committed
116

Stewart Brodie's avatar
Stewart Brodie committed
117 118 119 120 121 122
# Setting UROM on the command-line for rlib
UROM_DEFS =\
 -PD "UROM SETL {FALSE}"
UROM_ROM_DEFS =\
 -PD "UROM SETL {TRUE}"

Neil Turton's avatar
Neil Turton committed
123 124
VPATH = @ kernel clib rlib

Ben Avison's avatar
Ben Avison committed
125
.SUFFIXES:  .o .m_o .o_rl .m_o_rl .rm_o .rm_o_rl
Neil Turton's avatar
Neil Turton committed
126 127 128
#
# Rule patterns
#
129
# Note
Kevin Bracey's avatar
Kevin Bracey committed
130
.c.o:;        ${CC} ${CFLAGS} -fah ${CLFLAGS} -o $@ $<
Ben Avison's avatar
Ben Avison committed
131 132
.c.m_o:;      ${CC} ${CFLAGS} -ffah -zM ${CLFLAGS} -o $@ $<
.c.o_rl:;     ${CC} ${CFLAGS} -fah ${DFLAGS} -o $@ $<
Neil Turton's avatar
Neil Turton committed
133
.c.m_o_rl:;   ${CC} ${CFLAGS} -ffah ${DFLAGS} -zM -o $@ $<
134 135
.c.rm_o:;     ${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${OPTIONS} -o $@ $<
.c.rm_o_rl:;  ${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${OPTIONS} -o $@ $<
Robert Sprowson's avatar
Robert Sprowson committed
136 137 138 139 140 141
.s.o:;        ${AS} ${AFLAGS} ${ALFLAGS} $< $@
.s.m_o:;      ${AS} ${AFLAGS} ${ALFLAGS} $< $@
.s.o_rl:;     ${AS} ${AFLAGS} $< $@
.s.m_o_rl:;   ${AS} ${AFLAGS} $< $@
.s.rm_o:;     ${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} $< $@
.s.rm_o_rl:;  ${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} $< $@
Neil Turton's avatar
Neil Turton committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

#
# Libraries
#
CLIB      = CLIB:o.stubs
RLIB      = RISCOSLIB:o.risc_oslib
RSTUBS    = RISCOSLIB:o.rstubs
ROMSTUBS  = RISCOSLIB:o.romstubs
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM    = RISC_OSLib:o.abssym
C_ABSSYM  = RISC_OSLib:o.c_abssym
A_ABSSYM  = RISC_OSLib:o.a_abssym

#
# Program specific options:
#
HEADERS =\
 CLIB:h.assert \
160
 CLIB:h.complex \
Neil Turton's avatar
Neil Turton committed
161 162
 CLIB:h.ctype \
 CLIB:h.errno \
ROOL's avatar
ROOL committed
163
 CLIB:h.fenv \
Neil Turton's avatar
Neil Turton committed
164
 CLIB:h.float \
165 166
 CLIB:h.inttypes \
 CLIB:h.iso646 \
Neil Turton's avatar
Neil Turton committed
167 168 169 170 171 172 173
 CLIB:h.kernel \
 CLIB:h.limits \
 CLIB:h.locale \
 CLIB:h.math \
 CLIB:h.setjmp \
 CLIB:h.signal \
 CLIB:h.stdarg \
174
 CLIB:h.stdbool \
Neil Turton's avatar
Neil Turton committed
175
 CLIB:h.stddef \
176
 CLIB:h.stdint \
Neil Turton's avatar
Neil Turton committed
177 178 179 180
 CLIB:h.stdio \
 CLIB:h.stdlib \
 CLIB:h.string \
 CLIB:h.swis \
181
 CLIB:h.tgmath \
Neil Turton's avatar
Neil Turton committed
182 183
 CLIB:h.time \
 CLIB:h.varargs \
184 185
 CLIB:h.wchar \
 CLIB:h.wctype \
Neil Turton's avatar
Neil Turton committed
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
 RISC_OSLib:h.akbd \
 RISC_OSLib:h.alarm \
 RISC_OSLib:h.baricon \
 RISC_OSLib:h.bbc \
 RISC_OSLib:h.colourmenu \
 RISC_OSLib:h.colourpick \
 RISC_OSLib:h.colourtran \
 RISC_OSLib:h.coords \
 RISC_OSLib:h.dbox \
 RISC_OSLib:h.dboxfile \
 RISC_OSLib:h.dboxquery \
 RISC_OSLib:h.dboxtcol \
 RISC_OSLib:h.dragasprit \
 RISC_OSLib:h.drawfdiag \
 RISC_OSLib:h.drawferror \
 RISC_OSLib:h.drawfobj \
 RISC_OSLib:h.drawftypes \
 RISC_OSLib:h.drawmod \
 RISC_OSLib:h.event \
 RISC_OSLib:h.fileicon \
 RISC_OSLib:h.flex \
 RISC_OSLib:h.font \
208 209
 RISC_OSLib:h.fontlist \
 RISC_OSLib:h.fontselect \
Neil Turton's avatar
Neil Turton committed
210 211
 RISC_OSLib:h.heap \
 RISC_OSLib:h.help \
212
 RISC_OSLib:h.jpeg \
Neil Turton's avatar
Neil Turton committed
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
 RISC_OSLib:h.magnify \
 RISC_OSLib:h.menu \
 RISC_OSLib:h.msgs \
 RISC_OSLib:h.msgtrans \
 RISC_OSLib:h.os \
 RISC_OSLib:h.pointer \
 RISC_OSLib:h.print \
 RISC_OSLib:h.res \
 RISC_OSLib:h.resspr \
 RISC_OSLib:h.saveas \
 RISC_OSLib:h.sprite \
 RISC_OSLib:h.template \
 RISC_OSLib:h.trace \
 RISC_OSLib:h.txt \
 RISC_OSLib:h.txtedit \
 RISC_OSLib:h.txtopt \
 RISC_OSLib:h.txtscrap \
 RISC_OSLib:h.txtwin \
 RISC_OSLib:h.typdat \
 RISC_OSLib:h.visdelay \
 RISC_OSLib:h.werr \
 RISC_OSLib:h.wimp \
 RISC_OSLib:h.wimpt \
 RISC_OSLib:h.win \
 RISC_OSLib:h.xferrecv \
 RISC_OSLib:h.xfersend

LIBRARIES =\
 Clib:o.ansilib \
Ben Avison's avatar
Ben Avison committed
242
 Clib:o.ansilibm \
Neil Turton's avatar
Neil Turton committed
243 244 245 246 247 248 249 250 251 252
 CLib:o.stubs \
 RISC_OSLib:o.risc_oslib \
 RISC_OSLib:o.riscoslibm \
 RISC_OSLib:o.rstubs \
 RISC_OSLib:o.romstubs \
 RISC_OSLib:o.romastubs \
 RISC_OSLib:o.romcstubs

EXPORTED_LIBS =\
 Clib:o.ansilib \
Ben Avison's avatar
Ben Avison committed
253
 Clib:o.ansilibm \
Neil Turton's avatar
Neil Turton committed
254 255
 CLib:o.stubs \
 RISC_OSLib:o.risc_oslib \
256
 RISC_OSLib:o.riscoslibm \
Neil Turton's avatar
Neil Turton committed
257 258 259 260 261 262
 RISC_OSLib:o.rstubs \
 RISC_OSLib:o.romstubs \
 RISC_OSLib:o.romcstubs

MODWRAP   = RISC_OSLib:s.modulewrap

263
OBJECT    = aof.${TARGET}
Neil Turton's avatar
Neil Turton committed
264 265
EXPORTS   = ${MODWRAP} \
            ${EXPORTED_LIBS} \
266
            ${HEADERS}
Neil Turton's avatar
Neil Turton committed
267 268 269 270 271 272

#
# Objects for Clib:o.ansilib
#
ANSI_OBJS =\
 o.alloc o.armprof o.armsys o.clib o.ctype o.error o.fpprintf \
Kevin Bracey's avatar
Kevin Bracey committed
273
 o.kernel o.locale o.math o.memcpset o.overmgr o.printf o.scanf \
274
 o.signal o.sort o.stdio o.stdlib o.string o.swiv o.time o.fenv \
275
 o.longlong o.mathl o.mathasm o.complex o.cxsupport
Neil Turton's avatar
Neil Turton committed
276

Ben Avison's avatar
Ben Avison committed
277 278 279 280 281 282 283
#
# Objects for Clib:o.ansilibm
#
ANSI_MOD_OBJS =\
 m_o.alloc m_o.armprof m_o.armsys m_o.clib m_o.ctype m_o.error m_o.fpprintf \
 m_o.kernel m_o.locale m_o.math m_o.memcpset m_o.overmgr m_o.printf m_o.scanf \
 m_o.signal m_o.sort m_o.stdio m_o.stdlib m_o.string m_o.swiv m_o.time m_o.fenv \
284
 m_o.longlong m_o.mathl m_o.mathasm m_o.complex m_o.cxsupport m_o.cl_stub_m
Ben Avison's avatar
Ben Avison committed
285 286 287 288

#
# Objects for softload shared library
#
Neil Turton's avatar
Neil Turton committed
289 290 291 292 293
RM_OBJS =\
 rm_o.k_modbody \
 rm_o.cl_modbody \
 rm_o.alloc \
 rm_o.armsys \
294
 rm_o.complex \
Neil Turton's avatar
Neil Turton committed
295
 rm_o.ctype \
296
 rm_o.cxsupport \
Neil Turton's avatar
Neil Turton committed
297 298 299
 rm_o.error \
 rm_o.fpprintf \
 rm_o.locale \
300
 rm_o.longlong \
Neil Turton's avatar
Neil Turton committed
301
 rm_o.math \
Kevin Bracey's avatar
Kevin Bracey committed
302
 rm_o.mathasm \
Kevin Bracey's avatar
Kevin Bracey committed
303
 rm_o.memcpset \
Neil Turton's avatar
Neil Turton committed
304 305 306 307 308 309 310 311
 rm_o.printf \
 rm_o.scanf \
 rm_o.signal \
 rm_o.sort \
 rm_o.stdio \
 rm_o.stdlib \
 rm_o.string \
 rm_o.time \
312
 rm_o.fenv \
Neil Turton's avatar
Neil Turton committed
313 314 315 316 317 318 319
 rm_o.swiv \
 rm_o.cl_spare

#
# Objects for lib.clib (relocatable module)
#
CLIB_MOD_OBJS =\
320 321 322 323 324 325 326 327
 rm_o.cl_rmhdr \
 o.initmodule \
 ${RM_OBJS}

#
# Objects for a C library only ROM shared library
#
CLIB_ROM_OBJS =\
Neil Turton's avatar
Neil Turton committed
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
 rm_o.cl_rmhdr \
 rm_o.initmodule \
 ${RM_OBJS}

#
# Objects for ROM shared library
#
ROM_OBJS =\
 rm_o.cl_rmhdr \
 rm_o_rl.initmodule \
 ${RM_OBJS} \
 rm_o_rl.rl_modbody \
 rm_o_rl.akbd \
 rm_o_rl.alarm \
 rm_o_rl.baricon \
 rm_o_rl.bastxt \
 rm_o_rl.bbc \
 rm_o_rl.colourmenu \
 rm_o_rl.colourtran \
 rm_o_rl.dbox \
 rm_o_rl.dboxfile \
 rm_o_rl.dboxquery \
 rm_o_rl.dboxtcol \
 rm_o_rl.dragasprit \
 rm_o_rl.drawmod \
 rm_o_rl.event \
 rm_o_rl.fileicon \
 rm_o_rl.flex \
 rm_o_rl.font \
 rm_o_rl.heap \
358
 rm_o_rl.jpeg \
Neil Turton's avatar
Neil Turton committed
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
 rm_o_rl.magnify \
 rm_o_rl.menu \
 rm_o_rl.msgs \
 rm_o_rl.os \
 rm_o_rl.pointer \
 rm_o_rl.poll \
 rm_o_rl.res \
 rm_o_rl.resspr \
 rm_o_rl.saveas \
 rm_o_rl.sprite \
 rm_o_rl.swi \
 rm_o_rl.template \
 rm_o_rl.txt \
 rm_o_rl.txt1 \
 rm_o_rl.txt3 \
 rm_o_rl.txtar \
 rm_o_rl.txtedit \
 rm_o_rl.txtfile \
 rm_o_rl.txtfind \
 rm_o_rl.txtmisc \
 rm_o_rl.txtoptmenu \
 rm_o_rl.txtscrap \
 rm_o_rl.txtundo \
 rm_o_rl.txtwin \
 rm_o_rl.visdelay \
 rm_o_rl.werr \
 rm_o_rl.wimp \
 rm_o_rl.wimpt \
 rm_o_rl.win \
 rm_o_rl.xferrecv \
 rm_o_rl.xfersend \
 rm_o_rl.help \
 rm_o_rl.print \
 rm_o_rl.txtopt \
 rm_o_rl.txtregexp \
 rm_o_rl.rl_spare

#
# Objects for RISCOSLIB:o.risc_oslib
#
RLIB_OBJS =\
 o_rl.akbd o_rl.alarm o_rl.baricon o_rl.bastxt o_rl.bbc o_rl.colourmenu \
Robert Sprowson's avatar
Robert Sprowson committed
401
 o_rl.colourtran o_rl.coords o_rl.dbox o_rl.dboxfile o_rl.dboxquery \
Neil Turton's avatar
Neil Turton committed
402 403
 o_rl.dboxtcol o_rl.dragasprit o_rl.drawcheck o_rl.drawfdiag o_rl.drawfiles \
 o_rl.drawfobj o_rl.drawmod o_rl.drawtextc o_rl.event o_rl.fileicon o_rl.flex \
404
 o_rl.font o_rl.fontlist o_rl.fontselect o_rl.heap o_rl.help o_rl.jpeg o_rl.magnify o_rl.menu \
405 406 407 408 409
 o_rl.msgs o_rl.os o_rl.pointer o_rl.poll o_rl.print o_rl.res o_rl.resspr \
 o_rl.saveas o_rl.sprite o_rl.swi o_rl.template o_rl.trace o_rl.txt o_rl.txt1 \
 o_rl.txt3 o_rl.txtar o_rl.txtedit o_rl.txtfile o_rl.txtfind o_rl.txtmisc \
 o_rl.txtopt o_rl.txtoptmenu o_rl.txtregexp o_rl.txtscrap o_rl.txtundo o_rl.txtwin \
 o_rl.visdelay o_rl.werr o_rl.wimp o_rl.wimpt o_rl.win o_rl.xferrecv o_rl.xfersend
Neil Turton's avatar
Neil Turton committed
410 411 412 413 414 415

#
# Objects for RISCOSLIB:o.riscoslibm
#
RLIB_MOD_OBJS =\
 m_o_rl.akbd m_o_rl.alarm m_o_rl.baricon m_o_rl.bastxt m_o_rl.bbc \
Robert Sprowson's avatar
Robert Sprowson committed
416
 m_o_rl.colourmenu m_o_rl.colourtran m_o_rl.coords m_o_rl.dbox \
Neil Turton's avatar
Neil Turton committed
417 418 419
 m_o_rl.dboxfile m_o_rl.dboxquery  m_o_rl.dboxtcol m_o_rl.dragasprit \
 m_o_rl.drawcheck m_o_rl.drawfdiag m_o_rl.drawfiles m_o_rl.drawfobj m_o_rl.drawmod \
 m_o_rl.drawtextc m_o_rl.event m_o_rl.fileicon m_o_rl.flex m_o_rl.font \
420
 m_o_rl.fontlist m_o_rl.fontselect m_o_rl.heap m_o_rl.help m_o_rl.jpeg m_o_rl.magnify \
421 422 423 424 425 426
 m_o_rl.menu m_o_rl.msgs m_o_rl.os m_o_rl.pointer m_o_rl.poll m_o_rl.print \
 m_o_rl.res m_o_rl.resspr m_o_rl.saveas m_o_rl.sprite m_o_rl.swi m_o_rl.template \
 m_o_rl.trace m_o_rl.txt m_o_rl.txt1 m_o_rl.txt3 m_o_rl.txtar m_o_rl.txtedit \
 m_o_rl.txtfile m_o_rl.txtfind m_o_rl.txtmisc m_o_rl.txtopt m_o_rl.txtoptmenu \
 m_o_rl.txtregexp m_o_rl.txtscrap m_o_rl.txtundo m_o_rl.txtwin m_o_rl.visdelay \
 m_o_rl.werr m_o_rl.wimp m_o_rl.wimpt m_o_rl.win m_o_rl.xferrecv m_o_rl.xfersend
Neil Turton's avatar
Neil Turton committed
427 428 429 430

#
# Build rules:
#
431
rom: ${OBJECT}
Neil Turton's avatar
Neil Turton committed
432 433 434 435 436 437 438 439 440
	@echo ${COMPONENT}: rom library built

export: export_${PHASE}
	@echo ${COMPONENT}: export complete (${PHASE})

export_hdrs: ${EXP_HDR}.SharedCLib; @

export_libs: ${EXPORTS} dirs; @

Ben Avison's avatar
Ben Avison committed
441 442 443
install: install-${INSTTYPE}

install-: lib.clib
444 445 446 447
	${MKDIR}  ${INSTDIR}
	${CP} lib.clib ${INSTDIR}.${TARGET} ${CPFLAGS}
	@echo ${COMPONENT}: ram module installed

Ben Avison's avatar
Ben Avison committed
448
install-libraries: lib.ansilib lib.ansilibm o.overmgr lib.stubs lib.risc_oslib lib.riscoslibm
449 450 451 452 453 454 455 456 457 458 459 460 461 462
	${MKDIR}                  ${INSTDIR}.CLib.h
	${CP} CLIB:h.*            ${INSTDIR}.CLib.h.*                  ${CPFLAGS}
	${MKDIR}                  ${INSTDIR}.CLib.o
	${CP} lib.ansilib         ${INSTDIR}.CLib.o.*                  ${CPFLAGS}
	${CP} lib.ansilibm        ${INSTDIR}.CLib.o.*                  ${CPFLAGS}
	${CP} o.overmgr           ${INSTDIR}.CLib.o.*                  ${CPFLAGS}
	${CP} lib.stubs           ${INSTDIR}.CLib.o.*                  ${CPFLAGS}
	${MKDIR}                  ${INSTDIR}.RISC_OSLib.h
	${CP} RISC_OSLib:h.*      ${INSTDIR}.RISC_OSLib.h.*            ${CPFLAGS}
	${MKDIR}                  ${INSTDIR}.RISC_OSLib.s
	${CP} s.modulewrap        ${INSTDIR}.RISC_OSLib.s.modulewrap   ${CPFLAGS}
	${MKDIR}                  ${INSTDIR}.RISC_OSLib.o
	${CP} lib.risc_oslib      ${INSTDIR}.RISC_OSLib.o.*            ${CPFLAGS}
	${CP} lib.riscoslibm      ${INSTDIR}.RISC_OSLib.o.*            ${CPFLAGS}
Ben Avison's avatar
Ben Avison committed
463 464
	@echo ${COMPONENT}: libraries installed

465 466
install_rom: ${OBJECT}
	${CP} ${OBJECT} ${INSTDIR}.${TARGET} ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
467 468
	@echo ${COMPONENT}: rom library installed

Ben Avison's avatar
Ben Avison committed
469
clean: clean_all
Neil Turton's avatar
Neil Turton committed
470 471

clean_all:
Robert Sprowson's avatar
Robert Sprowson committed
472 473 474 475 476 477 478 479 480 481
	${XWIPE} o.* ${WFLAGS}
	${XWIPE} m_o.* ${WFLAGS}
	${XWIPE} o_rl.* ${WFLAGS}
	${XWIPE} m_o_rl.* ${WFLAGS}
	${XWIPE} rm_o.* ${WFLAGS}
	${XWIPE} rm_o_rl.* ${WFLAGS}
	${XWIPE} linked.* ${WFLAGS}
	${XWIPE} map.* ${WFLAGS}
	${XWIPE} aof.* ${WFLAGS}
	${XWIPE} syms.* ${WFLAGS}
Neil Turton's avatar
Neil Turton committed
482
	${RM} derived.swis
483
	${RM} s.swioptions
Neil Turton's avatar
Neil Turton committed
484 485 486
	${RM} s.abssym
	${RM} s.c_abssym
	${RM} s.a_abssym
Robert Sprowson's avatar
Robert Sprowson committed
487
	${XWIPE} lib.* ${WFLAGS}
Neil Turton's avatar
Neil Turton committed
488 489 490
	@echo ${COMPONENT}: cleaned

resources:
491
	${MKDIR} ${RESDIR}.RISC_OSLib
Neil Turton's avatar
Neil Turton committed
492
	${MKDIR} ${RESDIR}.CLib
493 494 495 496
	IfThere clib.Resources.${LOCALE}.<System>.Messages Then Set MessagesFile clib.Resources.${LOCALE}.<System>.Messages else Set MessagesFile clib.Resources.${LOCALE}.Messages
	${CP} <MessagesFile> ${RESDIR}.CLib.Messages ${CPFLAGS}
	IfThere rlib.Resources.${LOCALE}.<System>.Messages Then Set MessagesFile rlib.Resources.${LOCALE}.<System>.Messages else Set MessagesFile rlib.Resources.${LOCALE}.Messages
	${CP} <MessagesFile> ${RESDIR}.RISC_OSLib.Messages ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
497 498
	@echo ${COMPONENT}: resource files copied

Stewart Brodie's avatar
Stewart Brodie committed
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515
BBETYPE = clibrary
bbe-clibrary: bbe-generic
	${MKDIR} ${BBEDIR}.clib.Resources.${LOCALE}
	${MKDIR} ${BBEDIR}.rlib.Resources.${LOCALE}
	${MKDIR} ${BBEDIR}.aof
	${MKDIR} ${BBEDIR}.map
	${MKDIR} ${BBEDIR}.syms
	${MKDIR} ${BBEDIR}.linked
	${MKDIR} ${BBEDIR}.kernel.s
	${MKDIR} ${BBEDIR}.clib.s
	${MKDIR} ${BBEDIR}.rlib.s
	BBE_Export_Dir clib.Resources.${LOCALE}.${SYSTEM}
	BBE_Export_File clib.Resources.${LOCALE}.Messages
	BBE_Export_Dir rlib.Resources.${LOCALE}.${SYSTEM}
	BBE_Export_File rlib.Resources.${LOCALE}.Messages
	BBE_Export_File rlib.swi
	BBE_Export_File kernel.s.k_entries
Ben Avison's avatar
Ben Avison committed
516
	BBE_Export_File kernel.s.k_entries2
Stewart Brodie's avatar
Stewart Brodie committed
517
	BBE_Export_File clib.s.cl_entries
Ben Avison's avatar
Ben Avison committed
518
	BBE_Export_File clib.s.cl_entry2
Stewart Brodie's avatar
Stewart Brodie committed
519 520 521 522
	BBE_Export_File rlib.s.rl_entries
	BBE_Export_File aof.${TARGET}
	${CP} clib.rom_link_v ${VERBATIMROMLINK} ${CPFLAGS}

Neil Turton's avatar
Neil Turton committed
523 524 525 526 527 528 529 530 531 532 533 534 535
dirs:
	${MKDIR} ${LIBDIR}
	${MKDIR} ${LIBDIR}.CLib
	${MKDIR} ${LIBDIR}.CLib.h
	${MKDIR} ${LIBDIR}.CLib.o
	${MKDIR} ${LIBDIR}.RISC_OSLib
	${MKDIR} ${LIBDIR}.RISC_OSLib.h
	${MKDIR} ${LIBDIR}.RISC_OSLib.s
	${MKDIR} ${LIBDIR}.RISC_OSLib.o

#
# ROM target {re-linked at ROM Image build time}
#
536
aof.RISC_OSLib: ${ROM_OBJS}
537
	${LD} ${LDFLAGS} -o $@ -aof ${ROM_OBJS}
Neil Turton's avatar
Neil Turton committed
538

539
aof.CLib: ${CLIB_ROM_OBJS}
540
	${LD} ${LDFLAGS} -o $@ -aof ${CLIB_ROM_OBJS}
541

Neil Turton's avatar
Neil Turton committed
542 543 544
#
# Final link for the ROM Image {using given base address}
#
545
rom_link_Entries:
546
	${XTENT} syms.C_Entries kernel.s.k_entries kernel.s.k_entries2 clib.s.cl_entries clib.s.cl_entry2
547
	print rlib.swi { >> syms.C_Entries }
548 549 550
	${XTENT} syms.A_Entries1 kernel.s.k_entries clib.s.cl_entries
	egrep -v "^(0x00000000 . )?_swix?$" < syms.A_Entries1 > syms.A_Entries
	${RM} syms.A_Entries1
551 552

rom_link_RISC_OSLib: ${ROM_OBJS} rom_link_Entries
553
	${XTENT} syms.Entries kernel.s.k_entries kernel.s.k_entries2 clib.s.cl_entries clib.s.cl_entry2 rlib.s.rl_entries
554 555 556 557 558
	print rlib.swi { >> syms.Entries }
	${LD} ${LDFLAGS} -o linked.RISC_OSLib ${ROM_OBJS} \
              -symdefs syms.C_Entries \
              -symdefs syms.A_Entries \
              -symdefs syms.Entries \
559 560 561 562
              -symbols syms.${TARGET} \
              -bin -base ${ADDRESS} \
              -map > map.${TARGET}

563
rom_link_CLib: ${CLIB_ROM_OBJS} rom_link_Entries
564
	${XTENT} syms.Entries kernel.s.k_entries kernel.s.k_entries2 clib.s.cl_entries clib.s.cl_entry2
565 566 567 568 569
	print rlib.swi { >> syms.Entries }
	${LD} ${LDFLAGS} -o linked.CLib ${CLIB_ROM_OBJS} \
              -symdefs syms.C_Entries \
              -symdefs syms.A_Entries \
              -symdefs syms.Entries \
570
              -symbols syms.${TARGET} \
Neil Turton's avatar
Neil Turton committed
571
              -bin -base ${ADDRESS} \
572 573
              -map > map.${TARGET}

Stewart Brodie's avatar
Stewart Brodie committed
574
rom_link: rom_link_${TARGET}
575
	${CP} linked.${TARGET} ${LINKDIR}.${TARGET} ${CPFLAGS}
576
	${CP} syms.${TARGET} ${LINKDIR}.${TARGET}_sym ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
577
	|
578 579 580
	${CP} syms.Entries ${ABSSYM} ${CPFLAGS}
	${CP} syms.C_Entries ${C_ABSSYM} ${CPFLAGS}
	${CP} syms.A_Entries ${A_ABSSYM} ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
581 582 583 584 585 586 587
	|
	@echo ${COMPONENT}: rom_link complete

#
# Build rules for Libraries and Stubs:
#
lib.ansilib: ${ANSI_OBJS}
Robert Sprowson's avatar
Robert Sprowson committed
588
	${AR} ${LIBFLAGS} $@ ${ANSI_OBJS}
Neil Turton's avatar
Neil Turton committed
589

Ben Avison's avatar
Ben Avison committed
590
lib.ansilibm: ${ANSI_MOD_OBJS}
Robert Sprowson's avatar
Robert Sprowson committed
591
	${AR} ${LIBFLAGS} $@ ${ANSI_MOD_OBJS}
Ben Avison's avatar
Ben Avison committed
592

Neil Turton's avatar
Neil Turton committed
593
lib.risc_oslib: ${RLIB_OBJS}
Robert Sprowson's avatar
Robert Sprowson committed
594
	${AR} ${LIBFLAGS} $@ ${RLIB_OBJS}
Neil Turton's avatar
Neil Turton committed
595 596

lib.riscoslibm: ${RLIB_MOD_OBJS}
Robert Sprowson's avatar
Robert Sprowson committed
597
	${AR} ${LIBFLAGS} $@ ${RLIB_MOD_OBJS}
Neil Turton's avatar
Neil Turton committed
598

599
o.cl_stub_r: clib.s.cl_stub_r
Jeffrey Lee's avatar
Jeffrey Lee committed
600
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_stub_r -to $@
Neil Turton's avatar
Neil Turton committed
601

602
o.cl_stub2_r: clib.s.cl_stub2_r
Jeffrey Lee's avatar
Jeffrey Lee committed
603
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_stub2_r -to $@
604 605

o.k_stub2_r: kernel.s.k_stub2_r
Jeffrey Lee's avatar
Jeffrey Lee committed
606
	${AS} ${AFLAGS} ${ALFLAGS} -from kernel.s.k_stub2_r -to $@
607

Ben Avison's avatar
Ben Avison committed
608
m_o.cl_stub_m: clib.s.cl_stub_m
Jeffrey Lee's avatar
Jeffrey Lee committed
609
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_stub_m -to $@
Ben Avison's avatar
Ben Avison committed
610

611
o_rl.rl_stub_r: rlib.s.rl_stub_r
Jeffrey Lee's avatar
Jeffrey Lee committed
612
	${AS} ${AFLAGS} ${ALFLAGS} -from rlib.s.rl_stub_r -to $@
Neil Turton's avatar
Neil Turton committed
613

614
rm_o.cl_stub_rm: clib.s.cl_stub_rm
Jeffrey Lee's avatar
Jeffrey Lee committed
615
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_stub_rm -to $@
616 617

rm_o.cl_stub2_rm: clib.s.cl_stub2_rm
Jeffrey Lee's avatar
Jeffrey Lee committed
618
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_stub2_rm -to $@
619 620

rm_o.k_stub2_rm: kernel.s.k_stub2_rm
Jeffrey Lee's avatar
Jeffrey Lee committed
621
	${AS} ${AFLAGS} ${ALFLAGS} -from kernel.s.k_stub2_rm -to $@
622 623

rm_o_rl.rl_stub_rm: rlib.s.rl_stub_rm
Jeffrey Lee's avatar
Jeffrey Lee committed
624
	${AS} ${AFLAGS} ${ALFLAGS} -from rlib.s.rl_stub_rm -to $@
625

626
lib.stubs: o.cl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
Robert Sprowson's avatar
Robert Sprowson committed
627
	${AR} ${LIBFLAGS} $@ o.cl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
628

629
lib.rstubs: o_rl.rl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
Robert Sprowson's avatar
Robert Sprowson committed
630
	${AR} ${LIBFLAGS} $@ o_rl.rl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
631

632
lib.romcstubs: rm_o.cl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
Robert Sprowson's avatar
Robert Sprowson committed
633
	${AR} ${LIBFLAGS} $@ rm_o.cl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
Neil Turton's avatar
Neil Turton committed
634

635
lib.romstubs: rm_o_rl.rl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
Robert Sprowson's avatar
Robert Sprowson committed
636
	${AR} ${LIBFLAGS} $@ rm_o_rl.rl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
Neil Turton's avatar
Neil Turton committed
637 638

lib.romastubs: rlib.s.rl_stub_a
Robert Sprowson's avatar
Robert Sprowson committed
639
	${AS} ${AFLAGS} -from rlib.s.rl_stub_a -to $@
Neil Turton's avatar
Neil Turton committed
640 641 642

# Non-exported libraries:
lib.clib: ${CLIB_MOD_OBJS}
643
	${LD} ${LDFLAGS} -o $@ -module ${CLIB_MOD_OBJS}
644
	${MODSQZ} $@
Neil Turton's avatar
Neil Turton committed
645 646

# Derived headers:
647 648 649 650 651 652
derived.swis: o.swis
	${LD} -bin -o $@ o.SWIs
	settype $@ text

o.swis: s.makehswis h.swisheader s.swioptions
	${AS} ${AFLAGS} s.makehswis -o $@
Neil Turton's avatar
Neil Turton committed
653 654
	settype $@ text

Jeffrey Lee's avatar
Jeffrey Lee committed
655
s.swioptions: SWIOptions
656 657
	@SWIOptions

Neil Turton's avatar
Neil Turton committed
658 659 660 661 662 663
#
# Rules for exporting:
#
${EXP_HDR}.SharedCLib: hdr.SharedCLib
	${CP} hdr.SharedCLib $@ ${CPFLAGS}

664 665 666 667
# The swis.h header is only copied if the file differs from an existing
# exported header.  This prevents needless recompilations
CLIB:h.swis: derived.swis
	-${DIFF} $@ derived.swis
668
	If "<AMU$ReturnCode>" <> "0" Then ${CP} derived.swis $@ ${CPFLAGS}
669

Neil Turton's avatar
Neil Turton committed
670
# Headers:
671
CLIB:h.assert: clib.h.assert  ;   ${CP} clib.h.assert $@ ${CPFLAGS}
672
CLIB:h.complex: clib.h.complex;   ${CP} clib.h.complex $@ ${CPFLAGS}
673 674
CLIB:h.ctype: clib.h.ctype;       ${CP} clib.h.ctype $@ ${CPFLAGS}
CLIB:h.errno: clib.h.errno;       ${CP} clib.h.errno $@ ${CPFLAGS}
675
CLIB:h.fenv: clib.h.fenv;         ${CP} clib.h.fenv $@ ${CPFLAGS}
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
CLIB:h.float: clib.h.float;       ${CP} clib.h.float $@ ${CPFLAGS}
CLIB:h.inttypes: clib.h.inttypes; ${CP} clib.h.inttypes $@ ${CPFLAGS}
CLIB:h.iso646: clib.h.iso646;     ${CP} clib.h.iso646 $@ ${CPFLAGS}
CLIB:h.kernel: clib.h.kernel;     ${CP} clib.h.kernel $@ ${CPFLAGS}
CLIB:h.limits: clib.h.limits;     ${CP} clib.h.limits $@ ${CPFLAGS}
CLIB:h.locale: clib.h.locale;     ${CP} clib.h.locale $@ ${CPFLAGS}
CLIB:h.math: clib.h.math;         ${CP} clib.h.math $@ ${CPFLAGS}
CLIB:h.setjmp: clib.h.setjmp;     ${CP} clib.h.setjmp $@ ${CPFLAGS}
CLIB:h.signal: clib.h.signal;     ${CP} clib.h.signal $@ ${CPFLAGS}
CLIB:h.stdarg: clib.h.stdarg;     ${CP} clib.h.stdarg $@ ${CPFLAGS}
CLIB:h.stdbool: clib.h.stdbool;   ${CP} clib.h.stdbool $@ ${CPFLAGS}
CLIB:h.stddef: clib.h.stddef;     ${CP} clib.h.stddef $@ ${CPFLAGS}
CLIB:h.stdint: clib.h.stdint;     ${CP} clib.h.stdint $@ ${CPFLAGS}
CLIB:h.stdio: clib.h.stdio;       ${CP} clib.h.stdio $@ ${CPFLAGS}
CLIB:h.stdlib: clib.h.stdlib;     ${CP} clib.h.stdlib $@ ${CPFLAGS}
CLIB:h.string: clib.h.string;     ${CP} clib.h.string $@ ${CPFLAGS}
692
CLIB:h.tgmath: clib.h.tgmath;     ${CP} clib.h.tgmath $@ ${CPFLAGS}
693 694
CLIB:h.time: clib.h.time;         ${CP} clib.h.time $@ ${CPFLAGS}
CLIB:h.varargs: clib.h.varargs;   ${CP} clib.h.varargs $@ ${CPFLAGS}
695 696
CLIB:h.wchar: clib.h.wchar;       ${CP} clib.h.wchar $@ ${CPFLAGS}
CLIB:h.wctype: clib.h.wctype;     ${CP} clib.h.wctype $@ ${CPFLAGS}
697

Neil Turton's avatar
Neil Turton committed
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720

RISC_OSLib:h.akbd: rlib.h.akbd;              ${CP} rlib.h.akbd $@ ${CPFLAGS}
RISC_OSLib:h.alarm: rlib.h.alarm;            ${CP} rlib.h.alarm $@ ${CPFLAGS}
RISC_OSLib:h.baricon: rlib.h.baricon;        ${CP} rlib.h.baricon $@ ${CPFLAGS}
RISC_OSLib:h.bbc: rlib.h.bbc;                ${CP} rlib.h.bbc $@ ${CPFLAGS}
RISC_OSLib:h.colourmenu: rlib.h.colourmenu;  ${CP} rlib.h.colourmenu $@ ${CPFLAGS}
RISC_OSLib:h.colourpick: rlib.h.colourpick;  ${CP} rlib.h.colourpick $@ ${CPFLAGS}
RISC_OSLib:h.colourtran: rlib.h.colourtran;  ${CP} rlib.h.colourtran $@ ${CPFLAGS}
RISC_OSLib:h.coords: rlib.h.coords;          ${CP} rlib.h.coords $@ ${CPFLAGS}
RISC_OSLib:h.dbox: rlib.h.dbox;              ${CP} rlib.h.dbox $@ ${CPFLAGS}
RISC_OSLib:h.dboxfile: rlib.h.dboxfile;      ${CP} rlib.h.dboxfile $@ ${CPFLAGS}
RISC_OSLib:h.dboxquery: rlib.h.dboxquery;    ${CP} rlib.h.dboxquery $@ ${CPFLAGS}
RISC_OSLib:h.dboxtcol: rlib.h.dboxtcol;      ${CP} rlib.h.dboxtcol $@ ${CPFLAGS}
RISC_OSLib:h.dragasprit: rlib.h.dragasprit;  ${CP} rlib.h.dragasprit $@ ${CPFLAGS}
RISC_OSLib:h.drawfdiag: rlib.h.drawfdiag;    ${CP} rlib.h.drawfdiag $@ ${CPFLAGS}
RISC_OSLib:h.drawferror: rlib.h.drawferror;  ${CP} rlib.h.drawferror $@ ${CPFLAGS}
RISC_OSLib:h.drawfobj: rlib.h.drawfobj;      ${CP} rlib.h.drawfobj $@ ${CPFLAGS}
RISC_OSLib:h.drawftypes: rlib.h.drawftypes;  ${CP} rlib.h.drawftypes $@ ${CPFLAGS}
RISC_OSLib:h.drawmod: rlib.h.drawmod;        ${CP} rlib.h.drawmod $@ ${CPFLAGS}
RISC_OSLib:h.event: rlib.h.event;            ${CP} rlib.h.event $@ ${CPFLAGS}
RISC_OSLib:h.fileicon: rlib.h.fileicon;      ${CP} rlib.h.fileicon $@ ${CPFLAGS}
RISC_OSLib:h.flex: rlib.h.flex;              ${CP} rlib.h.flex $@ ${CPFLAGS}
RISC_OSLib:h.font: rlib.h.font;              ${CP} rlib.h.font $@ ${CPFLAGS}
721 722
RISC_OSLib:h.fontlist: rlib.h.fontlist;      ${CP} rlib.h.fontlist $@ ${CPFLAGS}
RISC_OSLib:h.fontselect: rlib.h.fontselect;  ${CP} rlib.h.fontselect $@ ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
723 724
RISC_OSLib:h.heap: rlib.h.heap;              ${CP} rlib.h.heap $@ ${CPFLAGS}
RISC_OSLib:h.help: rlib.h.help;              ${CP} rlib.h.help $@ ${CPFLAGS}
725
RISC_OSLib:h.jpeg: rlib.h.jpeg;              ${CP} rlib.h.jpeg $@ ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
RISC_OSLib:h.magnify: rlib.h.magnify;        ${CP} rlib.h.magnify $@ ${CPFLAGS}
RISC_OSLib:h.menu: rlib.h.menu;              ${CP} rlib.h.menu $@ ${CPFLAGS}
RISC_OSLib:h.msgs: rlib.h.msgs;              ${CP} rlib.h.msgs $@ ${CPFLAGS}
RISC_OSLib:h.msgtrans: rlib.h.msgtrans;      ${CP} rlib.h.msgtrans $@ ${CPFLAGS}
RISC_OSLib:h.os: rlib.h.os;                  ${CP} rlib.h.os $@ ${CPFLAGS}
RISC_OSLib:h.pointer: rlib.h.pointer;        ${CP} rlib.h.pointer $@ ${CPFLAGS}
RISC_OSLib:h.print: rlib.h.print;            ${CP} rlib.h.print $@ ${CPFLAGS}
RISC_OSLib:h.res: rlib.h.res;                ${CP} rlib.h.res $@ ${CPFLAGS}
RISC_OSLib:h.resspr: rlib.h.resspr;          ${CP} rlib.h.resspr $@ ${CPFLAGS}
RISC_OSLib:h.saveas: rlib.h.saveas;          ${CP} rlib.h.saveas $@ ${CPFLAGS}
RISC_OSLib:h.sprite: rlib.h.sprite;          ${CP} rlib.h.sprite $@ ${CPFLAGS}
RISC_OSLib:h.template: rlib.h.template;      ${CP} rlib.h.template $@ ${CPFLAGS}
RISC_OSLib:h.trace: rlib.h.trace;            ${CP} rlib.h.trace $@ ${CPFLAGS}
RISC_OSLib:h.txt: rlib.h.txt;                ${CP} rlib.h.txt $@ ${CPFLAGS}
RISC_OSLib:h.txtedit: rlib.h.txtedit;        ${CP} rlib.h.txtedit $@ ${CPFLAGS}
RISC_OSLib:h.txtopt: rlib.h.txtopt;          ${CP} rlib.h.txtopt $@ ${CPFLAGS}
RISC_OSLib:h.txtscrap: rlib.h.txtscrap;      ${CP} rlib.h.txtscrap $@ ${CPFLAGS}
RISC_OSLib:h.txtwin: rlib.h.txtwin;          ${CP} rlib.h.txtwin $@ ${CPFLAGS}
RISC_OSLib:h.typdat: rlib.h.typdat;          ${CP} rlib.h.typdat $@ ${CPFLAGS}
RISC_OSLib:h.visdelay: rlib.h.visdelay;      ${CP} rlib.h.visdelay $@ ${CPFLAGS}
RISC_OSLib:h.werr: rlib.h.werr;              ${CP} rlib.h.werr $@ ${CPFLAGS}
RISC_OSLib:h.wimp: rlib.h.wimp;              ${CP} rlib.h.wimp $@ ${CPFLAGS}
RISC_OSLib:h.wimpt: rlib.h.wimpt;            ${CP} rlib.h.wimpt $@ ${CPFLAGS}
RISC_OSLib:h.win: rlib.h.win;                ${CP} rlib.h.win $@ ${CPFLAGS}
RISC_OSLib:h.xferrecv: rlib.h.xferrecv;      ${CP} rlib.h.xferrecv $@ ${CPFLAGS}
RISC_OSLib:h.xfersend: rlib.h.xfersend;      ${CP} rlib.h.xfersend $@ ${CPFLAGS}

# Libraries
Clib:o.ansilib:          lib.ansilib;        ${CP} lib.ansilib    $@ ${CPFLAGS}
Ben Avison's avatar
Ben Avison committed
755
Clib:o.ansilibm:         lib.ansilibm;       ${CP} lib.ansilibm   $@ ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770
CLib:o.stubs:            lib.stubs;          ${CP} lib.stubs $@ ${CPFLAGS}
RISC_OSLib:o.risc_oslib: lib.risc_oslib;     ${CP} lib.risc_oslib $@ ${CPFLAGS}
RISC_OSLib:o.riscoslibm: lib.riscoslibm;     ${CP} lib.riscoslibm $@ ${CPFLAGS}
RISC_OSLib:o.rstubs:     lib.rstubs;         ${CP} lib.rstubs $@ ${CPFLAGS}
RISC_OSLib:o.romstubs:   lib.romstubs;       ${CP} lib.romstubs $@ ${CPFLAGS}
RISC_OSLib:o.romastubs:  lib.romastubs;      ${CP} lib.romastubs $@ ${CPFLAGS}
RISC_OSLib:o.romcstubs:  lib.romcstubs;      ${CP} lib.romcstubs $@ ${CPFLAGS}

# ModuleWrap
RISC_OSLib:s.modulewrap: s.modulewrap;       ${CP} s.modulewrap $@ ${CPFLAGS}

#
# Objects whose name isn't the same as their source
#
o.clib: clib.s.cl_obj_r
Robert Sprowson's avatar
Robert Sprowson committed
771
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_obj_r -to $@
Neil Turton's avatar
Neil Turton committed
772 773

o.kernel: kernel.s.k_obj_r
Robert Sprowson's avatar
Robert Sprowson committed
774
	${AS} ${AFLAGS} ${ALFLAGS} -from kernel.s.k_obj_r -to $@
Neil Turton's avatar
Neil Turton committed
775

Ben Avison's avatar
Ben Avison committed
776
m_o.clib: clib.s.cl_obj_m
Robert Sprowson's avatar
Robert Sprowson committed
777
	${AS} ${AFLAGS} ${ALFLAGS} -from clib.s.cl_obj_m -to $@
Ben Avison's avatar
Ben Avison committed
778 779

m_o.kernel: kernel.s.k_obj_m
Robert Sprowson's avatar
Robert Sprowson committed
780
	${AS} ${AFLAGS} ${ALFLAGS} -from kernel.s.k_obj_m -to $@
Neil Turton's avatar
Neil Turton committed
781 782

rm_o.clib:  clib.s.cl_obj_r
Robert Sprowson's avatar
Robert Sprowson committed
783
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from clib.s.cl_obj_r -to $@
Neil Turton's avatar
Neil Turton committed
784 785

rm_o.cl_modbody: clib.s.cl_mod_r
Robert Sprowson's avatar
Robert Sprowson committed
786
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} ${UROM_ROM_DEFS} -from clib.s.cl_mod_r -to $@
Neil Turton's avatar
Neil Turton committed
787 788

rm_o_rl.rl_modbody: rlib.s.rl_mod_r
Robert Sprowson's avatar
Robert Sprowson committed
789
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from rlib.s.rl_mod_r -to $@
Neil Turton's avatar
Neil Turton committed
790 791

rm_o.k_modbody: kernel.s.k_mod_r
Robert Sprowson's avatar
Robert Sprowson committed
792
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from kernel.s.k_mod_r -to $@
Neil Turton's avatar
Neil Turton committed
793 794

rm_o.memcpy: s.memcpy s.h_regs
Robert Sprowson's avatar
Robert Sprowson committed
795
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from s.memcpy -to $@
Neil Turton's avatar
Neil Turton committed
796

797
o.initmodule: clib.s.initmod_r
Robert Sprowson's avatar
Robert Sprowson committed
798
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from clib.s.initmod_r -to $@
Neil Turton's avatar
Neil Turton committed
799

800
rm_o.initmodule: clib.s.initmod_rm
Robert Sprowson's avatar
Robert Sprowson committed
801
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from clib.s.initmod_rm -to $@
802

Neil Turton's avatar
Neil Turton committed
803
rm_o_rl.initmodule: rlib.s.initmod_r
Robert Sprowson's avatar
Robert Sprowson committed
804
	${AS} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from rlib.s.initmod_r -to $@
Neil Turton's avatar
Neil Turton committed
805 806 807 808 809

#
# Objects that require extra flags
#
o.armsys: c.armsys
Kevin Bracey's avatar
Kevin Bracey committed
810
	${CC} ${CFLAGS} -fah ${CLFLAGS} ${VLFLAGS} -o $@ c.armsys
Neil Turton's avatar
Neil Turton committed
811 812

o.armprof: c.armprof
Kevin Bracey's avatar
Kevin Bracey committed
813
	${CC} ${CFLAGS} -fah ${CLFLAGS} ${VLFLAGS} -pcc -o $@ c.armprof
Neil Turton's avatar
Neil Turton committed
814 815

o.string: c.string
Kevin Bracey's avatar
Kevin Bracey committed
816
	${CC} ${CFLAGS} -fah ${CLFLAGS} -DSEPARATE_MEMCPY -DSEPARATE_MEMSET -o $@ c.string
Neil Turton's avatar
Neil Turton committed
817

Ben Avison's avatar
Ben Avison committed
818 819 820 821 822 823 824 825 826
m_o.armsys: c.armsys
	${CC} ${CFLAGS} -ffah -zM ${CLFLAGS} ${VLFLAGS} -o $@ c.armsys

m_o.armprof: c.armprof
	${CC} ${CFLAGS} -ffah -zM ${CLFLAGS} ${VLFLAGS} -pcc -o $@ c.armprof

m_o.string: c.string
	${CC} ${CFLAGS} -ffah -zM ${CLFLAGS} -DSEPARATE_MEMCPY -DSEPARATE_MEMSET -o $@ c.string

Neil Turton's avatar
Neil Turton committed
827
rm_o.armsys: c.armsys
828
	${CC} ${CFLAGS} -ffah -zm1 ${CSFLAGS} ${OPTIONS} ${VSFLAGS} -o $@ c.armsys
Neil Turton's avatar
Neil Turton committed
829 830

rm_o.string: c.string
831
	${CC} ${CFLAGS} -ffah -zm1 ${CSFLAGS} ${OPTIONS} -DSEPARATE_MEMCPY -DSEPARATE_MEMSET -o $@ c.string
Neil Turton's avatar
Neil Turton committed
832 833 834 835

#
# Special case: use "rom_defs" for ROM library (o_rm), "defs" for the others
# Note: New Assembler - could use -PreDefine "UROM SETL {FALSE}"
Stewart Brodie's avatar
Stewart Brodie committed
836

Neil Turton's avatar
Neil Turton committed
837
o_rl.swi: rlib.s.swi
Robert Sprowson's avatar
Robert Sprowson committed
838
	${AS} ${UROM_DEFS} rlib.s.swi o_rl.swi ${AFLAGS}
Neil Turton's avatar
Neil Turton committed
839 840

o_rl.poll: rlib.s.poll
Robert Sprowson's avatar
Robert Sprowson committed
841
	${AS} ${UROM_DEFS} rlib.s.poll o_rl.poll ${AFLAGS}
842

Neil Turton's avatar
Neil Turton committed
843
m_o_rl.swi: rlib.s.swi
Robert Sprowson's avatar
Robert Sprowson committed
844
	${AS} ${UROM_DEFS} rlib.s.swi m_o_rl.swi ${AFLAGS}
Neil Turton's avatar
Neil Turton committed
845 846

m_o_rl.poll: rlib.s.poll
Robert Sprowson's avatar
Robert Sprowson committed
847
	${AS} ${UROM_DEFS} rlib.s.poll m_o_rl.poll ${AFLAGS}
848

Neil Turton's avatar
Neil Turton committed
849
rm_o_rl.swi: rlib.s.swi
Robert Sprowson's avatar
Robert Sprowson committed
850
	${AS} ${UROM_ROM_DEFS} rlib.s.swi rm_o_rl.swi ${AFLAGS} ${OPTIONS}
Neil Turton's avatar
Neil Turton committed
851 852

rm_o_rl.poll: rlib.s.poll
Robert Sprowson's avatar
Robert Sprowson committed
853
	${AS} ${UROM_ROM_DEFS} rlib.s.poll rm_o_rl.poll ${AFLAGS} ${OPTIONS}
Neil Turton's avatar
Neil Turton committed
854 855 856 857 858 859 860 861 862 863 864

#
# trace separated out to allow defining of TRACE
#
o_rl.trace: rlib.c.trace
	${CC} ${CFLAGS} ${DFLAGS} -DTRACE -o o_rl.trace rlib.c.trace

m_o_rl.trace: rlib.c.trace
	${CC} ${CFLAGS} -ffah ${DFLAGS} -zM -DTRACE -o m_o_rl.trace rlib.c.trace

rm_o_rl.trace: rlib.c.trace
865
	${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${STK_EXTN} ${OPTIONS} -DTRACE -o rm_o_rl.trace rlib.c.trace
Neil Turton's avatar
Neil Turton committed
866 867

# Dynamic dependencies: