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
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# commpost.nmk: SECOND COMMON FRAGMENT FOR PLATFORMS USING NMAKE -*- makefile -*-
#
# $Id: //info.ravenbrook.com/project/mps/master/code/commpost.nmk#68 $
# Copyright (c) 2001-2020 Ravenbrook Limited.  See end of file for license.
#
# DESCRIPTION
#
# Second common makefile fragment for w3*mv.nmk.  See commpre.nmk


# == Pseudo-targets ==

all: $(ALL_TARGETS)


# Convenience targets

$(ALL_TARGETS) $(OPTIONAL_TARGETS):
!IFDEF VARIETY
	$(MAKE) /nologo /f $(PFM).nmk TARGET=$@ variety
!ELSE
	$(MAKE) /nologo /f $(PFM).nmk TARGET=$@ target
!ENDIF

# "clean" removes the directory containing the build results.
# Depends on there being no file called "clean".
# Note that we suspend error processing on the if line because rmdir
# sometimes exits with an error and the message "The directory is not
# empty" even if the /s option is given. See job003854.

clean:
	$(ECHO) $(PFM): $@
	-if exist $(PFM) rmdir /q /s $(PFM)

# target target
# %%VARIETY: When adding a new variety, optionally, add a recursive make
# call for the new variety, if it should be built by default.  It probably
# shouldn't without a product design decision and an update of the readme
# and build manual!
# Depends on there being no file called "target".

!IFDEF TARGET
!IFNDEF VARIETY
target:
	$(MAKE) /nologo /f $(PFM).nmk VARIETY=cool variety
	$(MAKE) /nologo /f $(PFM).nmk VARIETY=hot variety
!ENDIF
!ENDIF

# variety
# Depends on there being no file called "variety".

!IFDEF VARIETY
!IFDEF TARGET
variety: $(PFM)\$(VARIETY)\$(TARGET)
!ENDIF
!ENDIF

# testrun testci testall testansi testpollnone
# Runs automated test cases. See design.mps.tests.target.

testrun testci testall testansi testpollnone: $(TEST_TARGETS)
!IFDEF VARIETY
	..\tool\testrun.bat $(PFM) $(VARIETY) $@
!ELSE
	$(MAKE) /nologo /f $(PFM).nmk VARIETY=cool $@
	$(MAKE) /nologo /f $(PFM).nmk VARIETY=hot $@
!ENDIF


# FLAGS AMALGAMATION
#
# %%VARIETY: When adding a new variety, add the following macros that
# expand to sets of flags that the variety should use:
#
# CFLAGS --  when compiling C;
# CFLAGSSQL -- when compiling mpseventsql;
# LINKFLAGS -- when building executables;
# LIBFLAGS -- when building libraries.

!IF "$(VARIETY)" == "hot"
CFLAGS=$(CFLAGSCOMMONPRE) $(CFHOT) $(CFLAGSCOMMONPOST)
CFLAGSSQL=$(CFLAGSSQLPRE) $(CFHOT) $(CFLAGSSQLPOST)
LINKFLAGS=$(LINKFLAGSCOMMON) $(LFHOT)
LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSHOT)

!ELSEIF "$(VARIETY)" == "cool"
CFLAGS=$(CFLAGSCOMMONPRE) $(CFCOOL) $(CFLAGSCOMMONPOST)
CFLAGSSQL=$(CFLAGSSQLPRE) $(CFCOOL) $(CFLAGSSQLPOST)
LINKFLAGS=$(LINKFLAGSCOMMON) $(LFCOOL)
LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSCOOL)

!ELSEIF "$(VARIETY)" == "rash"
CFLAGS=$(CFLAGSCOMMONPRE) $(CFRASH) $(CFLAGSCOMMONPOST)
CFLAGSSQL=$(CFLAGSSQLPRE) $(CFRASH) $(CFLAGSSQLPOST)
LINKFLAGS=$(LINKFLAGSCOMMON) $(LFRASH)
LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSRASH)

!ENDIF


# SOURCE TO OBJECT FILE MAPPINGS
#
# %%PART: When adding a new part, add new macros which expand to the object
# files included in the part
#
# Note: nmake doesn't expand variables within a string replacement
# operation. We work around this by writing out a temporary makefile
# and including it.

