#
# File:		makefile.bcc
# Author:	Julian Smart
# Created:	1993
# Updated:	
# Copyright:	(c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds wxWindows library wx.lib for Windows 3.1
# and Borland C++ 3.1

!if !$d(WXDIR)
WXDIR = d:\wxwin
!endif
THISDIR = $(WXDIR)\src\msw
WXLIB = $(WXDIR)\lib
WXINC = $(WXDIR)\include\msw
WXBASESRC = $(WXDIR)\src\base
WXBASEINC = $(WXDIR)\include\base
BCCDIR = d:\borlandc

!if !$d(OPT)
OPT = 
!endif
!if !$d(DEBUG_FLAGS)
DEBUG_FLAGS = -v
!endif
!if !$d(CFG)
CFG = wxwin.cfg
!endif

CPPFLAGS= $(DEBUG_FLAGS) $(OPT) @$(CFG)

LIBTARGET= $(WXLIB)\wx.lib
DUMMY=dummydll

LIBS=libw llibcew

.cc.obj:
	bcc $(CPPFLAGS) -c {$< }

BASEHEADERS = $(WXBASEINC)/common.h \
  $(WXBASEINC)/wb_buttn.h \
  $(WXBASEINC)/wb_canvs.h \
  $(WXBASEINC)/wb_check.h \
  $(WXBASEINC)/wb_choic.h \
  $(WXBASEINC)/wb_dc.h \
  $(WXBASEINC)/wb_dccan.h \
  $(WXBASEINC)/wb_dcmem.h \
  $(WXBASEINC)/wb_dialg.h \
  $(WXBASEINC)/wb_frame.h \
  $(WXBASEINC)/wb_gdi.h \
  $(WXBASEINC)/wb_ipc.h \
  $(WXBASEINC)/wb_ipcob.h \
  $(WXBASEINC)/wb_item.h \
  $(WXBASEINC)/wb_lbox.h \
  $(WXBASEINC)/wb_main.h \
  $(WXBASEINC)/wb_menu.h \
  $(WXBASEINC)/wb_messg.h \
  $(WXBASEINC)/wb_mf.h \
  $(WXBASEINC)/wb_mnuit.h \
  $(WXBASEINC)/wb_mtxt.h \
  $(WXBASEINC)/wb_panel.h \
  $(WXBASEINC)/wb_slidr.h \
  $(WXBASEINC)/wb_text.h \
  $(WXBASEINC)/wb_timer.h \
  $(WXBASEINC)/wb_txt.h \
  $(WXBASEINC)/wb_win.h \
  $(WXBASEINC)/wx_dcps.h \
  $(WXBASEINC)/wx_clipb.h \
  $(WXBASEINC)/wx_form.h \
  $(WXBASEINC)/wx_hash.h \
  $(WXBASEINC)/wx_help.h \
  $(WXBASEINC)/wx_list.h \
  $(WXBASEINC)/wxstring.h \
  $(WXBASEINC)/wx_mgstr.h \
  $(WXBASEINC)/wx_obj.h \
  $(WXBASEINC)/wx_stdev.h \
  $(WXBASEINC)/wx_sysev.h \
  $(WXBASEINC)/wx_types.h \
  $(WXBASEINC)/wx_utils.h

LOCALHEADERS = \
  $(WXINC)/wx_buttn.h \
  $(WXINC)/wx_canvs.h \
  $(WXINC)/wx_check.h \
  $(WXINC)/wx_choic.h \
  $(WXINC)/wx_dc.h \
  $(WXINC)/wx_dccan.h \
  $(WXINC)/wx_dcmem.h \
  $(WXINC)/wx_dialg.h \
  $(WXINC)/wx_frame.h \
  $(WXINC)/wx_gdi.h \
  $(WXINC)/wx_ipc.h \
  $(WXINC)/wx_ipcob.h \
  $(WXINC)/wx_item.h \
  $(WXINC)/wx_lbox.h \
  $(WXINC)/wx_main.h \
  $(WXINC)/wx_menu.h \
  $(WXINC)/wx_messg.h \
  $(WXINC)/wx_mf.h \
  $(WXINC)/wx_mnuit.h \
  $(WXINC)/wx_mtxt.h \
  $(WXINC)/wx_panel.h \
  $(WXINC)/wx_privt.h \
  $(WXINC)/wx_slidr.h \
  $(WXINC)/wx_text.h \
  $(WXINC)/wx_timer.h \
  $(WXINC)/wx_txt.h \
  $(WXINC)/wx_win.h

