Makefile 5.08 KB
Newer Older
Stewart Brodie's avatar
Stewart Brodie 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
# Copyright 1998 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 AcornHTTP
#
# ***********************************
# ***	 C h a n g e   L i s t	  ***
# ***********************************
# Date	     Name   Description
# ----	     ----   -----------
# 10-Feb-98  SNB    Created
#

#
# Component specific options:
#
COMPONENT  = HTTP
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
31
DBG_MODULE = rm.${COMPONENT}-tr
32 33
INSTDIR   ?= <Install$Dir>
TARGET    ?= ${COMPONENT}
Stewart Brodie's avatar
Stewart Brodie committed
34 35 36 37 38 39 40 41 42 43 44

RESFSDIR   = Resources.URL.${COMPONENT}

#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.URL

#
# Generic options:
#
45
MKDIR	= do mkdir -p
Stewart Brodie's avatar
Stewart Brodie committed
46 47 48 49 50 51 52 53 54 55
CC	= cc
CMHG	= cmhg
CP	= copy
LD	= link
TLD	= tlink
RM	= remove
WIPE	= -wipe

CPFLAGS = ~cfr~v
WFLAGS  = ~c~v
56
MCFLAGS = -C -E
Stewart Brodie's avatar
Stewart Brodie committed
57 58

CFLAGS	 = -c -depend !Depend ${INCLUDES} -zM -Wp -ffah -zps1 ${DFLAGS}
59
DFLAGS	 = -D${SYSTEM} -DCOMPAT_INET4 -DCOOKIE -DCOMPRESSION -UTML ${OPTIONS}
Stewart Brodie's avatar
Stewart Brodie committed
60
ROMFLAGS = -DROM
61
INCLUDES = -ITCPIPLibs:,C:,C:zlib
62
DEBFLAGS = -DTRACE -DUSE_SYSLOG
Stewart Brodie's avatar
Stewart Brodie committed
63 64 65 66 67 68

#
# Libraries
#
ANSILIB	  = CLib:o.ansilib
CLIB	  = CLIB:o.stubs
69
ZLIB      = C:zlib.o.zlibzm
David Cotton's avatar
David Cotton committed
70
#DEBLIBS   = <syslog$dir>.c-veneer.o.syslog
Stewart Brodie's avatar
Stewart Brodie committed
71 72
RLIB	  = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
David Cotton's avatar
David Cotton committed
73
ABSSYM	  = RISCOSLIB:o.abssym
Stewart Brodie's avatar
Stewart Brodie committed
74 75 76 77 78 79 80 81
TCPIPLIBS = TCPIPLibs:o.inetlibzm TCPIPLIBS:o.socklibzm

OBJS =\
 o.config\
 o.connect\
 o.connpool\
 o.cookie\
 o.dates\
82
 o.decompress\
Stewart Brodie's avatar
Stewart Brodie committed
83 84 85 86 87 88 89
 o.dns\
 o.generic\
 o.header\
 o.hosttrack\
 o.module\
 o.protocol\
 o.readdata\
90
 o.security\
Stewart Brodie's avatar
Stewart Brodie committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
 o.ses_ctrl\
 o.start\
 o.status\
 o.stop\
 o.URLclient\
 o.utils\
 o.writedata\
 o.HTTPHdr

RAM_OBJS =\
 o.config\
 o.connect\
 o.connpool\
 o.cookie\
 o.dates\
106
 o.decompress\
Stewart Brodie's avatar
Stewart Brodie committed
107 108 109 110 111 112 113
 o.dns\
 o.generic\
 o.header\
 o.hosttrack\
 o.moduleRAM\
 o.protocol\
 o.readdata\
114
 o.security\
Stewart Brodie's avatar
Stewart Brodie committed
115 116 117 118 119 120 121 122 123
 o.ses_ctrl\
 o.start\
 o.status\
 o.stop\
 o.URLclient\
 o.utils\
 o.writedata\
 o.HTTPHdr

124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
MCCABE_OBJS =\
 i.config\
 i.connect\
 i.connpool\
 i.cookie\
 i.dates\
 i.decompress\
 i.dns\
 i.generic\
 i.header\
 i.hosttrack\
 i.module\
 i.protocol\
 i.readdata\
 i.security\
 i.ses_ctrl\
 i.start\
 i.status\
 i.stop\
 i.URLclient\
 i.utils\
 i.writedata

147 148 149 150 151 152 153

DBG_OBJS =\
 od.config\
 od.connect\
 od.connpool\
 od.cookie\
 od.dates\
154
 od.decompress\
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
 od.dns\
 od.generic\
 od.header\
 od.hosttrack\
 od.moduleRAM\
 od.protocol\
 od.readdata\
 od.security\
 od.ses_ctrl\
 od.start\
 od.status\
 od.stop\
 od.URLclient\
 od.utils\
 od.writedata\
 o.HTTPHdr

Stewart Brodie's avatar
Stewart Brodie committed
172 173 174 175 176
MSGSF=o.msgs

