Makefile 4.11 KB
Newer Older
Richard Buckley's avatar
Richard Buckley committed
1
# Copyright 1997 Acorn Computers Ltd
Neil Turton's avatar
Neil Turton committed
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 27 28
#
# 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 BootCommands
#
# ***********************************
# ***    C h a n g e   L i s t    ***
# ***********************************
# Date           Name       Description
# ----           ----       -----------
# 12th Sep 1994  JC         Created.
#

#
# Generic options:
#
MKDIR   = cdir
Richard Buckley's avatar
Richard Buckley committed
29
CC      = cc -IOS: -fach -wp -DBOOTCMDS
Neil Turton's avatar
Neil Turton committed
30 31 32 33 34 35
CP      = copy
CPFLAGS = ~cfr~v
OBJASM  = ObjAsm ${THROWBACK} -depend !Depend -stamp -quit
CMHG    = CMHG
LINK    = Link 
ZM      = -zM
Richard Buckley's avatar
Richard Buckley committed
36 37 38
WIPE    = -wipe
WFLAGS  = ~c~vr
RM      = remove
Neil Turton's avatar
Neil Turton committed
39 40 41 42 43 44 45 46 47 48 49 50 51

STUBS   = CLib:o.Stubs

#
# Libraries:
#
OSLIB  = OSLib:OSLib.o
RSTUBS = RISC_OSLib:o.romcstubs
ABSSYM = RISC_OSLib:o.abssym

#
# Program specific options:
#
Richard Buckley's avatar
Richard Buckley committed
52 53 54
COMPONENT = BootCmds
TARGET    = aof.${COMPONENT}
RESDIR    = <resource$dir>.Resources2.BootCmds
Neil Turton's avatar
Neil Turton committed
55 56 57 58

OBJS = o.files o.header o.main o.Messages o.Repeat o.riscos

OBJSD = o.header o.hostfs debug.m debug.main debug.trace \
Neil Turton's avatar
Neil Turton committed
59
      debug.riscos debug.files o.Repeat o.Messages debug.svc
Neil Turton's avatar
Neil Turton committed
60 61 62 63 64 65 66 67 68 69

ROM_OBJS = o.files o.header o.main o.Repeat o.riscos

ASMS = s.main

RESOURCES = o.Messages o.Repeat

#
# Generic rules {used by top-level build}:
#
Neil Turton's avatar
Neil Turton committed
70

Richard Buckley's avatar
Richard Buckley committed
71
all: rm.${COMPONENT}
Neil Turton's avatar
Neil Turton committed
72

Neil Turton's avatar
Neil Turton committed
73
rom: ${TARGET}
Neil Turton's avatar
Neil Turton committed
74 75
	@echo BootCmds: rom module built

Neil Turton's avatar
Neil Turton committed
76
export: 
Neil Turton's avatar
Neil Turton committed
77 78
	@echo BootCmds: export complete

Richard Buckley's avatar
Richard Buckley committed
79
install: install_${COMPONENT}
Neil Turton's avatar
Neil Turton committed
80 81

install_rom: ${TARGET}
Neil Turton's avatar
Neil Turton committed
82
	${CP} ${TARGET} ${INSTDIR}.BootCmds ${CPFLAGS}
Richard Buckley's avatar
Richard Buckley committed
83
	@echo ${COMPONENT}: rom module installed
Neil Turton's avatar
Neil Turton committed
84 85

clean:
Richard Buckley's avatar
Richard Buckley committed
86 87 88 89
	${WIPE} o.* ${WFLAGS}
	${WIPE} rm.* ${WFLAGS}
	${WIPE} linked.* ${WFLAGS}
	${WIPE} map.* ${WFLAGS}
Kevin Bracey's avatar
Kevin Bracey committed
90
	${RM} Resources.Repeat
Richard Buckley's avatar
Richard Buckley committed
91 92
	${RM} ${TARGET}
	@echo ${COMPONENT}: cleaned
Neil Turton's avatar
Neil Turton committed
93

