##############################################################################
# NOBIOS                                                                     #
#                                                                            #
# Build rules for RADEON Chapter 3 sample code                               #
#                                                                            #
# Copyright (c) 2000 ATI Technologies Inc.  All rights reserved.             #
##############################################################################

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

Compiler = wcc386
Linker = wlink
System = dos4g

#!ifdef DEBUG
%RadeonSDKDEBUG = 1
#!endif

!ifdef %RadeonSDKDEBUG
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 = nobios.exe

Object_directory = obj

Object_files = $(Object_directory)\nobios.obj

Library_file = ..\..\lib\radeon2d.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 RadeonSDKPATH = $(%cwd)
    cd ..
    wmake $(__MAKEOPTS__)
    cd $(%RadeonSDKPATH)

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

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