#
# 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 hello example (DOS).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info

# Set WXDIR for your system
WXDIR = $(WX)
THISDIR = $(WXDIR)\samples\hello
WXLIB = $(WXDIR)\lib\wx.lib
#
# Not used
#
#LIBS=$(WXLIB) oldnames libw llibcew commdlg shell
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
DUMMY=$(WXDIR)\src\msw\dummy.obj

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

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

HEADERS = hello.h
SOURCES = hello.cc
OBJECTS = hello.obj

hello:    hello.exe

all:    wx hello.exe

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

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

#
# Obsol.
#
#hello.exe:      $(DUMMY) $(WXLIB) hello.obj hello.def hello.res
#        link $(LINKFLAGS) @<<
#$(DUMMY) hello.obj,
#hello,
#NUL,
#$(LIBS),
#hello.def
#;
#<<
#        rc -30 -K hello.res
#
# NT exe
#
hello.exe:      $(WXDIR)\src\msw\dummy.obj $(WXLIB) hello.obj hello.res
	$(link) @<<
-out:hello.exe
-machine:$(CPU)
-subsystem:windows
$(LINKFLAGS)
$(WXDIR)\src\msw\dummy.obj hello.obj hello.res
$(WXLIB)
shell32.lib $(guilibs)
<<


hello.obj:      hello.h hello.cc $(DUMMY)
        $(cc) @<<
$(ALLFLAGS) $(INC) /c /Tp $*.cc
<<

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


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