##############################################################################
# CH7UTIL                                                                    #
#                                                                            #
# Build rules for R128 Chapter 7 sample code utility library                 #
#                                                                            #
# Copyright (c) 1999 ATI Technologies Inc.  All rights reserved.             #
##############################################################################

########################
# User settable macros #
########################

Compiler = wcc386
Librarian = wlib

!ifdef DEBUG
%R128SDKDEBUG = 1
!endif

!ifdef %R128SDKDEBUG
Compiler_Options = -fo=$*.obj -d2 -w3 -zq
Library_options = -b -l -n -q
!else
Compiler_Options = -fo=$*.obj -zld -zq
Library_options = -b -l -n -q -t
NDEBUG = 1
!endif

Library_name = ch7util
Library_file = $(Library_name).lib

Additional_libraries = ..\..\chap5\util\ch5util.lib

Object_directory = obj

Object_files =  obj\ov1utils.obj &
                obj\ov1calch.obj &
                obj\ov1calcs.obj &
                obj\ov1creat.obj &
                obj\ov1deflt.obj &
                obj\ov1fltsp.obj &
                obj\ov1init.obj  &
                obj\ov1query.obj &
                obj\ov1setup.obj &
                obj\ov1wrfld.obj &
                obj\bmutil.obj

##################
# Makefile rules #
##################

all: $(Library_file)

clean: .SYMBOLIC
    for %i in ($(Object_files)) do if exist %i del %i
    if exist $(Library_file) del $(Library_file)
    if exist $(Library_name).lst del $(Library_name).lst
    if exist $(Object_directory) rmdir $(Object_directory)

$(Library_file): $(Object_directory) $(Object_files) $(Additional_libraries)
    *$(Librarian) $(Library_Options) $(Library_file) &
          $(Object_files) $(Additional_libraries)

$(Object_directory):
    if not exist $(Object_directory)\nul mkdir $(Object_directory)

.c.obj:
    *$(Compiler) $(Compiler_Options) $<
