CModule 17.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Copyright 2008 Castle Technology 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.
#
15
# Makefile fragment for C and C++ modules
Ben Avison's avatar
Ben Avison committed
16 17 18

INCLUDED_CMODULE = YES

19 20 21 22 23 24
#
# $Id$
#
# This makefile provides the following phony targets:
#
#    all 
25
#    export  export_hdrs  export_libs
26
#    resources
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#    rom  rom_link
#    standalone  install
#    debug  gpa_debug
#    prepro
#    clean
#
#
# This fragment uses the following macros set by the master makefile.
#
#
# COMPONENT          (the name of the component)
# TARGET       (opt) (the leafname of the module - otherwise ${COMPONENT})
# ROM_TARGET   (opt) (partially linked module leafname - otherwise ${TARGET} in aof)
# LNK_TARGET   (opt) (fixed-position module leafname - otherwise ${TARGET} in linked)
# SA_TARGET    (opt) (standalone module leafname - otherwise ${TARGET} in rm)
# DBG_TARGET   (opt) (debug module leafname - otherwise ${TARGET}D in rm)
# AIF_TARGET   (opt) (GPA-intermediate leafname - otherwise ${TARGET} in aif)
# GPA_TARGET   (opt) (GPA debug leafname - otherwise ${TARGET} in gpa)
# INSTDIR      (opt) (the target directory - otherwise <Install$Dir>)
# C_EXP_HDR    (opt) (C header target directory - otherwise <cexport$dir>.Interface.h)
# EXP_HDR      (opt) (assembly header target directory - otherwise <export$dir>
# DIRS         (opt) (stamp object for directory creation - otherwise o._dirs)
# HDRS         (opt) (C header files to export, no h. prefix - otherwise ${TARGET})
# ASMHDRS      (opt) (assembly header files to export, no Hdr. prefix - otherwise none)
# ASMCHDRS     (opt) (C-from-assembly auto-generated header files to export, no Hdr. prefix - otherwise none)
52 53 54 55 56 57 58 59 60 61
# INSTRES_FILES   (opt) (extra resource files in addition to Messages - use InstRes specification rules)
# INSTRAM_FILES   (opt) (RAM build specific resources - otherwise ${INSTRES_FILES})
# INSTROM_FILES   (opt) (ROM build specific resources - otherwise ${INSTRES_FILES})
# INSTR??_DEPENDS (opt) (any extra dependency to assert on INSTRES/INSTRAM/INSTROM_FILES)
# MERGEDRDIR      (r/o) (directory for generating exported resources, for information only)
# MERGEDMSGS      (r/o) (leafname of generated Messages file, for compatibility with AAsmModule)
# RESFSDIR        (opt) (actual directory to export resources to - otherwise ${RESDIR}.${TARGET})
# RES_AREA        (opt) (area name to use for embedded messages in standalone build - otherwise Resources)
# RES_OBJ         (opt) (object file for embedded messages in standalone build, no o.prefix - otherwise ${TARGET}Msgs)
# RES_PATH        (opt) (path relative to ResourceFS root to be suffixed by ${TARGET} - otherwise Resources)
62 63 64 65 66 67 68
# CMHGFILE     (opt) (name of CMHG source file, no cmhg. prefix - otherwise ${TARGET}Hdr)
# CMHGAUTOHDR  (opt) (header file, if any, from HDRS or ASMCHDRS, to which to append the SWI defines from CMHG)
# CMHGFILE_SWIPREFIX (opt) (name of SWI prefix used in CMHG file - otherwise ${TARGET})
# OBJS         (opt) (object files, no o. prefixes - otherwise ${TARGET} ${CMHGFILE})
# ROM_OBJS     (opt) (ROM build objects - otherwise ${OBJS})
# SA_OBJS      (opt) (standalone build objects - otherwise ${OBJS})
# DBG_OBJS     (opt) (debug build object files, no prefixes - otherwise ${OBJS})
69
# LIBS         (opt) (extra libraries; ${CLIB} is always used)
70 71 72 73 74
# ROM_LIBS     (opt) (libraries to link for ROM targets - otherwise ${LIBS})
# SA_LIBS      (opt) (libraries to link for standalone targets - otherwise ${LIBS})
# DBG_LIBS     (opt) (extra debug libraries in addition to SA_LIBS and DEBUGLIBS)
# ROM_DEPEND   (opt) (any extra dependency to assert on ROM_TARGET)
# SA_DEPEND    (opt) (any extra dependency to assert on SA_TARGET and DBG_TARGET)
75 76 77 78
# TOKHELPDEPENDS (opt) (set to any source files which need to include any autogenerated tokenised help file - otherwise ${OBJS})
# TOKHELPSRC   (opt) (set equal to ${TOKENSOURCE} to indicate that the binary depends on autogenerated tokenised help source file of that name)
# HELPSRC      (opt) (set to filename containing untokenised help messages if ${TOKHELPSRC} = ${TOKENSOURCE})
# TOKENS       (opt) (set to filename containing help message tokens - otherwise Hdr:Tokens)
79
# CUSTOMEXP    (opt) (set to "custom" to override the export rules)
80
# CUSTOMRES    (opt) (set to "custom" to override the resources rules, or "no" for no resources)
81 82 83 84
# CUSTOMROM    (opt) (set to "custom" to override the rom rules)
# CUSTOMSA     (opt) (set to "custom" to override the standalone rules)
# CUSTOMDBG    (opt) (set to "custom" to override the debug rules)
# CUSTOMGPA    (opt) (set to "custom" to override the GPA rules)
85 86 87 88 89
# RAMCDEFINES  (opt) (additions to CDEFINES for RAM builds - requires ModStdRule to be included later)
# ROMCDEFINES  (opt) (additions to CDEFINES for ROM builds - requires ModStdRule to be included later)
# RAMASMDEFINES (opt) (additions to ASMDEFINES for RAM builds - requires ModStdRule to be included later)
# ROMASMDEFINES (opt) (additions to ASMDEFINES for ROM builds - requires ModStdRule to be included later)
# CMHGDEPENDS  (opt) (source files which need to include the .h file autogenerated from the CMHG file)
90 91
# ASM2TXT      (opt) (source file to be autogenerated using objasm as a text generator; second word if present is "extension" subdirectory to place output into)
# ASM2TXT_SUBDIR (opt) (non-"extension" subdirectory to place ASM2TXT file into)
92
# MODULEWRAP   (opt) (set to "yes" to build and link with the modulewrap veneer from RISC_OSLib)
93 94 95 96 97 98 99
#
#
# It relies on the following from the build system:
#
#
# PHASE            (export phase discriminator)
# CMDHELP          (whether star command help/syntax strings are included)
100
# RESDIR           (installation directory for resources - cf. RESFSDIR)
101 102 103
# FORCEROMLINK     (set to force a relink of the ROM target, used in BBE)
# LINKDIR          (installation directory for LNK_TARGET)
# ADDRESS          (base address for LNK_TARGET)
104
# INSERTVERSION    (awk script to substitute from VersionNum)
105 106 107 108 109
#
#
# It relies on the following generic tool macros from the StdTools makefile
#
#
110
# C + CFLAGS       (C compiler; CDFLAGS also used in debug builds; -g implicit)
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
# CP + CPFLAGS     (copy, cp etc.)
# WIPE + WFLAGS    (recursive delete)
# RM               (non-recursive delete)
# AS + ASFLAGS     (assembler)
# LD + LDFLAGS     (linker; LDDFLAGS also used in debug builds; -d implicit)
# LDRAMFLAGS       (more linker flags)
# LDROMFLAGS       (more linker flags)
# LDLINKFLAGS      (flags for the rom_link phase)
# MODSQZ + MODSQZFLAGS (module binary compressor)
# CHMOD
# MKDIR            (cdir/mkdir -p)
# ECHO
# TOUCH            (create/touch)
# TOKENCHECK
# RESGEN
# TOGPA
#
#
# It relies on the following from the StdRules makefile
#
#
# .c.o  .c++.o  .cpp.o  .s.o
#
#
# It relies on the following from the ModStdRule makefile
#
#
# .cmhg.h  .cmhg.o
#
#
# It relies on the following from the DbgRules makefile
#
#
# CDFLAGS  C++DFLAGS  ASDFLAGS  LDDFLAGS
# .c.od  .c++.od  .cpp.od  .s.od
#
#

