##############################################################################
# POLYUTIL                                                                   #
#                                                                            #
# Build rules for mach64 Chapter 7 sample code utility library               #
#                                                                            #
# Copyright (c) 1994-1998 ATI Technologies Inc.  All rights reserved.        #
##############################################################################

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

Compiler = wcc386
Librarian = wlib

!ifdef DEBUG
%M64SDKDEBUG = 1
!endif

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

Library_name = polyutil
Library_file = $(Library_name).lib

Object_directory = obj

Object_files = obj\colour.obj &
               obj\draw.obj &
               obj\glob.obj &
               obj\hwcursor.obj &
               obj\init.obj &
               obj\ioreg.obj &
               obj\m64bios.obj &
               obj\memreg.obj &
               obj\palette.obj &
               obj\wait.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)
    *$(Librarian) $(Library_Options) $(Library_file) &
          $(Object_files)

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

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