###################################################################
#
#  makefile.bcc - TOband makefile for Borland C++ 5.5 (Win32)
#
###################################################################


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

###################################################################
#
# Set tool and version names:

CPP        = bcc32
LINKER     = ilink32
RC         = brc32

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

EXE_FILE = TOband.exe


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

# DBGOPT= -v -N -x -xp


###################################################################
#
#  Change these for English version (or Japanese version)
#

# Japanese version (comment out for English version)
JP_OPT= -DJP -DSJIS
ANGBAND_RC = angband.rc

# English version (un-comment for English version)
#ANGBAND_RC = ang_eng.rc



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

CCOPTS = -Od -jb -j1 -Hc -tW -lGn -e$(EXE_FILE) \
	-wamb -wdef -wnod -wpin -wstu -wstv -wuse \
	-D_WIN32_WINNT=0x0400 -DWINVER=0x0400 \
	$(JP_OPT)

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


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

OBJ = \
	artifact.obj autopick.obj birth.obj bldg.obj cave.obj \
	cmd1.obj cmd2.obj cmd3.obj cmd4.obj cmd5.obj cmd6.obj \
	dungeon.obj effects.obj files.obj flavor.obj floors.obj generate.obj \
	grid.obj init1.obj init2.obj japanese.obj \
	load.obj main-win.obj melee1.obj melee2.obj \
	monster1.obj monster2.obj mspells1.obj mspells2.obj \
	mutation.obj \
	obj_kind.obj object1.obj object2.obj racial.obj \
	report.obj rooms.obj save.obj scores.obj spells1.obj \
	spells2.obj spells3.obj store.obj streams.obj tables.obj util.obj \
	variable.obj wild.obj wizard1.obj wizard2.obj xtra1.obj xtra2.obj \
	z-form.obj z-rand.obj z-term.obj z-util.obj z-virt.obj

all : $(EXE_FILE)

clean:
	-@if exist *.obj del *.obj >nul
	-@if exist *.exe del *.exe >nul
	-@if exist *.res del *.res >nul
	-@if exist *.tds del *.tds >nul
	-@if exist *.ilc del *.ilc >nul
	-@if exist *.ild del *.ild >nul
	-@if exist *.ilf del *.ilf >nul
	-@if exist *.ils del *.ils >nul

install: $(EXE_FILE)
	copy $(EXE_FILE) ..


########################### Explicit Rules ########################
$(EXE_FILE): $(OBJ) angband.res
	$(LINKER) -aa -x $(OBJ) c0w32.obj, $(EXE_FILE),, cw32.lib import32.lib,, angband.res

angband.res: $(ANGBAND_RC)
	$(RC) -r -foangband.res $(ANGBAND_RC)

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

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

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