#
# Rule patterns
#
177
.SUFFIXES: .o .od .i .c
178

Stewart Brodie's avatar
Stewart Brodie committed
179
.c.o:;	  ${CC} ${CFLAGS} ${ROMFLAGS} -o $@ $<
180
.c.od:;	  ${CC} ${CFLAGS} ${ROMFLAGS} ${DEBFLAGS} -o $@ $<
181 182
.c.i:;    ${CC} ${MCFLAGS} ${CFLAGS} ${ROMFLAGS} >$@ $<
.cmhg.o:; ${CMHG} -o $@ $< -p -d $*.h
Stewart Brodie's avatar
Stewart Brodie committed
183 184 185 186 187 188 189 190 191 192 193

HTTPHdr.h: HTTPHdr.o
	  @|

#
# Main rules:
#
#
all: ${RAM_MODULE}
	@echo ${COMPONENT}: Module built (RAM)

194 195 196
ramtrace: ${DBG_MODULE}
	@echo ${COMPONENT}: Module built (TRACE)

Stewart Brodie's avatar
Stewart Brodie committed
197 198 199
rom: ${ROM_MODULE}
	@echo ${COMPONENT}: Module built (ROM)

200 201 202 203 204
install: ${RAM_MODULE}
	${MKDIR} ${INSTDIR}
	${CP} ${RAM_MODULE} ${INSTDIR}.${TARGET} ${CPFLAGS}
	@echo ${COMPONENT}: Module install (disc)

205 206 207
mccabe: ${MCCABE_OBJS}
	@echo ${COMPONENT}: McCabe sources build (Disc)

Stewart Brodie's avatar
Stewart Brodie committed
208 209 210 211
install_rom: ${ROM_MODULE}
	${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
	@echo ${COMPONENT}: Module installed (ROM)

212
resources: LocalRes:Messages
Stewart Brodie's avatar
Stewart Brodie committed
213 214
	${MKDIR} ${RESDIR}
	${MKDIR} ${RESDIR}.${COMPONENT}
215
	${CP} LocalRes:* ${RESDIR}.${COMPONENT}.* ${CPFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
216 217 218 219 220 221 222 223 224 225 226
	@echo ${COMPONENT}: resource files copied to Messages module

clean:
	${WIPE} o.* ${WFLAGS}
	${WIPE} aof ${WFLAGS}
	${WIPE} rm ${WFLAGS}
	${WIPE} h.${COMPONENT}Hdr ${WFLAGS}
	${WIPE} linked ${WFLAGS}
	${WIPE} map ${WFLAGS}
	@echo ${COMPONENT}: cleaned

227
${ROM_MODULE}: ${OBJS} ${ROMCSTUBS} ${ZLIB}
Stewart Brodie's avatar
Stewart Brodie committed
228
	${MKDIR} aof
229
	${LD} -o $@ -aof ${OBJS} ${TCPIPLIBS} ${ZLIB} ${ROMCSTUBS}
Stewart Brodie's avatar
Stewart Brodie committed
230 231 232 233

# final link for ROM Image (using given base address)
rom_link:
	${MKDIR} linked
234
	${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM}
David Cotton's avatar
David Cotton committed
235
	${CP} linked.${COMPONENT} ${LINKDIR}.AcornHTTP ${CPFLAGS}
Stewart Brodie's avatar
Stewart Brodie committed
236 237
	@echo ${COMPONENT}: rom_link complete

238 239
${MSGSF}: LocalRes:Messages
	resgen messages_file ${MSGSF} LocalRes:Messages ${RESFSDIR}.Messages
Stewart Brodie's avatar
Stewart Brodie committed
240

241
${RAM_MODULE}: ${RAM_OBJS} ${MSGSF} ${TCPIPLIBS} ${ZLIB} ${CLIB}
Stewart Brodie's avatar
Stewart Brodie committed
242
	${mkdir} rm
243
	${LD} -o $@ -module ${RAM_OBJS} ${MSGSF} ${TCPIPLIBS} ${ZLIB} ${CLIB}
Stewart Brodie's avatar
Stewart Brodie committed
244 245
	Access $@ RW/R

246
${DBG_MODULE}: ${DBG_OBJS} ${MSGSF} ${TCPIPLIBS} ${ZLIB} ${CLIB} ${DEBLIBS}
247
	${mkdir} rm
248
	${LD} -o $@ -module ${DBG_OBJS} ${MSGSF} ${TCPIPLIBS} ${ZLIB} ${CLIB} ${DEBLIBS}
249 250
	Access $@ RW/R

Stewart Brodie's avatar
Stewart Brodie committed
251 252 253
o.moduleRAM: module.c
	$(CC) ${CFLAGS} -o $@ module.c

254 255 256
od.moduleRAM: module.c
	$(CC) ${CFLAGS} ${DEBFLAGS} -o $@ module.c

Stewart Brodie's avatar
Stewart Brodie committed
257 258 259

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