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

WXDIR = $(WX)
THISDIR = $(WXDIR)\samples\ipc
WXLIB = $(WXDIR)\lib\wx.lib
#
# Not used
#
#LIBS=$(WXLIB) oldnames ddeml libw llibcew commdlg shell
INC=/I$(WXDIR)\include\base /I$(WXDIR)\include\msw

#---------------------------------------------------------------------
# Not yet tested with NT
#
#!ifndef FINAL
#FINAL=0
#!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 /G2sw /Ox /YuWX.H $(INC) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
#LINKFLAGS=/NOD /ONERROR:NOEXE
#!endif
#---------------------------------------------------------------------

CLIENT_HEADERS = client.h
CLIENT_SOURCES = client.cc
CLIENT_OBJECTS = client.obj
SERVER_HEADERS = server.h
SERVER_SOURCES = server.cc
SERVER_OBJECTS = server.obj

all:    client.exe server.exe

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

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

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


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

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

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


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

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

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