#
# File:		makefile.dos
# Author:	Julian Smart
# Created:	1993
# Updated:	
# Copyright:	(c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds wxToolbar library
# Use FINAL=1 argument to nmake to build final version with no debugging
# info

# Set WXDIR for your system
WXDIR = $(WX)
WXLIB = $(WXDIR)\lib\wx.lib $(WXDIR)\contrib\fafa\fafa.lib

INC = /I$(WXDIR)\include\base /I$(WXDIR)\include\msw
TOOLBARLIB = ..\lib\toolbar.lib
TOOLBARDIR = $(WXDIR)\utils\toolbar
THISDIR = $(TOOLBARDIR)\src
DOCDIR = $(TOOLBARDIR)\docs
DOCUTILSDIR = $(WXDIR)\utils\tex2rtf\src

LIBS=$(WXLIB) $(TOOLBARLIB) oldnames libw llibcew commdlg shell ctl3d

!ifndef FINAL
FINAL=0
!endif

# Default is to output RTF for WinHelp
!ifndef WINHELP
WINHELP=-winhelp
!endif

!if "$(FINAL)" == "0"
CPPFLAGS=/AL /W3 /Zi /G2sw /Od /YuWX.H $(INC) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
LINKFLAGS=/NOD /CO /ONERROR:NOEXE
!else
CPPFLAGS=/AL /W3 /Zi /G2sw /Os /YuWX.H $(INC) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
LINKFLAGS=/NOD /ONERROR:NOEXE
!endif

OBJECTS = test.obj

all:    $(TOOLBARLIB)

wx:
        cd $(WXDIR)\src\msw
        nmake -f makefile.dos FINAL=$(FINAL)
        cd $(THISDIR)

wxclean:
        cd $(WXDIR)\src\msw
        nmake -f makefile.dos clean
        cd $(THISDIR)

$(TOOLBARLIB):      wx_tbar.obj
        erase $(TOOLBARLIB)
        lib  /PAGESIZE:128 @<<
$(TOOLBARLIB)
y
wx_tbar.obj
nul
;
<<

wx_tbar.obj:      wx_tbar.h wx_tbar.cc
        cl @<<
$(CPPFLAGS) /c /Tp $*.cc
<<

test.exe:      $(WXDIR)\src\msw\dummy.obj $(WXLIB) $(TOOLBARLIB) test.obj test.def test.res
        link $(LINKFLAGS) @<<
$(WXDIR)\src\msw\dummy.obj test.obj,
test,
NUL,
$(LIBS),
test.def
;
<<
        rc -30 -K test.res

test.obj:      test.h test.cc
        cl @<<
$(CPPFLAGS) /c /Tp $*.cc
<<

test.res :      test.rc $(WXDIR)\include\msw\wx.rc
    rc -r /dFAFA_LIB /i$(WXDIR)\contrib\fafa /i$(WXDIR)\include\msw test

# Making documents
docs:   $(DOCDIR)/toolbar.hlp
rtf:    $(DOCDIR)/toolbar.rtf
hlp:    $(DOCDIR)/toolbar.hlp

$(DOCDIR)/toolbar.hlp:         $(DOCDIR)/toolbar.rtf $(DOCDIR)/toolbar.hpj
        cd $(DOCDIR)
        -erase toolbar.ph
        hc toolbar
        cd $(THISDIR)

$(DOCDIR)/toolbar.rtf:         $(DOCDIR)/classes.tex $(DOCDIR)/manual.tex
        cd $(DOCDIR)
        -wx tex2rtf $(DOCDIR)\manual.tex $(DOCDIR)\toolbar.rtf -twice $(WINHELP)
        cd $(THISDIR)

clean:
        -erase *.obj *.exe *.res *.map *.lib $(TOOLBARLIB)
