Makefile 5.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 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 47 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
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources.${COMPONENT}
RESAPP = <resource$dir>.Apps.${APP}

#
# Generic options:
#
MKDIR   = cdir
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 114

# 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}
	${CP} ${RDIR}.!Boot        ${INSTDIR}.!Boot     ${CPFLAGS}
115
	${CP} ${LDIR}!Help         ${INSTDIR}.!Help     ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
116 117 118
	${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
119
	${CP} ${MSGS}              ${INSTDIR}.Messages  ${CPFLAGS}
120
	${CP} ${LDIR}Templates     ${INSTDIR}.Templates ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
121 122 123 124
	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
125
	Access ${INSTDIR}.Export     lr/r
Neil Turton's avatar
Neil Turton committed
126 127 128 129 130 131 132 133
	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
134
resources: ${MSGS}
Neil Turton's avatar
Neil Turton committed
135 136 137
	${MKDIR} ${RESDIR}
	${MKDIR} ${RESAPP}
	${CP} ${RDIR}.!Boot     ${RESAPP}.!Boot ${CPFLAGS}
138
	${CP} ${LDIR}!Help      ${RESAPP}.!Help ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
139
	${CP} ${RDIR}.ROM.!Run  ${RESAPP}.!Run  ${CPFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
140
	${CP} ${MSGS}           ${RESDIR}.Messages ${CPFLAGS}
141
	${CP} ${LDIR}Templates  ${RESDIR}.Templates ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
142 143 144 145 146 147 148 149 150 151
	@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
152
	${RM} ${MSGS}
Neil Turton's avatar
Neil Turton committed
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
	${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:
176
	${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM}
Neil Turton's avatar
Neil Turton committed
177 178 179
	${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
	@echo ${COMPONENT}: rom_link complete

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

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

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

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

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