INSTALLDIR    = <Install$Dir>
EXPDIR        = <export$dir>
CEXPDIR       = <cexport$dir>

TARGET       ?= ${COMPONENT}
ROM_TARGET   ?= ${TARGET}
LNK_TARGET   ?= ${TARGET}
SA_TARGET    ?= ${TARGET}
DBG_TARGET   ?= ${TARGET}D
AIF_TARGET   ?= ${TARGET}
GPA_TARGET   ?= ${TARGET}
INSTDIR      ?= ${INSTALLDIR}
C_EXP_HDR    ?= ${CEXPDIR}.Interface.h
EXP_HDR      ?= ${EXPDIR}
DIRS         ?= o._dirs
HDRS         ?= ${TARGET}
ASMHDRS      ?= 
ASMCHDRS     ?= 
167 168 169 170 171 172
INSTRAM_FILES   ?= ${INSTRES_FILES}
INSTRAM_DEPENDS ?= ${INSTRES_DEPENDS}
INSTROM_FILES   ?= ${INSTRES_FILES}
INSTROM_DEPENDS ?= ${INSTRES_DEPENDS}
MERGEDRDIR   ?= o._ResData_
MERGEDMSGS   ?= ${MERGEDRDIR}.${TARGET}.Messages
173 174
RES_AREA     ?= Resources
RES_OBJ      ?= ${TARGET}Msgs
175
RES_PATH     ?= Resources
176
RESFSDIR     ?= ${RESDIR}.${TARGET}
177 178 179
CMHGFILE     ?= ${TARGET}Hdr
CMHGFILE_SWIPREFIX ?= ${TARGET}
OBJS         ?= ${TARGET}
180 181 182
ifeq ("${MODULEWRAP}","yes")
OBJS         += modulewrap
endif
183 184 185 186
ROM_OBJS     ?= ${OBJS}
SA_OBJS      ?= ${OBJS}
DBG_OBJS     ?= ${OBJS}
ROM_OBJS     += ${CMHGFILE}
187 188
SA_OBJS      += ${CMHGFILE}
DBG_OBJS     += ${CMHGFILE}
189 190
ifeq ($(filter no custom,${CUSTOMRES}),)
RESDIR       ?= ${MERGEDRDIR}  # Place to internally collect up contents of RES_OBJ
191 192 193
SA_OBJS      += ${RES_OBJ}
DBG_OBJS     += ${RES_OBJ}
endif
194
TOKHELPDEPENDS ?= ${OBJS}
195 196
ROM_LIBS     ?= ${LIBS}
SA_LIBS      ?= ${LIBS}
197
ROM_LIBS     += ${ROMCSTUBS}
198
ROM_SYMS     ?= ${C_ABSSYM}
199
SA_LIBS      += ${CLIB}
200 201 202 203 204 205 206 207 208 209
DBG_LIBS     += ${DEBUGLIBS}

