# Makefile for MTTTY project built with Borland C++ 5.0.
# MTTTY is a sample made available by Microsoft.
#
# Prepared by George Cross, Borland C++ Developer Support, July 1996
#
# Comments:  BUILTINS.MAK is called and used first.  All implicit rules are
#            contained therein.
#            BCC32.CFG and TLINK32.CFG contain the include and link directories.
#            Please use this makefile as follows.
#
# Usage:                make -DWIN32 -DDEBUG


# Since the source files are in another directory, we must use
# the implicit rules below instead of the ones in BUILTINS.MAK
.path.c  = ..\\;.\\                  # This directory and the one above
.path.rc = ..\\                      # The directory above
.c.obj:
    $(CC) $(CFLAGS) /c $<

.rc.res:
    $(RC) $(RFLAGS) /r $<


PROJ = MTTTY

PROJ_OBJS  =    about.obj     error.obj    \
                init.obj      mttty.obj    \
                reader.obj    readstat.obj \
                settings.obj  status.obj   \
                transfer.obj  writer.obj   \
                globals.obj
STD_LIBS   =    cw32mt.lib import32.lib
GLOBAL_DEP =    mttty.h ttyinfo.h
RC_DEP     =    resource.h mttty.ico \
                mttty2.ico mttty3.ico \
                mttty4.ico

INCDIRS  = -I$(BCROOT)\include;..\;           #Include directories different from BCC32.CFG
CDEFINES = -DSTRICT                              #Defines used in compiling
CFLAGS = $(CDEFINES) $(CFLAGS) $(INCDIRS) -tWM   #Compile options
RFLAGS = $(RFLAGS) $(INCDIRS) -fo.\$(PROJ)
LFLAGS = /Tpe /aa /c                             #Link options

!if "$(DEBUG)" == "1"                         #Debug info included or not..
  CFLAGS = $(CFLAGS) -v
  LFLAGS = $(LFLAGS) /v
!endif

# Build rule for EXE
$(PROJ).EXE: $(PROJ_OBJS) $(PROJ).res
	TLINK32 $(LFLAGS) @&&|
	c0w32 $(PROJ_OBJS)                   # Startup code and obj's
	$&                                   # Executable module
	$&                                   # Map file
	$(STD_LIBS)                          # Run time and Import libs
                                        # Module definition file
	$(PROJ).res                          # Resource file
|                                       # End of temporary file

# Rules for cleaning out those old files
clean:
    del *.bak
    del *.pdb
    del *.obj
    del *.res
    del *.exp
    del *.map
    del *.sbr
    del *.bsc

