Makefile 7.37 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 34
# 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 Paint
#
# ***********************************
# ***    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  = Paint
APP        = !Paint
MODULE     = rm.!Paint
ROM_MODULE = aof.Paint
RDIR       = Resources
LDIR       = ${RDIR}.${LOCALE}
35
MSGVERSION = ${AWK} -f Build:AwkVers
36 37
MSGS       = Resources.GenMessage

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

44 45 46 47 48 49 50
include StdTools
include ModuleLibs

SQZFLAGS  = -f
CINCLUDES = -IC:
ASFLAGS   = ${STDTOOLOPTIONS} -nocache -stamp -quit
CFLAGS    = ${STDTOOLOPTIONS} ${C_WARNINGS} ${CINCLUDES} -wp
Neil Turton's avatar
Neil Turton committed
51
WRAPPER   = RISC_OSLib:s.ModuleWrap
52
LIBSD     = ${RLIB} ${CLIB}
Neil Turton's avatar
Neil Turton committed
53 54

#
55
# Include files:
Neil Turton's avatar
Neil Turton committed
56 57 58 59 60
#
FILES = \
 ${RDIR}.!Boot\
 ${LDIR}.!Help\
 ${LDIR}.!Run\
61
 ${MSGS} \
Neil Turton's avatar
Neil Turton committed
62 63 64 65 66 67 68 69
 ${LDIR}.Sprites\
 ${LDIR}.Templates\
 abs.!RunImage

FILESD = \
 ${RDIR}.!Boot\
 ${LDIR}.!Help\
 ${LDIR}.!Run\
70
 ${MSGS} \
Neil Turton's avatar
Neil Turton committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
 ${LDIR}.Sprites\
 ${LDIR}.Templates\
 abs.!RunImageD

RESFILES =

DFILES = \
 debug.${APP}.!Boot\
 debug.${APP}.!Help\
 debug.${APP}.!Run\
 debug.${APP}.!RunImage\
 debug.${APP}.Messages\
 debug.${APP}.Sprites\
 debug.${APP}.Templates

ROOL's avatar
ROOL committed
86
OBJS      = o.colourpanel o.colours o.main o.menus o.psprite o.sprwindow o.tools o.toolwindow \
87
            o.AltRename o.PaintLib o.CnPDrag o.Clipboard o.Drawfile
ROOL's avatar
ROOL committed
88
OBJSZ     = oz.colourpanel oz.colours oz.main oz.menus oz.psprite oz.sprwindow\
89
            oz.tools oz.toolwindow oz.AltRename oz.PaintLib oz.CnPDrag oz.Clipboard oz.Drawfile
ROOL's avatar
ROOL committed
90
OBJSD     = od.colourpanel od.colours od.ftrace od.guard od.main od.menus\
91
            od.psprite od.sprwindow od.tools od.toolwindow o.m\
92
            od.AltRename od.PaintLib od.CnPDrag od.Clipboard od.Drawfile
ROOL's avatar
ROOL committed
93
ASMS      = s.colourpanel s.colours s.main s.menus s.psprite s.sprwindow s.tools s.toolwindow
Neil Turton's avatar
Neil Turton committed
94 95 96 97

#
# Rule patterns
#
98 99 100 101 102 103
.SUFFIXES: .oz .od .asm
.c.o:;    ${CC} ${CFLAGS} -c ${C_NO_FNAMES} $<
.c.oz:;   ${CC} ${CFLAGS} -c ${C_NO_FNAMES} ${C_MODULE} ${C_NO_STKCHK} -o $@ $<
.c.od:;   ${CC} ${CFLAGS} -c -DTRACE=1 -g -o $@ $<
.asm.o:;  ${AS} ${ASFLAGS} $< $@
.c.s:;    ${CC} ${CFLAGS} -s ${C_NO_FNAMES} $<
Neil Turton's avatar
Neil Turton committed
104 105 106 107 108

#
# Main rules:
#
all: ${FILES}
109
	@${ECHO} ${COMPONENT}: Application built (Disc)
Neil Turton's avatar
Neil Turton committed
110 111

