###################################################################
#
#       Borland specific directives ---
#
.AUTODEPEND


###################################################################
#
# Set tool and version names:
!ifndef BCCDIR
BCCDIR     = "C:\Program Files (x86)\Borland\CBuilder6"
!endif

CPP        = $(BCCDIR)\bin\bcc32
LINKER     = $(BCCDIR)\bin\ilink32
RC         = $(BCCDIR)\bin\brc32


###################################################################
#
# Name of the *.exe-file

CLI_EXE = mangclient_gcu.exe


###################################################################
#
# Debug mode (un-comment for debugging)

# DBGOPT= -v -N -x -xp


###################################################################
#
# Set any compiler options

CCOPTS = -Hc -tW -lGn -w8080 -w-8004 -w-8057 \
	-D_WIN32_WINNT=0x0500 -DWINVER=0x0500 \
	-DWIN32 -D_WINDOWS -DSTRICT -DUSE_GCU \
	-I$(BCCDIR)\include -Icurses

LDFLAGS = -L$(BCCDIR)\lib -Lcurses


# Compile flags:
CPPFLAGS= $(CCOPTS) $(DBGOPT)


######################## Targets ##################################

CLI_SRCS = \
  common\buildid.c \
  common\datafile.c \
  common\display.c \
  common\guid.c \
  common\md5.c \
  common\net-win.c \
  common\obj-gear-common.c \
  common\obj-tval.c \
  common\option.c \
  common\parser.c \
  common\randname.c \
  common\sockbuf.c \
  common\source.c \
  common\util.c \
  common\z-bitflag.c \
  common\z-color.c \
  common\z-dice.c \
  common\z-expression.c \
  common\z-file.c \
  common\z-form.c \
  common\z-rand.c \
  common\z-type.c \
  common\z-util.c \
  common\z-virt.c \
  client\c-cmd.c \
  client\c-cmd-obj.c \
  client\c-option.c \
  client\c-player.c \
  client\cmd-core.c \
  client\conf.c \
  client\game-event.c \
  client\game-input.c \
  client\grafmode.c \
  client\main.c \
  client\main-gcu.c \
  client\netclient.c \
  client\set_focus.c \
  client\sound-core.c \
  client\ui-birth.c \
  client\ui-command.c \
  client\ui-context.c \
  client\ui-curse.c \
  client\ui-death.c \
  client\ui-display.c \
  client\ui-event.c \
  client\ui-game.c \
  client\ui-init.c \
  client\ui-input.c \
  client\ui-keymap.c \
  client\ui-knowledge.c \
  client\ui-menu.c \
  client\ui-message.c \
  client\ui-object.c \
  client\ui-options.c \
  client\ui-output.c \
  client\ui-prefs.c \
  client\ui-spell.c \
  client\ui-store.c \
  client\ui-term.c

CLI_OBJS = \
  common\buildid.obj \
  common\datafile.obj \
  common\display.obj \
  common\guid.obj \
  common\md5.obj \
  common\net-win.obj \
  common\obj-gear-common.obj \
  common\obj-tval.obj \
  common\option.obj \
  common\parser.obj \
  common\randname.obj \
  common\sockbuf.obj \
  common\source.obj \
  common\util.obj \
  common\z-bitflag.obj \
  common\z-color.obj \
  common\z-dice.obj \
  common\z-expression.obj \
  common\z-file.obj \
  common\z-form.obj \
  common\z-rand.obj \
  common\z-type.obj \
  common\z-util.obj \
  common\z-virt.obj \
  client\c-cmd.obj \
  client\c-cmd-obj.obj \
  client\c-option.obj \
  client\c-player.obj \
  client\cmd-core.obj \
  client\conf.obj \
  client\game-event.obj \
  client\game-input.obj \
  client\grafmode.obj \
  client\main.obj \
  client\main-gcu.obj \
  client\netclient.obj \
  client\set_focus.obj \
  client\sound-core.obj \
  client\ui-birth.obj \
  client\ui-command.obj \
  client\ui-context.obj \
  client\ui-curse.obj \
  client\ui-death.obj \
  client\ui-display.obj \
  client\ui-event.obj \
  client\ui-game.obj \
  client\ui-init.obj \
  client\ui-input.obj \
  client\ui-keymap.obj \
  client\ui-knowledge.obj \
  client\ui-menu.obj \
  client\ui-message.obj \
  client\ui-object.obj \
  client\ui-options.obj \
  client\ui-output.obj \
  client\ui-prefs.obj \
  client\ui-spell.obj \
  client\ui-store.obj \
  client\ui-term.obj

default: $(CLI_EXE)


########################### Explicit Rules ########################
$(CLI_EXE): $(CLI_OBJS) win\angband.res
	$(LINKER) -ap $(LDFLAGS) -x $(CLI_OBJS) c0x32.obj, $(CLI_EXE),, cw32mt.lib import32.lib ws2_32.lib curses\pdcurses.lib,, win\angband.res

win\angband.res: win\angband.rc
	$(RC) -r win\angband.rc

########################### Implicit Rules ########################
.c.obj:
	$(CPP) $(CPPFLAGS) -o$*.obj -c {$? }

.c.i:
	$(CPP) $(CPPFLAGS) -c -Sr -Sd {$? }

.obj.exe:
	$(CPP) $(CPPFLAGS) $<

