Makefile 5.13 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 27 28 29 30 31 32 33
# 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 Edit
#
# ***********************************
# ***    C h a n g e   L i s t    ***
# ***********************************
# Date       Name         Description
# ----       ----         -----------
# 25-Oct-94  AMcC   Updated for Black build
# 28-Oct-94  AMcC   added -zps1 flag to .c.oz rule (module version)
#

#
# Program specific options:
#
COMPONENT  = Edit
APP        = !Edit
MODULE     = rm.Edit
ROM_MODULE = aof.Edit
RDIR       = Resources
34
LDIR       = LocalRes:
Neil Turton's avatar
Neil Turton committed
35

Stewart Brodie's avatar
Stewart Brodie committed
36 37
MSGS       = Resources.GenMessage

Neil Turton's avatar
Neil Turton committed
38 39 40 41 42 43 44 45 46
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources.${COMPONENT}
RESAPP = <resource$dir>.Apps.${APP}

#
# Generic options:
#
Steve Revill's avatar
Steve Revill committed
47
MKDIR   = do mkdir -p
Neil Turton's avatar
Neil Turton committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
AS      = objasm
CC      = cc
CMHG    = cmhg
CP      = copy
LD      = link
RM      = remove
SQUEEZE = squeeze
WIPE    = -wipe

AFLAGS  = ${THROWBACK} -depend !Depend -nocache -stamp -quit
CFLAGS  = ${THROWBACK} -c -depend !Depend -fah ${INCLUDES} ${DFLAGS} -wp
CPFLAGS = ~cfr~v
WFLAGS  = ~c~v

#
# Libraries
#
ANSILIB   = CLib:o.ansilib
CLIB      = CLib:o.stubs
RLIB      = RISC_OSLib:o.risc_oslib
RSTUBS    = RISC_OSLib:o.rstubs
ROMSTUBS  = RISC_OSLib:o.romstubs
ROMCSTUBS = RISC_OSLib:o.romcstubs
ABSSYM    = RISC_OSLib:o.abssym
WRAPPER   = RISC_OSLib:s.ModuleWrap

INCLUDES   = -IC:

DFLAGS     = 

FILES =\
 ${RDIR}.!Boot\
 ${RDIR}.!Run\
 abs.!RunImage\
 ${RDIR}.Export\
83
 ${LDIR}!Help\
Stewart Brodie's avatar
Stewart Brodie committed
84
 ${MSGS} \
85
 ${LDIR}Templates
Neil Turton's avatar
Neil Turton committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113

# Include these in the ROM module
RESFILES =\
 ${RDIR}.Export

OBJS  = o.edit o.editv o.message o.slist
OBJSZ = oz.edit oz.editv oz.message oz.slist
OBJSD = od.edit od.editv od.message od.slist

#
# Rule patterns
#
.SUFFIXES: .oz .od
.c.o:;      ${CC} ${CFLAGS} -ff -o $@ $<
.c.oz:;     ${CC} ${CFLAGS} -ff -zM -zps1 -o $@ $<
.c.od:;     ${CC} ${CFLAGS} -DTRACE=1 -g -o $@ $<
.s.o:;    ${AS} ${AFLAGS} $< $@

#
# Main rules:
#
all: ${FILES}
	@echo ${COMPONENT}: Application built (Disc)

rom: ${ROM_MODULE}
	@echo ${COMPONENT}: Module built (ROM)

install: ${FILES}
Steve Revill's avatar
Steve Revill committed
114
	${MKDIR} ${INSTDIR}
Neil Turton's avatar
Neil Turton committed
115
	${CP} ${RDIR}.!Boot        ${INSTDIR}.!Boot     ${CPFLAGS}
116
	${CP} ${LDIR}!Help         ${INSTDIR}.!Help     ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