ROM_OBJS_     = $(addprefix o.,${ROM_OBJS})
SA_OBJS_      = $(addprefix o.,${SA_OBJS})
DBG_OBJS_     = $(addprefix od.,${DBG_OBJS})
PP_OBJS_      = $(addprefix i.,$(filter-out ${CMHGFILE} ${RES_OBJ},${DBG_OBJS}))
EXPORTING_HDRS     = $(addprefix exphdr.,${HDRS})
EXPORTING_ASMHDRS  = $(addprefix expasm.,${ASMHDRS})
EXPORTING_ASMCHDRS = $(addprefix expasmc.,${ASMCHDRS})

210 211 212
ifeq ($(filter rom%,${MAKECMDGOALS}),)
CDEFINES     += ${RAMCDEFINES}
ASMDEFINES   += ${RAMASMDEFINES}
213 214
RES_FILES_    = ${INSTRAM_FILES}
RES_DEPENDS_  = ${INSTRAM_DEPENDS}
215 216 217
else
CDEFINES     += ${ROMCDEFINES}
ASMDEFINES   += ${ROMASMDEFINES}
218 219
RES_FILES_    = ${INSTROM_FILES}
RES_DEPENDS_  = ${INSTROM_DEPENDS}
220 221
endif

222 223 224 225
ifneq ($(filter debug%,${MAKECMDGOALS}),)
CMHGFLAGS    += ${CMHGDFLAGS}  # Affects both object and header generation 
endif

