# MAKEFILE for Splitwnd example 
#
# George Cross, Borland C++ Developer Support, July 1996
#
# Comments:  Makefile for Borland C++.
#            \BIN\BCC32.CFG is used for compiler include directory settings.
#            \BIN\TLINK32.CFG is used for linker include directory settings.  
# 
#    MAKE                              Static version of the RTL used
#    MAKE -D_RTLDLL                    Dynamic version of the RTL used  
#    MAKE -DDEBUG                      Debug version of Splitwnd 


PROJ = SPLITWND 

OBJS  = $(PROJ).obj treeview.obj misc.obj
RESES = $(PROJ).res

CDEFINES = -DSTRICT \                          
           -DWIN32_LEAN_AND_MEAN
          
CFLAGS = $(CDEFINES) /c                        #Compile options
LFLAGS = /Tpe /aa /c                           #Link options
RFLAGS = -i.\resource                          #Resource compile options

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

!if "$(_RTLDLL)" == "1"                        #Static or dynamic RTL
  RTLLIB = cw32mti
!else
  RTLLIB = cw32mt
!endif

$(PROJ).exe: $(OBJS) $(RESES)                  #Target
	TLINK32 $(LFLAGS) @&&|                    
	c0w32 $(OBJS)                          #Startup and objs
	$&                                     #Target
                                               #Map file 
        $(RTLLIB) import32                     #Static and import libraries
                                               #Module definition file
        $(RESES)                               #Resources
|

.cpp.obj:
  bcc32 $(CFLAGS) $&
.rc.res:
  brcc32 $(RFLAGS) $<


printdebuginfo:                                #Rule for debugging the makefile
	@type &&|
		PROJ     = $(PROJ)
		CFLAGS   = $(CFLAGS)
		LFLAGS   = $(LFLAGS)
                RFLAGS   = $(RFLAGS)
		CDEFINES = $(CDEFINES)
|

clean:                                         #Clean up rule
	@if exist $(PROJ).exe erase $(PROJ).exe
	@if exist $(PROJ).dll erase $(PROJ).dll
	@if exist $(PROJ).ocx erase $(PROJ).ocx
	@if exist *.csm erase *.csm
	@if exist *.map erase *.map
	@if exist *.obj erase *.obj
	@if exist *.exp erase *.exp
	@if exist *.lib erase *.lib
	@if exist *.res erase *.res

# End of makefile