rom: ${ROM_MODULE}
112 113 114 115 116 117 118 119 120
	@${ECHO} ${COMPONENT}: Module built (ROM)

ifeq (${TARGET},ThemeDefs)
install:
	${MKDIR} ${INSTDIR}.${USERIF}
	${CP} LocalRes:DiscSprites.Sprites   ${INSTDIR}.${USERIF}.Paint   ${CPFLAGS}
	${CP} LocalRes:DiscSprites.Sprites22 ${INSTDIR}.${USERIF}.Paint22 ${CPFLAGS}
	@${ECHO} ${COMPONENT}: disc theme resources installed
else
Neil Turton's avatar
Neil Turton committed
121
install: ${FILES}
122
	${MKDIR} ${INSTDIR}
Neil Turton's avatar
Neil Turton committed
123 124 125 126
	${CP} ${RDIR}.!Boot      ${INSTDIR}.!Boot      ${CPFLAGS}
	${CP} ${LDIR}.!Help      ${INSTDIR}.!Help      ${CPFLAGS}
	${CP} ${LDIR}.!Run       ${INSTDIR}.!Run       ${CPFLAGS}
	${CP} abs.!RunImage      ${INSTDIR}.!RunImage  ${CPFLAGS}
127
	${CP} ${MSGS}            ${INSTDIR}.Messages   ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
128 129 130 131 132 133 134 135 136
	${CP} ${LDIR}.Sprites    ${INSTDIR}.Sprites    ${CPFLAGS}
	${CP} ${LDIR}.Templates  ${INSTDIR}.Templates  ${CPFLAGS}
	Access ${INSTDIR}.!Boot      lr/r
	Access ${INSTDIR}.!Help      lr/r
	Access ${INSTDIR}.!Run       lr/r
	Access ${INSTDIR}.!RunImage  lr/r
	Access ${INSTDIR}.Messages   lr/r
	Access ${INSTDIR}.Sprites    lr/r
	Access ${INSTDIR}.Templates  lr/r
137 138
	@${ECHO} ${COMPONENT}: Application installed (Disc)
endif
Neil Turton's avatar
Neil Turton committed
139 140 141 142 143 144

installd: ${FILESD}
	${CP} ${RDIR}.!Boot      ${INSTDIR}.!Boot      ${CPFLAGS}
	${CP} ${LDIR}.!Help      ${INSTDIR}.!Help      ${CPFLAGS}
	${CP} ${LDIR}.!Run       ${INSTDIR}.!Run       ${CPFLAGS}
	${CP} abs.!RunImageD     ${INSTDIR}.!RunImage  ${CPFLAGS}
145
	${CP} ${MSGS}            ${INSTDIR}.Messages   ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
146 147 148 149 150 151 152 153 154
	${CP} ${LDIR}.Sprites    ${INSTDIR}.Sprites    ${CPFLAGS}
	${CP} ${LDIR}.Templates  ${INSTDIR}.Templates  ${CPFLAGS}
	Access ${INSTDIR}.!Boot      lr/r
	Access ${INSTDIR}.!Help      lr/r
	Access ${INSTDIR}.!Run       lr/r
	Access ${INSTDIR}.!RunImage  lr/r
	Access ${INSTDIR}.Messages   lr/r
	Access ${INSTDIR}.Sprites    lr/r
	Access ${INSTDIR}.Templates  lr/r
155
	@${ECHO} ${COMPONENT}: Debug application installed (Disc)
Neil Turton's avatar
Neil Turton committed
156 157 158