226 227 228 229
TOKENS       ?= Hdr:Tokens
# Unlike with AAsmModule, we enforce this filename, to prevent any cross-compilation issues being introduced
TOKENSOURCE  := s.TokHelpSrc

230 231 232 233 234 235
ASM2TXT_BASE := $(word 1,${ASM2TXT})
ASM2TXT_EXT  := $(word 2,${ASM2TXT})
ifneq ("${ASM2TXT_EXT}","")
ASM2TXT_EXT  := ${ASM2TXT_EXT}.
endif

Ben Avison's avatar
Ben Avison committed
236 237 238 239 240 241 242
ifeq ("${INCLUDED_STDTOOLS}","")
include StdTools
endif
ifeq ("${INCLUDED_MODULELIBS}","")
include ModuleLibs
endif

243 244
CFLAGS       := -zM -zps1 ${CFLAGS}

Ben Avison's avatar
Ben Avison committed
245 246 247 248 249 250
ifeq ("${INCLUDED_MODSTDRULE}","")
include ModStdRule
endif
ifeq ("${INCLUDED_DBGRULES}","")
include DbgRules
endif
251

252
ifneq ("${ASM2TXT}","")
253 254 255 256 257 258 259 260
ifneq ($(findstring ${ASM2TXT_BASE},${ASMHDRS}),)
expasm.${ASM2TXT_BASE}: hdr.${ASM2TXT_BASE}
        ${CP} hdr.${ASM2TXT_BASE} ${EXP_HDR}.${ASM2TXT_BASE} ${CPFLAGS}
endif
ifneq ($(findstring ${ASM2TXT_BASE},${HDRS}),)
exphdr.${ASM2TXT_BASE}: h.${ASM2TXT_BASE}
        ${CP} h.${ASM2TXT_BASE} ${C_EXP_HDR}.${ASM2TXT_BASE} ${CPFLAGS}
endif
261 262 263 264 265
${ASM2TXT_SUBDIR}${ASM2TXT_EXT}${ASM2TXT_BASE}: o.${ASM2TXT_BASE} ${DIRS}
        ${LD} -bin -o $@ o.${ASM2TXT_BASE}
        ${SETTYPE} $@ Text
endif

266
#
267
# General rules
268
#
269 270 271 272 273 274 275 276 277 278 279 280 281 282
all: aof.${ROM_TARGET} rm.${SA_TARGET} rm.${DBG_TARGET}
        @${ECHO} ${COMPONENT}: all built

${DIRS} ::
        ${MKDIR} aif
        ${MKDIR} aof
        ${MKDIR} i
        ${MKDIR} linked
        ${MKDIR} gpa
        ${MKDIR} o
        ${MKDIR} od
        ${MKDIR} rm
        ${TOUCH} $@

