#-------------------------------------------------------------------
#        D - F L A T   M A K E F I L E  -  Borland C++ 3.1 and 4.0
#-------------------------------------------------------------------
# Tested with Turbo C++ 1.01, Turbo C/C++ 3.0, Borland C/C++ 3.1
#

all : edit.exe edit.hlp

#------------------------------------------------
# NOTE: Set DRIVE to match where you installed your compiler
#------------------------------------------------
DRIVE = c:\tc
#DRIVE = c:\tc201
#DRIVE = c:\tc101
#DRIVE = c:\tc30
#DRIVE = c:\borlandc
#-------------------------------------------------------------------
#  This macro builds the full D-Flat system with all options enabled.
#  Comment it out for a minimum system or selectively
#  comment out the #defines at the top of dflat.h.
#-------------------------------------------------------------------
FULL = BUILD_FULL_DFLAT
#-------------------------------------------------------------------

MODEL = l
#------------------------------------------------
# NOTE: Delete the DEBUG and LINKDEBUG macros to 
# build without debugging information in the .EXE
#------------------------------------------------
#DEBUG = -v -Od
#LINKDEBUG = /m /v
#------------------------------------------------
# NOTE: Temporary file space. Change to match
#       your computer. A RAM disk works best.
#------------------------------------------------
HEADERS=c:\temp\tcdef.sym
#------------------------------------------------
# Set to match your compiler
#------------------------------------------------
CC = tcc
#CC = bcc
LINKER = tlink
LIB = tlib
#------------------------------------------------
# Set any extra options here
#------------------------------------------------
# for TC++1.01 or other compilers, skip inline asm in video.c
#CCEXTRA = $(CCEXTRA) -DNOINLINEASM
# for TC2.01 or if you don't want it (works fine with TC++1.01 and higher)
#CCEXTRA = $(CCEXTRA) -DNOCALENDAR
#------------------------------------------------
COMPILE = $(CC) $(DEBUG) -D$(TESTING) -D$(FULL) -DBCPP -c -d -m$(MODEL) $(CCEXTRA)
LINK= $(LINKER) $(LINKDEBUG) $(DRIVE)\lib\c0$(MODEL)
LIBS= $(DRIVE)\lib\c$(MODEL)
#------------------------------------------------

.c.obj:
    $(COMPILE) $*.c

edit.exe : edit.obj dialogs.obj menus.obj dflat.lib
    $(LINK) edit dialogs menus,edit.exe,edit,dflat $(LIBS)

dflat.lib :   window.obj video.obj message.obj                         \
              mouse.obj console.obj textbox.obj listbox.obj            \
              normal.obj config.obj menu.obj menubar.obj popdown.obj   \
              rect.obj applicat.obj keys.obj sysmenu.obj editbox.obj   \
              dialbox.obj button.obj fileopen.obj msgbox.obj           \
              helpbox.obj log.obj lists.obj statbar.obj decomp.obj     \
              combobox.obj pictbox.obj clipbord.obj search.obj         \
              dfalloc.obj checkbox.obj text.obj radio.obj box.obj      \
              spinbutt.obj  watch.obj slidebox.obj direct.obj          \
              editor.obj calendar.obj
	del dflat.lib
	$(LIB) dflat @dflat.bld

huffc.exe : huffc.obj htree.obj
    $(LINK) huffc htree,$*.exe,$*,$(LIBS)

fixhelp.exe : fixhelp.obj decomp.obj
    $(LINK) fixhelp decomp,$*.exe,$*,$(LIBS)

edit.hlp : edit.txt huffc.exe fixhelp.exe
    huffc edit.txt edit.hlp
    fixhelp edit

upx : all
    upx --8086 --best edit.exe
