# VisualAge for Smalltalk Enterprise V5
#
# Win32 makefile to compile and link sample user primitives
# (Assumes using VisualAge C++ 3.5)

PLATFORM   = WIN32

BUILDDIR   = ..
ESINCLDIR  = $(BUILDDIR)\esincl
ESLIBDIR   = $(BUILDDIR)\eslib
SOURCEDIR  = $(BUILDDIR)\primitiv

CC         = icc
LINK       = icc
RC         = irc
RM         = del

# CPPFLAGS:            C preprocessor flags
#
#       /D$(PLATFORM)  Setup ES .h files for Win32
#       /I$(ESINCLDIR) ES .h files
#
CPPFLAGS   = /D$(PLATFORM) /I$(ESINCLDIR)

# CFLAGS:              C compiler flags
#
#       /C             Compile only
#       /Fo$@          Name the object file
#       /Ge-           Build a DLL
#	/qtune=blend   Optimize for Pentium-class machines
#       /Ti+           Keep compile debug information
#
CFLAGS       = /C /Fo$@ /Ge- /qtune=blend


# LFLAGS:              Linker flags
#
#       /Fe$@          Name the executable file
#       /Ge-           Build a DLL
#       /Gm+           Link with the multithread libraries
#       /Ti+           Keep executable debug information
#
LFLAGS       = /Fe$@ /Ge- /Gm+

!IFDEF DEBUG
CFLAGS       = $(CFLAGS) /Ti+
LFLAGS       = $(LFLAGS) /Ti+
!ENDIF

# LIBS:
#
ESLIBS     = $(ESLIBDIR)\esvm.lib $(ESLIBDIR)\esvmexe.lib

#Inference rules
{$(SOURCEDIR)}.c.obj:
	$(CC) $(CPPFLAGS) $(CFLAGS) $<
{$(SOURCEDIR)}.rc.res:
	$(RC) -fo$@ $<

all: sample.dll

clean:
        - $(RM) *.exp
        - $(RM) *.lib
        - $(RM) *.obj
        - $(RM) *.rbj
	- $(RM) *.res
        - $(RM) *.dll

sample.dll: sample.obj sample.res sample.def
        $(LINK) $** $(ESLIBS) $(LFLAGS)
