##############################################################################
# CH3UTIL                                                                    #
#                                                                            #
# Build rules for R128 Chapter 3 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 = ch3util
Library_file = $(Library_name).lib

Object_directory = obj

Object_files =  obj\glob.obj &
                obj\dpmimem.obj &
                obj\setmode.obj &
                obj\ch3lib.obj &
                obj\initeng.obj &
                obj\pcicfg.obj &
                obj\colour.obj &
                obj\palette.obj &
                obj\startup.obj &
                obj\nbmode.obj &
                obj\r128pll.obj &
                obj\modeparm.obj &
                obj\regrdwrt.obj &
                obj\dpms.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) $<
