Makefile 3.29 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
# 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 Menu
#
# ***********************************
# ***    C h a n g e   L i s t    ***
# ***********************************
# Date       Name   Description
# ----       ----   -----------
# 06-Jan-94  AMcC   Created
Stewart Brodie's avatar
Stewart Brodie committed
23
# 04-Feb-98  SNB    Updated to allow RAM builds
Neil Turton's avatar
Neil Turton committed
24 25 26 27 28 29 30
#

#
# Component specific options:
#
COMPONENT  = Menu
ROM_MODULE = aof.${COMPONENT}
Stewart Brodie's avatar
Stewart Brodie committed
31
RAM_MODULE = rm.${COMPONENT}
Neil Turton's avatar
Neil Turton committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45

#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}

#
# Generic options:
#
MKDIR   = cdir
CC      = cc
CMHG    = cmhg
CP      = copy
LD      = link
Stewart Brodie's avatar
Stewart Brodie committed
46
TLD	= tlink
Neil Turton's avatar
Neil Turton committed
47 48 49 50 51 52 53
RM      = remove
WIPE    = -wipe

CPFLAGS = ~cfr~v
WFLAGS  = ~c~v

CFLAGS   = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
54 55
DFLAGS   = -D${SYSTEM}
ROMFLAGS = -DROM
Richard Buckley's avatar
Richard Buckley committed
56
INCLUDES = -I<Lib$Dir>.tboxlibint.,<Lib$Dir>.tboxlibs:,C:
Neil Turton's avatar
Neil Turton committed
57 58 59 60 61 62 63 64 65

#
# Libraries
#
ANSILIB   = CLib:o.ansilib
CLIB      = CLIB:o.stubs
RLIB      = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM    = RISC_OSLib:o.abssym
Richard Buckley's avatar
Richard Buckley committed
66
TBOXLIB   = <Lib$Dir>.tboxlibint.o.tboxlibm
Neil Turton's avatar
Neil Turton committed
67 68 69 70 71 72 73 74 75 76 77 78 79

OBJS =\
 o.Modhdr_NoD\
 o.Menu\
 o.auxiliary\
 o.create\
 o.delete\
 o.events\
 o.getstate\
 o.hide\
 o.miscop\
 o.show\
 o.task
Stewart Brodie's avatar
Stewart Brodie committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
	
RAM_OBJS =\
 o.Modhdr_NoD\
 o.MenuRAM\
 o.auxiliary\
 o.create\
 o.delete\
 o.events\
 o.getstate\
 o.hide\
 o.miscop\
 o.show\
 o.task
	
RESF=o.msgs
Neil Turton's avatar
Neil Turton committed
95 96 97 98

#
# Rule patterns
#
Stewart Brodie's avatar
Stewart Brodie committed
99
.c.o:;    ${CC} ${CFLAGS} ${ROMFLAGS} -o $@ $<
100
.cmhg.o:; ${CMHG} -p -o $@ $<
Neil Turton's avatar
Neil Turton committed
101 102 103 104 105

#
# Main rules:
#
#
Stewart Brodie's avatar
Stewart Brodie committed
106 107 108
all: ${RAM_MODULE}
	@echo ${COMPONENT}: Module built (RAM)

Neil Turton's avatar
Neil Turton committed
109 110 111 112 113 114 115
rom: ${ROM_MODULE}
	@echo ${COMPONENT}: Module built (ROM)

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

116
resources: LocalRes:Messages
Neil Turton's avatar
Neil Turton committed
117
	${MKDIR} ${RESDIR}
118 119
	TokenCheck LocalRes:Messages
	${CP} LocalRes:Messages ${RESDIR}.Messages ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
120 121 122 123 124
	@echo ${COMPONENT}: resource files copied to Messages module

clean:
	${WIPE} o.* ${WFLAGS}
	${WIPE} aof ${WFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
125
	${WIPE} rm ${WFLAGS}
Neil Turton's avatar
Neil Turton committed
126 127 128 129 130 131 132 133 134 135
	${WIPE} linked ${WFLAGS}
	@echo ${COMPONENT}: cleaned

${ROM_MODULE}: ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
	${MKDIR} aof
	${LD} -o $@ -aof ${OBJS} ${TBOXLIB} ${ROMCSTUBS}

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

140 141
${RESF}: LocalRes:Messages
	resgen messages_file ${RESF} LocalRes:Messages Resources.${COMPONENT}.Messages
Stewart Brodie's avatar
Stewart Brodie committed
142

143
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${RESF} ${CLIB}
Stewart Brodie's avatar
Stewart Brodie committed
144
	${mkdir} rm
145
	${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${RESF} ${CLIB}
Stewart Brodie's avatar
Stewart Brodie committed
146 147 148 149 150 151
	Access $@ RW/R

o.MenuRAM: Menu.c
	$(CC) ${CFLAGS} -o $@ Menu.c


Neil Turton's avatar
Neil Turton committed
152 153
#---------------------------------------------------------------------------
# Dynamic dependencies: