Makefile 4.47 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
Stewart Brodie's avatar
Stewart Brodie committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56


RESFSDIR   = Resources.URL.${COMPONENT}

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

#
# Generic options:
#
MKDIR	= cdir
CC	= cc
CMHG	= cmhg
CP	= copy
LD	= link
TLD	= tlink
RM	= remove
WIPE	= -wipe

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

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

#
# Libraries
#
ANSILIB	  = CLib:o.ansilib
CLIB	  = CLIB:o.stubs
67
DEBLIBS   = <syslog$dir>.c-veneer.o.syslog
Stewart Brodie's avatar
Stewart Brodie committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
RLIB	  = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM	  = RISC_OSLib:o.abssym
TCPIPLIBS = TCPIPLibs:o.inetlibzm TCPIPLIBS:o.socklibzm

OBJS =\
 o.config\
 o.connect\
 o.connpool\
 o.cookie\
 o.dates\
 o.dns\
 o.generic\
 o.header\
 o.hosttrack\
 o.module\
 o.protocol\
 o.readdata\
86
 o.security\
Stewart Brodie's avatar
Stewart Brodie committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
 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\
 o.dns\
 o.generic\
 o.header\
 o.hosttrack\
 o.moduleRAM\
 o.protocol\
 o.readdata\
109
 o.security\
Stewart Brodie's avatar
Stewart Brodie committed
110 111 112 113 114 115 116 117 118
 o.ses_ctrl\
 o.start\
 o.status\
 o.stop\
 o.URLclient\
 o.utils\
 o.writedata\
 o.HTTPHdr

119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142

DBG_OBJS =\
 od.config\
 od.connect\
 od.connpool\
 od.cookie\
 od.dates\
 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
143 144 145 146 147
MSGSF=o.msgs

#
# Rule patterns
#
148 149
.SUFFIXES: .o .od .c

Stewart Brodie's avatar
Stewart Brodie committed
150
.c.o:;	  ${CC} ${CFLAGS} ${ROMFLAGS} -o $@ $<
151
.c.od:;	  ${CC} ${CFLAGS} ${ROMFLAGS} ${DEBFLAGS} -o $@ $<
Stewart Brodie's avatar
Stewart Brodie committed
152 153 154 155 156 157 158 159 160 161 162 163
.cmhg.o:; ${CMHG} -o $@ $< -d $*.h

HTTPHdr.h: HTTPHdr.o
	  @|

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

164 165 166
ramtrace: ${DBG_MODULE}
	@echo ${COMPONENT}: Module built (TRACE)

Stewart Brodie's avatar
Stewart Brodie committed
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
rom: ${ROM_MODULE}
	@echo ${COMPONENT}: Module built (ROM)

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

resources: Resources.${LOCALE}.Messages
	${MKDIR} ${RESDIR}
	${MKDIR} ${RESDIR}.${COMPONENT}
	${CP} Resources.${LOCALE}.* ${RESDIR}.${COMPONENT}.* ${CPFLAGS}
	@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

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

# final link for ROM Image (using given base address)
rom_link:
	${MKDIR} linked
	${MKDIR} map
	${LD} -o linked.${COMPONENT} -bin -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
	      -map > map.${COMPONENT}
	truncate map.${COMPONENT} linked.${COMPONENT}
	${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
	@echo ${COMPONENT}: rom_link complete

${MSGSF}: @.Resources.${LOCALE}.Messages
	resgen messages_file ${MSGSF} Resources.${LOCALE}.Messages ${RESFSDIR}.Messages

206
${RAM_MODULE}: ${RAM_OBJS} ${MSGSF} ${TCPIPLIBS} ${CLIB}
Stewart Brodie's avatar
Stewart Brodie committed
207
	${mkdir} rm
208
	${LD} -o $@ -module ${RAM_OBJS} ${MSGSF} ${TCPIPLIBS} ${CLIB}
Stewart Brodie's avatar
Stewart Brodie committed
209 210
	Access $@ RW/R

211 212 213 214 215
${DBG_MODULE}: ${DBG_OBJS} ${MSGSF} ${TCPIPLIBS} ${CLIB} ${DEBLIBS}
	${mkdir} rm
	${LD} -o $@ -module ${DBG_OBJS} ${MSGSF} ${TCPIPLIBS} ${CLIB} ${DEBLIBS}
	Access $@ RW/R

Stewart Brodie's avatar
Stewart Brodie committed
216 217 218
o.moduleRAM: module.c
	$(CC) ${CFLAGS} -o $@ module.c

219 220 221
od.moduleRAM: module.c
	$(CC) ${CFLAGS} ${DEBFLAGS} -o $@ module.c

Stewart Brodie's avatar
Stewart Brodie committed
222 223 224

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