SOURCES = $(DUMMY).cc wx_win.cc wx_frame.cc wx_panel.cc wx_utils.cc wx_main.cc\
  wx_item.cc wx_text.cc wx_gdi.cc wx_dialg.cc wx_canvs.cc wx_dc.cc\
  wx_ipc.cc wx_timer.cc wx_mf.cc

OBJECTS1 = wx_win.obj wx_frame.obj wx_panel.obj wx_utils.obj wx_main.obj\
  wx_item.obj

OBJECTS2 = wx_text.obj wx_gdi.obj wx_dialg.obj wx_canvs.obj wx_dc.obj wx_mf.obj

OBJECTS3 = wx_ipc.obj wx_timer.obj wx_clipb.obj

OBJECTS = $(OBJECTS1) $(OBJECTS2) $(OBJECTS3)

BASEOBJECTS1 = ..\base\wb_win.obj ..\base\wb_frame.obj ..\base\wb_panel.obj\
  ..\base\wb_utils.obj ..\base\wb_main.obj

BASEOBJECTS2 = ..\base\wb_item.obj ..\base\wb_list.obj ..\base\wb_obj.obj\
  ..\base\wb_ps.obj

BASEOBJECTS3 = ..\base\wb_text.obj ..\base\wb_gdi.obj ..\base\wb_dialg.obj\
  ..\base\wb_canvs.obj\

BASEOBJECTS4 = ..\base\wb_dc.obj ..\base\wb_mf.obj ..\base\wb_hash.obj\
  ..\base\wb_ipc.obj\

BASEOBJECTS5 = ..\base\wb_form.obj ..\base\wb_timer.obj ..\base\wb_help.obj

BASEOBJECTS6 = ..\base\wb_sysev.obj ..\base\wb_stdev.obj ..\base\wb_types.obj\
		..\base\wb_mgstr.obj ..\base\wxstring.obj

BASEOBJECTS = $(BASEOBJECTS1) $(BASEOBJECTS2) $(BASEOBJECTS3)\
  $(BASEOBJECTS4) $(BASEOBJECTS5) $(BASEOBJECTS6)


all:    $(CFG) $(DUMMY).obj base $(OBJECTS) $(LIBTARGET)

base:
	cd $(WXBASESRC)
	make -f makefile.bcc -DCFG=$(CFG) -DWXDIR=$(WXDIR) -DDEBUG_FLAGS=$(DEBUG_FLAGS) -DOPT=$(OPT)
	cd $(THISDIR)