283 284 285
#
# Clean the module
#
286
clean ::
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
        @IfThere aif    Then ${ECHO} ${WIPE} aif ${WFLAGS}
        @IfThere aif    Then ${WIPE} aif ${WFLAGS}
        @IfThere aof    Then ${ECHO} ${WIPE} aof ${WFLAGS}
        @IfThere aof    Then ${WIPE} aof ${WFLAGS}
        @IfThere i      Then ${ECHO} ${WIPE} i ${WFLAGS}
        @IfThere i      Then ${WIPE} i ${WFLAGS}
        @IfThere linked Then ${ECHO} ${WIPE} linked ${WFLAGS}
        @IfThere linked Then ${WIPE} linked ${WFLAGS}
        @IfThere gpa    Then ${ECHO} ${WIPE} gpa ${WFLAGS}
        @IfThere gpa    Then ${WIPE} gpa ${WFLAGS}
        @IfThere o      Then ${ECHO} ${WIPE} o ${WFLAGS}
        @IfThere o      Then ${WIPE} o ${WFLAGS}
        @IfThere od     Then ${ECHO} ${WIPE} od ${WFLAGS}
        @IfThere od     Then ${WIPE} od ${WFLAGS}
        @IfThere rm     Then ${ECHO} ${WIPE} rm ${WFLAGS}
        @IfThere rm     Then ${WIPE} rm ${WFLAGS}
303
        @IfThere h.${CMHGFILE} Then ${ECHO} ${RM} h.${CMHGFILE}
304
        @IfThere h.${CMHGFILE} Then ${RM} h.${CMHGFILE}
305
        @-${RM} ${TOKENSOURCE}
306 307 308
ifneq ("${ASM2TXT}","")
        @-${RM} ${ASM2TXT_SUBDIR}${ASM2TXT_EXT}${ASM2TXT_BASE}
endif
309 310 311
ifeq ("${MODULEWRAP}","yes")
        @-${RM} s.modulewrap
endif
312 313
        @${ECHO} ${COMPONENT}: cleaned

314 315 316
#
# Export phases
#
317 318 319 320 321 322 323 324 325 326
export${CUSTOMEXP}: export_${PHASE}
        @${NOP}

export_: export_libs export_hdrs
        @${NOP}

create_exp_hdr_dirs:
        ${MKDIR} ${C_EXP_HDR}
        ${MKDIR} ${EXP_HDR}

327
ifneq (${CMHGFILE},)
328
o._h_${CMHGAUTOHDR}: h.${CMHGFILE} ${DIRS}
329
        ${DO} ${AWK} -- "/.ifndef ${CMHGFILE_SWIPREFIX}/,/endif/" h.${CMHGFILE} > o._h_${CMHGAUTOHDR}
330
endif
331 332 333

ifneq ($(findstring ${CMHGAUTOHDR},${HDRS}),)
exphdr.${CMHGAUTOHDR}: h.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
334
        ${FAPPEND} ${C_EXP_HDR}.${CMHGAUTOHDR} h.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
335 336 337 338 339
endif

ifneq ($(findstring ${CMHGAUTOHDR},${ASMCHDRS}),)
expasmc.${CMHGAUTOHDR}: hdr.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
        ${HDR2H} hdr.${CMHGAUTOHDR} ${C_EXP_HDR}.${CMHGAUTOHDR}
340
        ${FAPPEND} ${C_EXP_HDR}.${CMHGAUTOHDR} ${C_EXP_HDR}.${CMHGAUTOHDR} o._h_${CMHGAUTOHDR}
341 342
endif

343 344 345 346 347
ifneq (${CMHGDEPENDS},)
CMHGDEPENDS_ = $(addprefix o.,${CMHGDEPENDS}) $(addprefix od.,${CMHGDEPENDS}) $(addprefix i.,${CMHGDEPENDS})
${CMHGDEPENDS_}: h.${CMHGFILE}
endif

