Makefile 5.76 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
# 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 Kernel
#

18
COMPONENT       = Kernel
19 20 21 22 23

ifeq (${MAKECMDGOALS},install)
EXP_HDR         = ${INSTDIR}.Hdr.Interface
C_EXP_HDR       = ${INSTDIR}.C.Global.h
else
24
C_EXP_HDR       = <cexport$dir>.Global.h
25 26
endif

27 28
TOKHELPSRC      = ${TOKENSOURCE}
HELPSRC         = HelpStrs
29
ROM_OBJECTS     = GetAll.o
30
KERNEL_MODULE   = bin${SEP}${COMPONENT}
31
ASFLAGS        += -PD "FreezeDevRel SETL {${FREEZE_DEV_REL}}"
32 33
CUSTOMROM       = custom
CUSTOMEXP       = custom
34
CUSTOMSA        = custom
35 36
EXPORTS         = ${EXP_HDR}.AMBControl \
                  ${EXP_HDR}.DBellDevice \
Jeffrey Lee's avatar
Jeffrey Lee committed
37
                  ${EXP_HDR}.EnvNumbers \
38 39
                  ${EXP_HDR}.HALDevice \
                  ${EXP_HDR}.HALEntries \
40
                  ${EXP_HDR}.ModHand \
41
                  ${EXP_HDR}.OSEntries \
42
                  ${EXP_HDR}.OSMem \
43
                  ${EXP_HDR}.OSMisc \
44 45
                  ${EXP_HDR}.OSRSI6 \
                  ${EXP_HDR}.PL310 \
46 47 48 49 50
                  ${EXP_HDR}.PublicWS \
                  ${EXP_HDR}.RISCOS \
                  ${EXP_HDR}.Variables \
                  ${EXP_HDR}.VduExt \
                  ${EXP_HDR}.VIDCList \
51
                  ${EXP_HDR}.VideoDevice \
52
                  ${C_EXP_HDR}.HALDevice \
53 54
                  ${C_EXP_HDR}.HALEntries \
                  ${C_EXP_HDR}.ModHand \
55
                  ${C_EXP_HDR}.OSEntries \
56
                  ${C_EXP_HDR}.OSMem \
57
                  ${C_EXP_HDR}.OSMisc \
58
                  ${C_EXP_HDR}.OSRSI6 \
59 60
                  ${C_EXP_HDR}.RISCOS \
                  ${C_EXP_HDR}.Variables \
61 62 63 64 65
                  ${C_EXP_HDR}.VduExt \
                  ${C_EXP_HDR}.VIDCList

include StdTools
include AAsmModule
66
include StdRules
Neil Turton's avatar
Neil Turton committed
67

68 69 70 71 72
# Override this to "TRUE" in the components file if
# you want an odd-numbered (development) build to be
# a 'freezable' build - e.g. with no ROM debug output
FREEZE_DEV_REL ?= FALSE

Neil Turton's avatar
Neil Turton committed
73
#
74
# Custom ROM:
Neil Turton's avatar
Neil Turton committed
75
#
76 77
rom: ${KERNEL_MODULE}
	@${ECHO} ${COMPONENT}: rom module built
Neil Turton's avatar
Neil Turton committed
78

79 80 81 82 83
install_rom: ${KERNEL_MODULE}
	${CP} ${KERNEL_MODULE} ${INSTDIR}${SEP}${TARGET} ${CPFLAGS}
	${CP} ${KERNEL_MODULE}_gpa ${INSTDIR}${SEP}${TARGET}_gpa ${CPFLAGS}
	@${ECHO} ${COMPONENT}: rom module installed

84 85 86 87 88 89 90
inst_dirs:
	${MKDIR} ${EXP_HDR}
	${MKDIR} ${C_EXP_HDR}

install: ${EXPORTS} inst_dirs
	@${ECHO} ${COMPONENT}: header files installed

Jeffrey Lee's avatar
Jeffrey Lee committed
91
${KERNEL_MODULE}: ${ROM_OBJECTS} ${DIRS} ${LIBS} kstrip
92
	${MKDIR} bin
93
	SetEval KernelBase "4" + STR ( 227858432 + ( HALSize LEFT ( LEN HALSize - 1 ) ) * 1024 )
Jeffrey Lee's avatar
Jeffrey Lee committed
94 95
	Do ${LD} -aif -base <KernelBase> -RW-base 0xff000000 -bin -d -o ${KERNEL_MODULE}_aif ${ROM_OBJECTS} ${LIBS}
	Do kstrip ${KERNEL_MODULE}_aif ${KERNEL_MODULE}
96
	${TOGPA} -s ${KERNEL_MODULE}_aif ${KERNEL_MODULE}_gpa
Neil Turton's avatar
Neil Turton committed
97

98 99
GetAll.o: ${TOKHELPSRC}

Neil Turton's avatar
Neil Turton committed
100
#
101
# Custom exports:
Neil Turton's avatar
Neil Turton committed
102 103
#
export: ${EXPORTS}
104
	@${ECHO} ${COMPONENT}: export complete
105

106 107 108
${EXP_HDR}.AMBControl: hdr.AMBControl
	${CP} hdr.AMBControl $@ ${CPFLAGS}

Neil Turton's avatar
Neil Turton committed
109 110
${EXP_HDR}.EnvNumbers: hdr.EnvNumbers
	${CP} hdr.EnvNumbers $@ ${CPFLAGS}
111