TEMPMAKE=$(TEMP)\mps.nmk
!IF [echo MPMOBJ0 = $$(MPM:[=$(PFM)\$(VARIETY)\) > $(TEMPMAKE)] == 0 \
 && [echo FMTDYOBJ0 = $$(FMTDY:[=$(PFM)\$(VARIETY)\) >> $(TEMPMAKE)] == 0 \
 && [echo FMTTESTOBJ0 = $$(FMTTEST:[=$(PFM)\$(VARIETY)\) >> $(TEMPMAKE)] == 0 \
 && [echo FMTSCHEMEOBJ0 = $$(FMTSCHEME:[=$(PFM)\$(VARIETY)\) >> $(TEMPMAKE)] == 0 \
 && [echo POOLNOBJ0 = $$(POOLN:[=$(PFM)\$(VARIETY)\) >> $(TEMPMAKE)] == 0 \
 && [echo TESTLIBOBJ0 = $$(TESTLIB:[=$(PFM)\$(VARIETY)\) >> $(TEMPMAKE)] == 0 \
 && [echo TESTTHROBJ0 = $$(TESTTHR:[=$(PFM)\$(VARIETY)\) >> $(TEMPMAKE)] == 0
!INCLUDE $(TEMPMAKE)
!IF [del $(TEMPMAKE)] != 0
!ERROR Failed to delete $(TEMPMAKE)
!ENDIF
!ENDIF

MPMOBJ = $(MPMOBJ0:]=.obj)
FMTDYOBJ = $(FMTDYOBJ0:]=.obj)
FMTTESTOBJ = $(FMTTESTOBJ0:]=.obj)
FMTSCHEMEOBJ = $(FMTSCHEMEOBJ0:]=.obj)
POOLNOBJ = $(POOLNOBJ0:]=.obj)
TESTLIBOBJ = $(TESTLIBOBJ0:]=.obj)
TESTTHROBJ = $(TESTTHROBJ0:]=.obj)


# THE MPS LIBRARY
#
# The MPS library is built in two ways:
#
#   1. In the usual way, from a pile of object files compiled from their
#      corresponding sources.
#
#   2. From mps.c, which effectively concatenates all the sources, allowing
#      important global optimisation and inlining to occur.
#
# We mostly use the method (2), because it is fast to compile and execute.
# But we use method (1) for some varieties to ensure correctness of
# code (linkage errors are masked by (2)) and to maintain a correct list
# of source files in case method (1) won't work on some future constrained
# platform.
#
# %%VARIETY: When adding a new variety, add a rule for how to build the
# MPS library for the variety

$(PFM)\rash\mps.lib: $(PFM)\rash\mps.obj
	$(ECHO) $@
	$(LIBMAN) $(LIBFLAGS) /OUT:$@ $**

$(PFM)\hot\mps.lib: $(PFM)\hot\mps.obj
	$(ECHO) $@
	$(LIBMAN) $(LIBFLAGS) /OUT:$@ $**

$(PFM)\cool\mps.lib: $(MPMOBJ)
	$(ECHO) $@
	$(LIBMAN) $(LIBFLAGS) /OUT:$@ $**


# OTHER GENUINE TARGETS
#
# Each line defines an executable or library target to be built and the object
# files it is build from.  For an executable these lines add dependencies to
# the generic rules below, and should not include commands to execute.
# For a library this is not possible and the target should include commands
# to build it.
# %%TARGET: When adding a new target, add your new target here

!IFDEF VARIETY

$(PFM)\$(VARIETY)\abqtest.exe: $(PFM)\$(VARIETY)\abqtest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\airtest.exe: $(PFM)\$(VARIETY)\airtest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTSCHEMEOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\amcss.exe: $(PFM)\$(VARIETY)\amcss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\amcsshe.exe: $(PFM)\$(VARIETY)\amcsshe.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\amcssth.exe: $(PFM)\$(VARIETY)\amcssth.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\amsss.exe: $(PFM)\$(VARIETY)\amsss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\amssshe.exe: $(PFM)\$(VARIETY)\amssshe.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\apss.exe: $(PFM)\$(VARIETY)\apss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\arenacv.exe:  $(PFM)\$(VARIETY)\arenacv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\awlut.exe: $(PFM)\$(VARIETY)\awlut.obj \
        $(FMTTESTOBJ) \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\awluthe.exe:  $(PFM)\$(VARIETY)\awluthe.obj \
	$(FMTTESTOBJ) \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\awlutth.exe:  $(PFM)\$(VARIETY)\awlutth.obj \
	$(FMTTESTOBJ) \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\btcv.exe: $(PFM)\$(VARIETY)\btcv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\bttest.exe: $(PFM)\$(VARIETY)\bttest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\cvmicv.exe: $(PFM)\$(VARIETY)\cvmicv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\djbench.exe: $(PFM)\$(VARIETY)\djbench.obj \
	$(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\finalcv.exe: $(PFM)\$(VARIETY)\finalcv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\finaltest.exe: $(PFM)\$(VARIETY)\finaltest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\fotest.exe: $(PFM)\$(VARIETY)\fotest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\gcbench.exe: $(PFM)\$(VARIETY)\gcbench.obj \
	$(FMTTESTOBJ) $(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\landtest.exe: $(PFM)\$(VARIETY)\landtest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\locbwcss.exe: $(PFM)\$(VARIETY)\locbwcss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\lockcov.exe: $(PFM)\$(VARIETY)\lockcov.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\lockut.exe: $(PFM)\$(VARIETY)\lockut.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ) $(TESTTHROBJ)

$(PFM)\$(VARIETY)\locusss.exe: $(PFM)\$(VARIETY)\locusss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\locv.exe:  $(PFM)\$(VARIETY)\locv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\messtest.exe: $(PFM)\$(VARIETY)\messtest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\mpmss.exe: $(PFM)\$(VARIETY)\mpmss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\mpsicv.exe: $(PFM)\$(VARIETY)\mpsicv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\mv2test.exe: $(PFM)\$(VARIETY)\mv2test.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\nailboardtest.exe: $(PFM)\$(VARIETY)\nailboardtest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\poolncv.exe: $(PFM)\$(VARIETY)\poolncv.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ) $(POOLNOBJ)

