##############################################################################
# ALPHBLND                                                                   #
#                                                                            #
# Build rules for Radeon Chapter 7 sample code                               #
#                                                                            #
# Copyright (c) 2000 ATI Technologies Inc.  All rights reserved.             #
##############################################################################

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

Compiler = wcc386
Linker = wlink
System = dos4g

!ifdef DEBUG
%RADEONDDKDEBUG= 1
!endif

!ifdef %RADEONDDKDEBUG
Compiler_Options = -fo=$*.obj -d2 -w3 -zq
Linker_options = debug all option quiet
!else
Compiler_Options = -fo=$*.obj -zld -zq
Linker_options = option quiet
NDEBUG = 1
!endif

Exe_file = alphblnd.exe

Object_directory = obj

Object_files =  $(Object_directory)\alphblnd.obj

Library_file = 	..\..\lib\radeon2d.lib &
		..\..\lib\3d\radeon3d.lib

##################
# 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) $(Library_file)
    *$(Linker) system $(System) $(Linker_Options) name $(Exe_file) &
    file {$(Object_files)} library {$(Library_file)}

$(Library_file):
    set RADEONDDKPATH = $(%cwd)
    cd ..
    wmake $(__MAKEOPTS__) 
    cd $(%RADEONDDKPATH)

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

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