348 349 350 351 352 353 354 355
ifeq (${TOKHELPSRC},${TOKENSOURCE})
TOKHELPDEPENDS_ = $(addprefix o.,${TOKHELPDEPENDS}) $(addprefix od.,${TOKHELPDEPENDS})
${TOKHELPDEPENDS_}: ${TOKHELPSRC}
endif

${TOKENSOURCE}: ${HELPSRC} ${TOKENS}
        ${TOKENISE} ${TOKENS} ${HELPSRC} $@

356 357 358 359 360 361 362 363
ifeq ("${MODULEWRAP}","yes")
s.modulewrap: RISCOSLIB:s.modulewrap
        ${CP} RISCOSLIB:s.modulewrap $@ ${CPFLAGS}

o.modulewrap od.modulewrap: s.modulewrap
        ${AS} ${ASFLAGS} -o $@ s.modulewrap
endif

364 365 366 367 368 369 370 371 372 373 374
.SUFFIXES: .exphdr .expasm .expasmc .h .hdr
.h.exphdr:;    @${ECHO} ${CP} $< ${C_EXP_HDR}.$(subst h.,,$<) ${CPFLAGS} ; ${CP} $< ${C_EXP_HDR}.$(subst h.,,$<) ${CPFLAGS} 
.hdr.expasm:;  @${ECHO} ${CP} $< ${EXP_HDR}.$(subst hdr.,,$<) ${CPFLAGS} ; ${CP} $< ${EXP_HDR}.$(subst hdr.,,$<) ${CPFLAGS} 
.hdr.expasmc:; @${ECHO} ${HDR2H} $< ${C_EXP_HDR}.$(subst hdr.,,$<)       ; ${HDR2H} $< ${C_EXP_HDR}.$(subst hdr.,,$<)

export_hdrs${CUSTOMEXP}: ${EXPORTING_ASMCHDRS} ${EXPORTING_ASMHDRS} ${EXPORTING_HDRS} ${DIRS} create_exp_hdr_dirs
        @${ECHO} ${COMPONENT}: header export complete

export_libs${CUSTOMEXP}:
        @${ECHO} ${COMPONENT}: no exported libraries

375
#
376
# Resources rules
377
#
378
resources${CUSTOMRES}:: resources-${CMDHELP}
379 380
        @${ECHO} ${COMPONENT}: resources copied to Messages module

381 382 383 384 385
ifeq (${CUSTOMRES},no)
resources:
        @${ECHO} ${COMPONENT}: no resources to export
endif        

386 387 388
resources_extra: ${RES_DEPENDS_}
ifneq (${RES_FILES_},)
        ${INSTRES} -I Resources.${USERIF}.${LOCALE},Resources.${USERIF}.UK,Resources.${LOCALE},Resources.UK,Resources ${RESFSDIR} ${RES_FILES_}
389 390 391 392 393
endif
ifneq (,$(filter Messages,${INSTRES_VERSION}))
        ${INSERTVERSION} ${RESFSDIR}.Messages > ${RESFSDIR}._Awk_
        ${CP} ${RESFSDIR}._Awk_ ${RESFSDIR}.Messages ${CPFLAGS}
        ${RM} ${RESFSDIR}._Awk_
394
        ${TOUCH} -r LocalRes:Messages ${RESFSDIR}.Messages
395 396 397
endif
        @${NOP}

398 399 400 401 402
resources_common:
        ${MKDIR} ${RESFSDIR}
        ${TOKENCHECK} LocalRes:Messages
        ${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}

403
resources_cmdhelp:
404
        IfThere LocalRes:CmdHelp Then ${TOKENCHECK} LocalRes:CmdHelp
405
        IfThere LocalRes:CmdHelp Then ${FAPPEND} ${RESFSDIR}.Messages LocalRes:Messages LocalRes:CmdHelp
406

407 408
resources-None: resources_extra resources_common 
        @${NOP}
409

410 411
resources-: resources_extra resources_cmdhelp resources_common
        @${NOP}
412