Kevin Bracey's avatar
Kevin Bracey committed
94
resources: resources-${CMDHELP}
Neil Turton's avatar
Neil Turton committed
95
	@echo BootCmds: Resources copied to Messages module
Neil Turton's avatar
Neil Turton committed
96

Kevin Bracey's avatar
Kevin Bracey committed
97 98
resources_common:
	${MKDIR} ${RESDIR}
99
	${CP} LocalRes:Messages  ${RESDIR}.Messages  ${CPFLAGS}
Kevin Bracey's avatar
Kevin Bracey committed
100 101 102 103 104

resources-None: resources_common
	@

resources-: resources_common
105
	print LocalRes:CmdHelp { >> ${RESDIR}.Messages }
Kevin Bracey's avatar
Kevin Bracey committed
106

Neil Turton's avatar
Neil Turton committed
107 108 109 110 111 112 113 114 115 116
#
# ROM target (re-linked at ROM Image build time)
#
${TARGET}: ${ROM_OBJS} ${OSLIB} ${RSTUBS}
	${LINK} -o $@ -aof ${ROM_OBJS} ${OSLIB} ${RSTUBS}

#
# Final link for the ROM Image (using given base address)
#
rom_link:
117
	${LINK} -o linked.BootCmds -rmf -base ${ADDRESS} ${TARGET} ${ABSSYM}
Neil Turton's avatar
Neil Turton committed
118
	${CP} linked.BootCmds ${LINKDIR}.BootCmds ${CPFLAGS}
Richard Buckley's avatar
Richard Buckley committed
119
	@echo ${COMPONENT}: rom_link complete
Neil Turton's avatar
Neil Turton committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

#
# Extra {development} rules:
#

asms: ${ASMS}

#Internal targets
RM.BootCmds: ${OBJS} ${OSLIB} ${STUBS}
	${LINK} -rmf -output RM.BootCmds ${OBJS} ${OSLIB} ${STUBS}
	Access RM.BootCmds WR/R

RM.BootCmdsD: ${OBJSD} ${OSLIB} ${STUBS}
	${LINK} -rmf -output RM.BootCmdsD ${OBJSD} ${OSLIB} ${STUBS}
	Access RM.BootCmdsD WR/R

136 137
o.Messages: LocalRes:Messages
	ResGen Messages o.Messages LocalRes:Messages Resources.BootCmds.Messages
Neil Turton's avatar
Neil Turton committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155

o.Repeat: Resources.Repeat
	ResGen Repeat o.Repeat Resources.Repeat Resources.BootCmds.Repeat

Resources.Repeat: o.repeatcmd ${OSLIB} ${STUBS}
	${LINK} -output Resources.Repeat o.repeatcmd ${OSLIB} ${STUBS}

o.repeatcmd: c.repeatcmd
	${CC} ${THROWBACK} -depend !Depend -c -ff c.repeatcmd

debug.trace: h.hostfs

#General rules
.SUFFIXES:   .cmhg .c .debug .o .asm .def
.c.o:;       ${CC} ${THROWBACK} -depend !Depend -c ${ZM} -ff $<
.asm.o:;     ${OBJASM} -stamp -quit $< $@
.asm.debug:; ${OBJASM} -pd "TRACE SETL {TRUE}" -pd "STANDALONE SETL {TRUE}" -stamp -quit $< $@
.c.debug:;   ${CC} ${THROWBACK} -depend !Depend -c ${ZM} -ff -DTRACE=1 -DSTANDALONE -o $@ $<
Stewart Brodie's avatar
Stewart Brodie committed
156
.cmhg.o:;    ${CMHG} -p -depend !Depend $< $@
Neil Turton's avatar
Neil Turton committed
157 158 159 160 161 162 163 164
.c.s:;       ${CC} ${THROWBACK} -depend !Depend -s ${ZM} -ff $<
.def.o:;     DefMod -l -o l.$* < $<
	     LibFile -c -o $@ -via ViaFile
	     Wipe l.$* ~C~FR~V
.def.h:;     DefMod -h < $< > $@
.def.s:;     DefMod -s < $< > $@

# Dynamic dependencies: