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

WXDIR = $(WXWIN)

!include $(WXDIR)\src\makemsc.env

THISDIR = $(WXDIR)\utils\dialoged\src
WXLIB = $(WXDIR)\lib\wx.lib

DOCDIR = $(WXDIR)\utils\dialoged\docs

PROPDIR = $(WXDIR)\utils\wxprop
PROPINC = $(PROPDIR)\src
PROPLIB = $(PROPDIR)\lib\wxprop.lib

TREEDIR = $(WXDIR)\utils\wxtree
TREEINC = $(TREEDIR)\src
TREELIB = $(TREEDIR)\lib\wxtree.lib

DIBDIR = $(WXDIR)\utils\dib
DIBLIB = $(DIBDIR)\dib.lib
DIBINC = $(DIBDIR)

RCDIR = $(WXDIR)\utils\rcparser
RCLIB = $(RCDIR)\lib\rcparser.lib
RCINC = $(RCDIR)\src

LIBS=$(WXLIB) $(PROPLIB) oldnames libw llibcew commdlg shell ddeml
INC=/I$(WXDIR)\include\base /I$(WXDIR)\include\msw /I$(PROPINC)

!ifndef FINAL
FINAL=0
!endif

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

# Set this to nothing if using MS C++ 7
ZOPTION=/Z7

!if "$(FINAL)" == "0"
CPPFLAGS=/AL /W3 /Zi $(ZOPTION) /G2sw /Od /DDEBUG=$(DEBUG) /YuWX_PREC.H $(INC) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
LINKFLAGS=/NOD /CO /SEG:512 /ONERROR:NOEXE
!else
CPPFLAGS=/AL /W3 /G2sw /Ox /YuWX_PREC.H $(INC) /DDEBUG=$(DEBUG) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
LINKFLAGS=/NOD /SEG:512 /ONERROR:NOEXE
!endif

OBJECTS = dialoged.obj wx_resed.obj wx_rdlg.obj wx_reswr.obj wx_repal.obj wx_rprop.obj

all:    prop dialoged.exe

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

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


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

dialoged.obj:      dialoged.h $(PROPINC)\wx_prop.h wx_resed.h wx_rprop.h dialoged.$(SRCSUFF)
        cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<

wx_resed.obj:      wx_resed.h $(PROPINC)\wx_prop.h wx_resed.$(SRCSUFF)
        cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<

wx_rdlg.obj:      wx_resed.h $(PROPINC)\wx_prop.h wx_rdlg.$(SRCSUFF)
        cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<

wx_reswr.obj:      wx_resed.h wx_reswr.$(SRCSUFF)
        cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<

wx_rprop.obj:      wx_resed.h $(PROPINC)\wx_prop.h wx_rprop.$(SRCSUFF)
        cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<

wx_repal.obj:      wx_resed.h $(PROPINC)\wx_prop.h wx_repal.h wx_repal.$(SRCSUFF)
        cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<

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

wxtree:
        cd $(TREEDIR)\src
        nmake -f makefile.dos FINAL="$(FINAL)" OPT="$(OPT)"
        cd $(THISDIR)

dib:
        cd $(DIBDIR)
        nmake -f makefile.dos FINAL="$(FINAL)" OPT="$(OPT)"
        cd $(THISDIR)

prop:
        cd $(PROPDIR)\src
        nmake -f makefile.dos FINAL="$(FINAL)" OPT="$(OPT)"
        cd $(THISDIR)

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

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

$(DOCDIR)/hlp32/dialoged.hlp:         $(DOCDIR)/hlp32/dialoged.rtf $(DOCDIR)/hlp32/dialoged.hpj
        cd $(DOCDIR)/hlp32
        -erase dialoged.ph
        -wx /W hcw /c /e clockwrk.hpj
        cd $(THISDIR)

$(DOCDIR)/dialoged.rtf:         $(DOCDIR)/body.tex $(DOCDIR)/classes.tex $(DOCDIR)/tech.tex $(DOCDIR)/dialoged.tex
        cd $(DOCDIR)
        -wx /W tex2rtf $(DOCDIR)/dialoged.tex $(DOCDIR)/dialoged.rtf -twice $(RTFSTYLE)
        cd $(THISDIR)

$(DOCDIR)/hlp32/dialoged.rtf:         $(DOCDIR)/body.tex $(DOCDIR)/classes.tex $(DOCDIR)/body.tex $(DOCDIR)/dialoged.tex
        cd $(DOCDIR)
        -wx /W tex2rtf $(DOCDIR)/dialoged.tex $(DOCDIR)/hlp32/dialoged.rtf -twice $(RTFSTYLE) -macros $(DOCDIR)/t2rtf32.ini
        cd $(THISDIR)

wordrtf: 
        cd $(DOCDIR)
        -wx /W tex2rtf $(DOCDIR)/dialoged.tex $(DOCDIR)/dialoged.rtf -twice -rtf
        cd $(THISDIR)

cleanprop:
        cd $(PROPDIR)\src
        nmake -f makefile.dos clean
        cd $(THISDIR)

rcparser:
        cd $(RCDIR)\src
        nmake -f makefile.dos FINAL=$(FINAL) OPT=$(OPT)
        cd $(THISDIR)

cleanrtf:
        cd $(DOCDIR)
        -erase *.rtf
        cd  $(THISDIR)

cleanutils: cleanprop
        -erase *.obj
        -erase *.sbr
        -erase *.exe
        -erase *.res
        -erase *.map
        -erase *.pdb

clean:
        -erase *.obj *.exe *.res *.map *.rws
