# Copyright (c) 1993 Argonaut Software Ltd. All rights reserved.
#
# $Id: makefile.wat 1.3 1996/12/13 16:12:26 OWAIN Exp $
# $Locker: $
#
# Makefile for Watcom C using WMAKE
#
# if you select another program to compile remember
# to set the -A flag when re-building 

TUT_SOURCE=minimal
#TUT_SOURCE=brtutor1
#TUT_SOURCE=brtutor2
#TUT_SOURCE=brtutor3
#TUT_SOURCE=brtutor4
#TUT_SOURCE=brtutor5
#TUT_SOURCE=brtutr5b
#TUT_SOURCE=brtutor6
#TUT_SOURCE=brtutr6b
#TUT_SOURCE=brtutor7
#TUT_SOURCE=brtutr7b
#TUT_SOURCE=brtutor8
#TUT_SOURCE=brtutr8b
#TUT_SOURCE=brtutor9
#TUT_SOURCE=brtutr10

TARGET=$(TUT_SOURCE).exe

BASE_DIR=c:\brender

# Float, Debug, Register
#LIB_TYPE=wfdr
#LIB_TYPE_NB=wdr
#LIB_TYPE_EX=4gwdr
#BASED=FLOAT

# Float, Release, Register
LIB_TYPE=wfrr
LIB_TYPE_NB=wrr
LIB_TYPE_EX=4gwrr
BASED=FLOAT

CC=wcc386
CFLAGS=-omaxnet -zp4 -5r -fp3&
 -DBASED_$(BASED)=1&
 -I$(BASE_DIR)\inc&
 -I$(BASE_DIR)\dosio

OBJS=&
	$(TUT_SOURCE).obj&

LIBS=&
	$(BASE_DIR)/lib/brfw$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/brfm$(LIB_TYPE).lib&
	$(BASE_DIR)/lib/brdb$(LIB_TYPE).lib&
	$(BASE_DIR)/lib/brmt$(LIB_TYPE).lib&
	$(BASE_DIR)/lib/brpm$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/dosio$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/brst$(LIB_TYPE_NB).lib&
	$(BASE_DIR)/lib/hst$(LIB_TYPE_EX).lib&

# Default rules
#
# Cope with long command lines
#
.c.obj:
	set _ARGS=$(CFLAGS) $*.c
	$(CC) @_ARGS

$(TARGET): $(OBJS) wlink.rsp
	wlink debug all @wlink.rsp
   
# Link response file
#
wlink.rsp:
	echo name $(TARGET) >wlink.rsp
	echo system dos4g >>wlink.rsp
	echo option dosseg,caseexact,quiet,stack=64k >>wlink.rsp
	for %i in ($(OBJS)) do echo file %i >>wlink.rsp
	for %i in ($(LIBS)) do echo library %i >>wlink.rsp

