##############################################################################
# BMODE                                                                      #
#                                                                            #
# Build rules for mach64 Chapter 3 sample code                               #
#                                                                            #
# Copyright (c) 1994-1998 ATI Technologies Inc.  All rights reserved.        #
##############################################################################

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

Compiler = wcc386
Linker = wlink
System = dos4g

!ifdef DEBUG
%M64SDKDEBUG = 1
!endif

!ifdef %M64SDKDEBUG
Compiler_Options = -fo=$*.obj -d2
Linker_options = debug all
!else
Compiler_Options = -fo=$*.obj -zld
Linker_options =
NDEBUG = 1
!endif

Exe_file = bmode.exe

Object_directory = obj

Object_files = $(Object_directory)\glob.obj &
               $(Object_directory)\init.obj &
               $(Object_directory)\m64bios.obj &
               $(Object_directory)\bmode.obj

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

all: $(Exe_file)

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

$(Exe_file): $(Object_directory) $(Object_files)
    *$(Linker) system $(System) $(Linker_Options) name $(Exe_file) &
    file {$(Object_files)}

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

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