$(PFM)\$(VARIETY)\qs.exe: $(PFM)\$(VARIETY)\qs.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\sacss.exe: $(PFM)\$(VARIETY)\sacss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\segsmss.exe: $(PFM)\$(VARIETY)\segsmss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\sncss.exe: $(PFM)\$(VARIETY)\sncss.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\steptest.exe: $(PFM)\$(VARIETY)\steptest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\tagtest.exe: $(PFM)\$(VARIETY)\tagtest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\teletest.exe: $(PFM)\$(VARIETY)\teletest.obj \
	$(PFM)\$(VARIETY)\mps.lib $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\walkt0.exe: $(PFM)\$(VARIETY)\walkt0.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\zcoll.exe: $(PFM)\$(VARIETY)\zcoll.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\zmess.exe: $(PFM)\$(VARIETY)\zmess.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\ztfm.exe: $(PFM)\$(VARIETY)\ztfm.obj \
	$(PFM)\$(VARIETY)\mps.lib $(FMTTESTOBJ) $(TESTLIBOBJ)

$(PFM)\$(VARIETY)\mpseventcnv.exe: $(PFM)\$(VARIETY)\eventcnv.obj \
	$(PFM)\$(VARIETY)\mps.lib

$(PFM)\$(VARIETY)\mpseventpy.exe: $(PFM)\$(VARIETY)\eventpy.obj \
	$(PFM)\$(VARIETY)\mps.lib

$(PFM)\$(VARIETY)\mpseventtxt.exe: $(PFM)\$(VARIETY)\eventtxt.obj \
	$(PFM)\$(VARIETY)\mps.lib

$(PFM)\$(VARIETY)\mpseventsql.exe: $(PFM)\$(VARIETY)\eventsql.obj \
	$(PFM)\$(VARIETY)\sqlite3.obj $(PFM)\$(VARIETY)\mps.lib

$(PFM)\$(VARIETY)\replay.exe: $(PFM)\$(VARIETY)\replay.obj \
  $(PFM)\$(VARIETY)\eventrep.obj \
  $(PFM)\$(VARIETY)\table.obj \
  $(PFM)\$(VARIETY)\mps.lib

# Have to rename the object file, because the names must match, or
# the template rule for .exe.obj won't be used.
$(PFM)\$(VARIETY)\replaysw.obj: $(PFM)\$(VARIETY)\replay.obj
	$(ECHO) $@
	copy $** $@ >nul:

$(PFM)\$(VARIETY)\mpseventcnv.obj: $(PFM)\$(VARIETY)\eventcnv.obj
	copy $** $@ >nul:

$(PFM)\$(VARIETY)\mpseventpy.obj: $(PFM)\$(VARIETY)\eventpy.obj
	copy $** $@ >nul:

$(PFM)\$(VARIETY)\mpseventtxt.obj: $(PFM)\$(VARIETY)\eventtxt.obj
	copy $** $@ >nul:

$(PFM)\$(VARIETY)\mpseventsql.obj: $(PFM)\$(VARIETY)\eventsql.obj
	copy $** $@ >nul:

!ENDIF


# GENERIC RULES

# Object files

{}.c{$(PFM)\$(VARIETY)}.obj:
	$(ECHO) $@
	@if not exist $(PFM) mkdir $(PFM)
	@if not exist $(PFM)\$(VARIETY) mkdir $(PFM)\$(VARIETY)
	$(CC) /c $(CFLAGS) /Fo$@ $<

$(PFM)\$(VARIETY)\sqlite3.obj:
	$(ECHO) $@
	@if not exist $(PFM) mkdir $(PFM)
	@if not exist $(PFM)\$(VARIETY) mkdir $(PFM)\$(VARIETY)
        $(CC) /c $(CFLAGSSQL) /Fo$@ sqlite3.c

{}.asm{$(PFM)\$(VARIETY)}.obj:
	$(ECHO) $@
	@if not exist $(PFM) mkdir $(PFM)
	@if not exist $(PFM)\$(VARIETY) mkdir $(PFM)\$(VARIETY)
	$(MASM) /nologo /c /Fo$@ $<

# Coverage files
#{$(PFM)\$(VARIETY)}.exe{$(PFM)\$(VARIETY)}.cov:
#	$(ECHO) $@
#	cd $(PFM)\$(VARIETY)
#	prep /nologo /lv  $(<F)
#	profile /nologo $(<B)
#	prep /nologo /m $(<B)
#	plist /nologo /D ..\.. $(<B) > $(@F)


# Executables

{$(PFM)\$(VARIETY)}.obj{$(PFM)\$(VARIETY)}.exe:
	$(ECHO) $@
	$(LINKER) $(LINKFLAGS) /OUT:$@ $(**)


# C. COPYRIGHT AND LICENSE
#
# Copyright (C) 2001-2020 Ravenbrook Limited <https://www.ravenbrook.com/>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.