##########################################################################
#
#  Sample makefile for use with IBM C set ++ version 2.01.
#  Creates stub DLLs for DDTT.EXE.
#
#  Invoke this makefile using this command line:
#          nmake /f sample.mak TARGET=dllname
#  where dllname is the name of the DLL being created.
#
#  NOTES:   1. TARGET is case sensitive - must be capitals
#
#           2.  Two environment variables must be set,
#                 set INCLUDE=d:\ibmcpp\include;d:\ibmcpp\ibmclass;d:\toolkt21\cplus\os2h;
#                 set LIB=d:\ibmcpp\lib;d:\toolkt21\os2lib;
#
#           3. You must supply your own .DEF file.  This file just may be
#                  a simple one line file that says "LIBRARY" to tell the compiler
#                 a DLL is being built.
#
#           4.  Make sure that ddtlist.c and genlist.c are in the same
#                 directory as ddtlist.h and genlist.h.  You may want to insure
#                 that the compiler automatically links to ddtlist.obj and
#                 genlist.obj by using the /I link option and watching the link.
#                 These two headers contain template definition and thus
#                 require special linkage.
#
#           5.  Creating a stub requires several DDTT headers and DDTT.LIB.
#                 The variable DDTTROOT below must be customized to point
#                 to the path where these are found.
#
##########################################################################

CC = icc.exe
LINK = icc.exe
DDTTROOT = $(MAKEDIR)                   # directory containing DDTT.LIB

CFLAGS = /Ft+ /C+ /I$(INCLUDE) /Ti+ /Sp1 /Si+ /Fi+
LFLAGS = /Ft+ /Tdp /Ti+
DLLCFLAGS = $(CFLAGS) /Ge-
DLLLFLAGS = $(LFLAGS) /Ge- /Gd+ /B"/NOD /DE  /M  /PMTYPE:PM "

DLLLIBS = os2386.lib dde4mbsi.lib dde4cci.lib dde4muib.lib

.SUFFIXES:
.SUFFIXES:  .cpp .dll .lib .obj .def

ALL: $(TARGET).dll

$(TARGET).DLL: $(TARGET).OBJ $(DDTTROOT)\DDTT.LIB
  $(LINK) $(DLLLFLAGS) /Fe$(TARGET) $(TARGET).OBJ $(DLLLIBS) $(DDTTROOT)\DDTT.LIB $(TARGET).DEF
  dllrname $(TARGET).DLL dde4mbs=ddttmbs dde4cc=ddttcc

$(TARGET).OBJ: $(TARGET).CPP
  $(CC) $(DLLCFLAGS) $(TARGET).CPP