$(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(BASEOBJECTS)
	erase $(LIBTARGET)
	tlib /P128 @&&!
$(WXLIB)\wx.lib &
+$(OBJECTS:.obj =.obj +) +$(BASEOBJECTS:.obj =.obj +)
!

dummy.obj: dummy.cc $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\base\wx.h
	

dummydll.obj: dummydll.cc $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\base\wx.h

wx_obj.obj:     $(WXBASEINC)\wx_obj.h

wx_win.obj:     $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h \
  $(WXBASEINC)\wx_utils.h wx_win.cc $(WXINC)\wx_gdi.h $(WXINC)\wx_privt.h

wx_main.obj:   $(WXBASEINC)\common.h $(WXBASEINC)\wx_obj.h $(WXINC)\wx_frame.h $(WXBASEINC)\wx_utils.h \
  $(WXINC)\wx_main.h wx_main.cc $(WXINC)\wx_privt.h

wx_frame.obj:   $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_frame.h wx_frame.cc\
		$(WXBASEINC)\wx_stdev.h $(WXINC)\wx_privt.h

wx_panel.obj:   $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_frame.h $(WXINC)\wx_panel.h\
		wx_panel.cc $(WXBASEINC)\wx_stdev.h $(WXINC)\wx_privt.h

wx_text.obj:    $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_frame.h $(WXINC)\wx_text.h\
		wx_text.cc $(WXBASEINC)\wx_stdev.h $(WXINC)\wx_privt.h

wx_canvs.obj:    $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_frame.h $(WXINC)\wx_canvs.h\
		 wx_canvs.cc $(WXBASEINC)\wx_stdev.h $(WXINC)\wx_gdi.h\
		 $(WXINC)\wx_dc.h $(WXINC)\wx_privt.h

wx_dc.obj:    $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_frame.h $(WXINC)\wx_canvs.h\
		 wx_dc.cc $(WXBASEINC)\wx_stdev.h $(WXINC)\wx_gdi.h $(WXINC)\wx_dc.h\
	$(WXINC)/wx_dccan.h $(WXINC)/wx_dcmem.h

wx_mf.obj:    $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h\
		 wx_mf.cc $(WXBASEINC)\wx_stdev.h $(WXINC)\wx_gdi.h $(WXINC)\wx_mf.h
	
wx_item.obj:    $(WXBASEINC)\common.h $(WXINC)\wx_win.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_frame.h $(WXINC)\wx_item.h\
		wx_item.cc $(WXBASEINC)\wx_stdev.h $(WXINC)\wx_privt.h
	
wx_utils.obj:   $(WXBASEINC)\common.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h wx_utils.cc
	
wx_ipc.obj:   $(WXBASEINC)\common.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_utils.h $(WXINC)\wx_ipc.h wx_ipc.cc
	
# wx_event.obj:   $(WXBASEINC)\common.h $(WXBASEINC)\wx_obj.h $(WXBASEINC)\wx_stdev.h $(WXBASEINC)\wx_utils.h wx_event.cc
#        cl @<<
# $(CPPFLAGS) /c /Tp $*.cc
# <<

wx_gdi.obj:   $(WXBASEINC)\common.h $(WXINC)\wx_gdi.h $(WXBASEINC)\wx_utils.h wx_gdi.cc
	
wx_dialg.obj:   $(WXBASEINC)\common.h wx_dialg.cc $(WXINC)\wx_dialg.h $(WXINC)\wx_win.h\
  $(WXBASEINC)\wx_utils.h $(WXINC)\wx_panel.h $(WXINC)\wx_privt.h
	
wx_timer.obj:   $(WXBASEINC)\common.h wx_timer.cc $(WXINC)\wx_timer.h
	
wx_clipb.obj:   $(WXBASEINC)\common.h wx_clipb.cc $(WXBASEINC)\wx_clipb.h
	
$(WXINC)/wx_win.h:  $(WXBASEINC)/wb_win.h
$(WXINC)/wx_main.h:  $(WXBASEINC)/wb_main.h
$(WXINC)/wx_frame.h:  $(WXBASEINC)/wb_frame.h
$(WXINC)/wx_panel.h:  $(WXBASEINC)/wb_panel.h
$(WXINC)/wx_text.h:  $(WXBASEINC)/wb_text.h
$(WXINC)/wx_dialg.h:  $(WXBASEINC)/wb_dialg.h
$(WXINC)/wx_ipc.h:  $(WXBASEINC)/wb_ipc.h
$(WXINC)/wx_gdi.h:  $(WXBASEINC)/wb_gdi.h
$(WXINC)/wx_event.h:  $(WXBASEINC)/wb_event.h
$(WXINC)/wx_canvs.h:  $(WXBASEINC)/wb_canvs.h
$(WXINC)/wx_mf.h:  $(WXBASEINC)/wb_mf.h
$(WXINC)/wx_item.h:  $(WXBASEINC)/wb_item.h
$(WXINC)/wx_buttn.h:  $(WXBASEINC)/wb_buttn.h
$(WXINC)/wx_messg.h:  $(WXBASEINC)/wb_messg.h
$(WXINC)/wx_choic.h:  $(WXBASEINC)/wb_choic.h
$(WXINC)/wx_check.h:  $(WXBASEINC)/wb_check.h
$(WXINC)/wx_lbox.h:  $(WXBASEINC)/wb_lbox.h
$(WXINC)/wx_txt.h:  $(WXBASEINC)/wb_txt.h
$(WXINC)/wx_mtxt.h:  $(WXBASEINC)/wb_mtxt.h
$(WXINC)/wx_slidr.h:  $(WXBASEINC)/wb_slidr.h
$(WXINC)/wx_menu.h:  $(WXBASEINC)/wb_menu.h

clean:
	-erase $(OBJECTS1)
	-erase $(OBJECTS2)
	-erase $(OBJECTS3)
	-erase $(BASEOBJECTS1)
	-erase $(BASEOBJECTS2)
	-erase $(BASEOBJECTS3)
	-erase $(BASEOBJECTS4)
	-erase $(BASEOBJECTS5)
	-erase $(BASEOBJECTS6)
	-erase $(DUMMY).obj
	-erase $(PCH)
	-erase $(LIBTARGET)

cleanall: clean
	-erase *.pch *.obj ..\lib\*.lib