Jeffrey Lee's avatar
Jeffrey Lee committed
112 113 114
${EXP_HDR}.DBellDevice: hdr.DBellDevice
	${CP} hdr.DBellDevice $@ ${CPFLAGS}

115 116
${EXP_HDR}.HALDevice: hdr.HALDevice
	${CP} hdr.HALDevice $@ ${CPFLAGS}
117

118 119
${EXP_HDR}.HALEntries: hdr.HALEntries
	${CP} hdr.HALEntries $@ ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
120 121 122

${EXP_HDR}.ModHand: hdr.ModHand
	${CP} hdr.ModHand $@ ${CPFLAGS}
123

124 125
${EXP_HDR}.OSEntries: hdr.OSEntries
	${CP} hdr.OSEntries $@ ${CPFLAGS}
126

127 128 129
${EXP_HDR}.OSMem: hdr.OSMem
	${CP} hdr.OSMem $@ ${CPFLAGS}

130 131
${EXP_HDR}.OSMisc: hdr.OSMisc
	${CP} hdr.OSMisc $@ ${CPFLAGS}
132

133 134 135 136 137
${EXP_HDR}.OSRSI6: hdr.OSRSI6
	${CP} hdr.OSRSI6 $@ ${CPFLAGS}

${EXP_HDR}.PL310: hdr.PL310
	${CP} hdr.PL310 $@ ${CPFLAGS}
Neil Turton's avatar
Neil Turton committed
138 139 140 141 142 143 144

${EXP_HDR}.PublicWS: hdr.PublicWS
	${CP} hdr.PublicWS $@ ${CPFLAGS}

${EXP_HDR}.RISCOS: hdr.RISCOS
	${CP} hdr.RISCOS $@ ${CPFLAGS}

145 146 147
${EXP_HDR}.Variables: hdr.Variables
	${CP} hdr.Variables $@ ${CPFLAGS}

Neil Turton's avatar
Neil Turton committed
148 149 150
${EXP_HDR}.VduExt: hdr.VduExt
	${CP} hdr.VduExt $@ ${CPFLAGS}

151 152
${EXP_HDR}.VIDCList: hdr.VIDCList
	${CP} hdr.VIDCList $@ ${CPFLAGS}
153

Jeffrey Lee's avatar
Jeffrey Lee committed
154 155
${EXP_HDR}.VideoDevice: hdr.VideoDevice
	${CP} hdr.VideoDevice $@ ${CPFLAGS}
156 157 158 159 160 161 162

${C_EXP_HDR}.HALDevice: Global.h.HALDevice h.HALDevice
	${FAPPEND} $@ h.HALDevice Global.h.HALDevice

${C_EXP_HDR}.HALEntries: hdr.HALEntries
	${MKDIR} ${C_EXP_HDR}
	${HDR2H} hdr.HALEntries $@
163

164 165
${C_EXP_HDR}.ModHand: hdr.ModHand
	${MKDIR} ${C_EXP_HDR}
166
	${HDR2H} hdr.ModHand $@
167

168 169 170
${C_EXP_HDR}.OSEntries: Global.h.OSEntries h.OSEntries
	${FAPPEND} $@ h.OSEntries Global.h.OSEntries

171 172 173 174
${C_EXP_HDR}.OSMem: hdr.OSMem
	${MKDIR} ${C_EXP_HDR}
	${HDR2H} hdr.OSMem $@

175 176 177 178
${C_EXP_HDR}.OSMisc: hdr.OSMisc
	${MKDIR} ${C_EXP_HDR}
	${HDR2H} hdr.OSMisc $@

179
${C_EXP_HDR}.OSRSI6: hdr.OSRSI6
180
	${MKDIR} ${C_EXP_HDR}
181
	${HDR2H} hdr.OSRSI6 $@
Neil Turton's avatar
Neil Turton committed
182

183
${C_EXP_HDR}.RISCOS: hdr.RISCOS
Kevin Bracey's avatar
Kevin Bracey committed
184
	${MKDIR} ${C_EXP_HDR}
185
	${HDR2H} hdr.RISCOS $@
186

187 188
${C_EXP_HDR}.Variables: hdr.Variables
	${MKDIR} ${C_EXP_HDR}
189
	${HDR2H} hdr.Variables $@
190

191 192
${C_EXP_HDR}.VduExt: hdr.VduExt
	${MKDIR} ${C_EXP_HDR}
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
	${HDR2H} hdr.VduExt $@

${C_EXP_HDR}.VIDCList: Global.h.VIDCList h.VIDCList
	${FAPPEND} $@ h.VIDCList Global.h.VIDCList

Global.h.HALDevice: hdr.HALDevice
	${MKDIR} Global.h
	${HDR2H} hdr.HALDevice $@

Global.h.OSEntries: hdr.OSEntries
	${MKDIR} Global.h
	${HDR2H} hdr.OSEntries $@

Global.h.VIDCList: hdr.VIDCList
	${MKDIR} Global.h
	${HDR2H} hdr.VIDCList $@

clean::
	${XWIPE} Global ${WFLAGS}
	${XWIPE} bin    ${WFLAGS}
Jeffrey Lee's avatar
Jeffrey Lee committed
213 214 215 216
	${RM} kstrip

kstrip: kstrip.c
	${MAKE} -f kstrip/mk COMPONENT=kstrip THROWBACK=${THROWBACK}
Ben Avison's avatar
Ben Avison committed
217

Neil Turton's avatar
Neil Turton committed
218
# Dynamic dependencies: