#
# File:		makefile.nt
# Author:	Julian Smart
# Created:	1993
# Updated:	
# Copyright:	(c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
!include <ntwin32.mak>
OS_SPEC=/nologo -DWINNT -DMS_WINDOWS -Dwx_msw
ALLFLAGS= $(OS_SPEC) $(cflags) $(cvars) $(cdebug)
# Makefile : Builds wxHelp for Windows 3.1

# Change WXDIR to wherever wxWindows is found
WXDIR = $(WX)
WXLIB = $(WXDIR)\lib\wx.lib
WXINC = $(WXDIR)\include

HYPDIR = $(WXDIR)\utils\hytext
HYPINC = $(HYPDIR)\src
HYPLIB = $(HYPDIR)\lib\hytext.lib

WXHELPDIR = $(WXDIR)\utils\wxhelp
TEX2ANYLIB = $(WXHELPDIR)\lib\tex2any.lib

INC=/I$(HYPINC) /I$(WXDIR)\include\base /I$(WXDIR)\include\msw
#
# Not used
#
#LIBS=$(WXLIB) $(HYPLIB) libw llibcew commdlg ddeml shell


#---------------------------------------------------------------------
# Not yet tested with NT
#
#!ifndef FINAL
#FINAL=0
#!endif

#INC=/I$(HYPINC) /I$(WXDIR)\include\base /I$(WXDIR)\include\msw
#PRECOMP=/YuWX.H

#!if "$(FINAL)" == "0"
#OPT=/Od
#CPPFLAGS= /AL /W3 /Zi /G2sw $(OPT) $(PRECOMP) /Dwx_msw $(INC) /Fp$(WXDIR)\src\msw\wx.pch
#CFLAGS= /AL /W3 /Zi /G2sw /Od /Dwx_msw
#LINKFLAGS=/NOD /CO /ONERROR:NOEXE
#!else
#OPT=/Ox
#CPPFLAGS= /AL /W3 /G2sw $(OPT) $(PRECOMP) /Dwx_msw $(INC) /Fp$(WXDIR)\src\msw\wx.pch
#CFLAGS= /AL /W3 /Od /G2sw /Dwx_msw
#LINKFLAGS=/NOD /ONERROR:NOEXE
#!endif
#---------------------------------------------------------------------

all:    hytext wxhelp.exe

compact:
        -wrun clean

hytext:
        cd $(HYPDIR)\src
        nmake -f makefile.nt $(HYPLIB) FINAL=$(FINAL) OPT=$(OPT) PRECOMP=$(PRECOMP)
        cd $(WXHELPDIR)\src

wx:
        cd $(WXDIR)\src
        nmake -f makefile.nt $(WXLIB) FINAL=$(FINAL) OPT=$(OPT) PRECOMP=$(PRECOMP)
        cd $(WXHELPDIR)\src

wxhelp.obj: wxhelp.cc wxhelp.h $(HYPINC)\hytext.h
	$(cc) @<<
$(ALLFLAGS) $(INC) /c /Tp $*.cc
<<

wxhelp.res :      wxhelp.rc $(WXDIR)\include\msw\wx.rc
    $(rc) -r /i$(WXDIR)\include\msw -fowxhelp.tmp wxhelp.rc
    $(cvtres) -$(CPU) -o wxhelp.res wxhelp.tmp
    del wxhelp.tmp

#
# NT exe
#
wxhelp.exe:      $(WXDIR)\src\msw\dummy.obj $(WXLIB) wxhelp.obj wxhelp.res $(HYLIB)
	$(link) @<<
-out:wxhelp.exe
-machine:$(CPU)
-subsystem:windows
$(LINKFLAGS)
$(WXDIR)\src\msw\dummy.obj wxhelp.obj wxhelp.res
$(WXLIB) $(HYPLIB)
shell32.lib $(guilibs)
<<

# Tests out calling wxhelp.exe from an application
test.obj: test.cc
	$(cc) @<<
$(ALLFLAGS) $(INC) /c /Tp $*.cc
<<

test.res :      test.rc $(WXDIR)\include\msw\wx.rc
    $(rc) -r /i$(WXDIR)\include\msw -fotest.tmp test.rc
    $(cvtres) -$(CPU) -o test.res test.tmp
    del test.tmp

#
# NT exe
#
test.exe:      $(WXDIR)\src\msw\dummy.obj $(WXLIB) test.obj test.res $(HYLIB)
	$(link) @<<
-out:test.exe
-machine:$(CPU)
-subsystem:windows
$(LINKFLAGS)
$(WXDIR)\src\msw\dummy.obj test.obj test.res
$(WXLIB) $(HYPLIB)
shell32.lib $(guilibs)
<<


clean:
        erase *.obj *.exe *.res

cleanall:	clean