install_rom: ${ROM_MODULE}
	${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
159
	@${ECHO} ${COMPONENT}: Module installed (ROM)
Neil Turton's avatar
Neil Turton committed
160

161
resources: ${MSGS}
Neil Turton's avatar
Neil Turton committed
162 163 164 165 166 167
	${MKDIR} ${RESDIR}
	${MKDIR} ${RESAPP}
	${CP} ${RDIR}.!Boot     ${RESAPP}.!Boot  ${CPFLAGS}
	${CP} ${LDIR}.!Help     ${RESAPP}.!Help  ${CPFLAGS}
	${CP} ${RDIR}.ROM.!Run  ${RESAPP}.!Run   ${CPFLAGS}
	|
168
	${CP} ${MSGS}           ${RESDIR}.Messages   ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
169 170
	${CP} ${LDIR}.Sprites   ${RESDIR}.Sprites   ${CPFLAGS}
	${CP} ${LDIR}.Templates ${RESDIR}.Templates ${CPFLAGS}
171
	@${ECHO} ${COMPONENT}: resource files copied to Messages module
Neil Turton's avatar
Neil Turton committed
172 173

clean:
174 175 176 177 178 179
	${XWIPE} o.* ${WFLAGS}
	${XWIPE} oz.* ${WFLAGS}
	${XWIPE} od.* ${WFLAGS}
	${XWIPE} s.* ${WFLAGS}
	${XWIPE} linked.* ${WFLAGS}
	${XWIPE} map.* ${WFLAGS}
180 181
	${XWIPE} debug.!Paint.* ${WFLAGS}
	${XWIPE} !Paint.* ${WFLAGS}
Neil Turton's avatar
Neil Turton committed
182 183 184
	${RM} abs.!RunImage
	${RM} abs.!RunImageD
	${RM} ${ROM_MODULE}
185
	${RM} ${MSGS}
Neil Turton's avatar
Neil Turton committed
186
	${RM} ${MODULE}
187
	@${ECHO} ${COMPONENT}: cleaned
Neil Turton's avatar
Neil Turton committed
188 189 190 191 192 193

#
# Static dependencies:
#
abs.!RunImage: ${OBJS} ${RLIB} ${CLIB}
	${LD} -o $@ ${OBJS} ${RLIB} ${CLIB}
194
	${SQZ} ${SQZFLAGS} $@
Neil Turton's avatar
Neil Turton committed
195 196 197 198 199 200 201 202 203

${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:
204
	${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
Neil Turton's avatar
Neil Turton committed
205 206
              -map > map.${COMPONENT}
	${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
207
	@${ECHO} ${COMPONENT}: rom_link complete
Neil Turton's avatar
Neil Turton committed
208

209
oz.ModuleWrap: s.ModuleWrap ${MSGS} s.AppName ${RESFILES} s.Resfiles
Neil Turton's avatar
Neil Turton committed
210 211 212 213 214
	${AS} ${AFLAGS} s.ModuleWrap $@

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

215 216
${MSGS}: ${LDIR}.Messages VersionNum
	${MSGVERSION} ${LDIR}.Messages > $@
Neil Turton's avatar
Neil Turton committed
217 218 219 220

s.ResFiles: asm.ResFiles
	${CP} asm.ResFiles $@ ${CPFLAGS}

221 222 223
s.AppName: asm.AppName
	${CP} asm.AppName $@ ${CPFLAGS}

224 225 226 227
BBETYPE = paint
bbe-paint: bbe-generic
	BBE_Export_Dir Resources

Neil Turton's avatar
Neil Turton committed
228 229 230 231
#---------------------------------------------------------------------------
# debugging version:
#
abs.!RunImageD: ${OBJSD} ${RLIB} ${CLIB}
232
	${LD} -d -o $@ ${OBJSD} ${RLIB} ${CLIB}
Neil Turton's avatar
Neil Turton committed
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253

debug.${APP}.!Boot: ${RDIR}.!Boot
	${CP} ${RDIR}.!Boot $@ ${CPFLAGS}

debug.${APP}.!Help: ${LDIR}.!Help
	${CP} ${LDIR}.!Help $@ ${CPFLAGS}

debug.${APP}.!Run: ${LDIR}.!Run
	${CP} ${LDIR}.!Run $@ ${CPFLAGS}

debug.${APP}.Messages: ${LDIR}.Messages
	${CP} ${LDIR}.Messages $@ ${CPFLAGS}

debug.${APP}.Sprites: ${LDIR}.Sprites
	${CP} ${LDIR}.Sprites $@ ${CPFLAGS}

debug.${APP}.Templates: ${LDIR}.Templates
	${CP} ${LDIR}.Templates $@ ${CPFLAGS}

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