Ben Avison's avatar
Ben Avison committed
413
ifneq (${RES_OBJ},)
414 415 416
o.${RES_OBJ}: resources-${CMDHELP} ${DIRS}
        ${INSTVIARG} ${MERGEDRDIR} ${RES_PATH} o._ResGen_
        ${RESGEN} ${RES_AREA} $@ -via o._ResGen_
417

418 419
od.${RES_OBJ}: o.${RES_OBJ}
        ${CP} o.${RES_OBJ} $@ ${CPFLAGS}
Ben Avison's avatar
Ben Avison committed
420
endif
421

422 423 424
#
# ROM build rules
#
425 426 427
rom${CUSTOMROM}: aof.${ROM_TARGET}
        @${ECHO} ${COMPONENT}: rom module built

428
rom_link${CUSTOMROM}: linked.${LNK_TARGET}
429
        ${CP} linked.${LNK_TARGET} ${LINKDIR}.${TARGET} ${CPFLAGS}
430
        ${CP} linked.${LNK_TARGET}_sym ${LINKDIR}.${TARGET}_sym ${CPFLAGS}
431 432
        @${ECHO} ${COMPONENT}: rom_link complete

433 434
aof.${ROM_TARGET}: ${ROM_OBJS_} ${ROM_LIBS} ${DIRS} ${ROM_DEPEND}
        ${LD} -o $@ -aof ${ROM_OBJS_} ${ROM_LIBS}
435

436 437
linked.${LNK_TARGET}: aof.${ROM_TARGET} ${ROM_SYMS} ${FORCEROMLINK}
        ${LD} ${LDFLAGS} ${LDLINKFLAGS} -o $@ -rmf -base ${ADDRESS} aof.${ROM_TARGET} ${ROM_SYMS} -Symbols linked.${LNK_TARGET}_sym
438

439
#
440
# Standalone rules
441
#
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
install${CUSTOMSA}: rm.${SA_TARGET}
        ${MKDIR} ${INSTDIR}
        ${CP} rm.${SA_TARGET} ${INSTDIR}.${TARGET} ${CPFLAGS}
        @${ECHO} ${COMPONENT}: ram module installed

standalone${CUSTOMSA}: rm.${SA_TARGET}
        @${ECHO} ${COMPONENT}: ram module built

debug${CUSTOMDBG}: rm.${DBG_TARGET}
        @${ECHO} ${COMPONENT}: debug module built

gpa_debug${CUSTOMGPA}: gpa.${GPA_TARGET}
        @${ECHO} ${COMPONENT}: GPA debug built

prepro: ${PP_OBJS_} ${DIRS}
        @${ECHO} ${COMPONENT}: sources preprocessed

459 460
rm.${SA_TARGET}: ${SA_OBJS_} ${SA_LIBS} ${DIRS} ${SA_DEPEND}
        ${LD} ${LDFLAGS} ${LDRAMFLAGS} -o $@ -rmf ${SA_OBJS_} ${SA_LIBS}
461 462 463
        ${MODSQZ} ${MODSQZFLAGS} $@
        ${CHMOD} -R a+rx rm

464 465
rm.${DBG_TARGET}: ${DBG_OBJS_} ${DBG_LIBS} ${SA_LIBS} ${DIRS} ${SA_DEPEND}
        ${LD} ${LDFLAGS} ${LDRAMFLAGS} -o $@ -rmf ${DBG_OBJS_} ${DBG_LIBS} ${SA_LIBS}
466 467 468 469 470 471
        ${CHMOD} -R a+rx rm

gpa.${GPA_TARGET}: aif.${AIF_TARGET}
        ${TOGPA} -s aif.${AIF_TARGET} $@

aif.${AIF_TARGET}: rm.${DBG_TARGET}
472
        ${LD} -aif -bin -d -o aif.${AIF_TARGET} ${DBG_OBJS_} ${DBG_LIBS} ${SA_LIBS}
473 474

# EOF