117 118 119
	${CP} ${RDIR}.!Run         ${INSTDIR}.!Run      ${CPFLAGS}
	${CP} abs.!RunImage        ${INSTDIR}.!RunImage ${CPFLAGS}
	${CP} ${RDIR}.Export       ${INSTDIR}.Export    ${CPFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
120
	${CP} ${MSGS}              ${INSTDIR}.Messages  ${CPFLAGS}
121
	${CP} ${LDIR}Templates     ${INSTDIR}.Templates ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
122 123 124 125
	Access ${INSTDIR}.!Boot      lr/r
	Access ${INSTDIR}.!Help      lr/r
	Access ${INSTDIR}.!Run       lr/r
	Access ${INSTDIR}.!RunImage  lr/r
Stewart Brodie's avatar
Stewart Brodie committed
126
	Access ${INSTDIR}.Export     lr/r
Neil Turton's avatar
Neil Turton committed
127 128 129 130 131 132 133 134
	Access ${INSTDIR}.Messages   lr/r
	Access ${INSTDIR}.Templates  lr/r
	@echo ${COMPONENT}: Application installed (Disc)

install_rom: ${ROM_MODULE}
	${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
	@echo ${COMPONENT}: Module installed (ROM)

Stewart Brodie's avatar
Stewart Brodie committed
135
resources: ${MSGS}
Neil Turton's avatar
Neil Turton committed
136 137 138
	${MKDIR} ${RESDIR}
	${MKDIR} ${RESAPP}
	${CP} ${RDIR}.!Boot     ${RESAPP}.!Boot ${CPFLAGS}
139
	${CP} ${LDIR}!Help      ${RESAPP}.!Help ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
140
	${CP} ${RDIR}.ROM.!Run  ${RESAPP}.!Run  ${CPFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
141
	${CP} ${MSGS}           ${RESDIR}.Messages ${CPFLAGS}
142
	${CP} ${LDIR}Templates  ${RESDIR}.Templates ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
143 144 145 146 147 148 149 150 151 152
	@echo ${COMPONENT}: resource files copied to Messages module

clean:
	${WIPE} o.* ${WFLAGS}
	${WIPE} oz.* ${WFLAGS}
	${WIPE} od.* ${WFLAGS}
	${WIPE} linked.* ${WFLAGS}
	${RM} abs.!RunImage
	${RM} ${ROM_MODULE}
	${RM} ${MODULE}
Stewart Brodie's avatar
Stewart Brodie committed
153
	${RM} ${MSGS}
Neil Turton's avatar
Neil Turton committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
	${RM} s.ModuleWrap
	@echo ${COMPONENT}: cleaned

#
# Development rules:
#
mod: ${MODULE}
	@echo ${COMPONENT}: Module built (RAM)

#
# Static dependencies:
#
abs.!RunImage: ${OBJS} ${RLIB} ${CLIB}
	${LD} -o $@ ${OBJS} ${RLIB} ${CLIB}

${MODULE}: oz.ModuleWrap ${OBJSZ} ${RLIB} ${CLIB}
	${LD} -o $@ -module oz.ModuleWrap ${OBJSZ} ${RLIB} ${CLIB}

${ROM_MODULE}: oz.ModuleWrap ${OBJSZ} ${ROMSTUBS}
	${LD} -o $@ -aof oz.ModuleWrap ${OBJSZ} ${ROMSTUBS}

# final link for ROM Image (using given base address)
rom_link:
177
	${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM}
Neil Turton's avatar
Neil Turton committed
178 179 180
	${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
	@echo ${COMPONENT}: rom_link complete

Stewart Brodie's avatar
Stewart Brodie committed
181
oz.ModuleWrap: s.ModuleWrap s.AppName ${MSGS} ${RESFILES}
Neil Turton's avatar
Neil Turton committed
182 183 184 185 186
	${AS} ${AFLAGS} s.ModuleWrap $@

s.ModuleWrap: ${WRAPPER}
	${CP} ${WRAPPER} $@ ${CPFLAGS}

Stewart Brodie's avatar
Stewart Brodie committed
187
${MSGS}: ${LDIR}Messages awk.Version
188
	gnu.gawk -f awk.Version ${LDIR}Messages > $@
Neil Turton's avatar
Neil Turton committed
189 190 191 192 193 194 195 196 197 198 199

#---------------------------------------------------------------------------
# Debugging version:
#
debug.${APP}.!RunImage: ${OBJSD} ${RLIB} ${CLIB}
	${MKDIR} debug
	${MKDIR} debug.${APP}
	${LD} -o $@ -debug ${OBJSD} ${RLIB} ${CLIB}

#---------------------------------------------------------------------------
# Dynamic dependencies: