# Makefile
#
# Makefile for the ODBC sample(s)
#
# (c) 1996 by Dirk Ohme, all rights reserved

#---| system |-----------------------------------------------------------------
#DB_DB2   = Y                          # enable this for use of mSQL
DB_MSQL  = Y                          # enable this for use of mSQL

#DEBUG    = Y                          # enable this for debugging
#LIST     = Y                          # enable this for compiler listing
#STATIC   = Y                          # enable this for static linkage

#---| compiler and linker |----------------------------------------------------
CC       = icc
CFLAGS   = /c /Gm /Q /Se /Ss+

LN       = icc
LFLAGS   = /Gm /Q /Fe

!ifdef DEBUG
DEBUG   = /DEBUG /Ti+                  # debugging enabled
!endif

!ifdef LIST
LIST     = /Le /Ls                     # create list files
!endif

#---| libraries |--------------------------------------------------------------
!ifdef DB_DB2
DEFS    = /DDB2                       # enable this for use with DB2
L_LIBS  = $(DB2PATH)\lib\db2cli.lib   #   dito
!endif

!ifdef DB_MSQL
DEFS    = /DmSQL /DOS2 /I..\include   # enable this for use with mSQL
!  ifdef STATIC
L_LIBS  = ..\lib\cli.lib              #   dito, static linkage
!  else
L_LIBS  = ..\lib\cli_dll.lib          #   dito, dynamic linkage
!  endif
!endif

#---| common parts |-----------------------------------------------------------
all:     monitor.exe update
clean:
         @if exist *.lst del *.lst
         @if exist *.obj del *.obj
delete:  clean
         @if exist *.dll del *.dll
         @if exist *.exe del *.exe
update:
!ifdef DB_MSQL
         copy /b ..\lib\cli.dll
!endif

#---| sample 'monitor' |-------------------------------------------------------
monitor.exe:  monitor.obj
         $(LN) $(DEBUG) $(LIST) $(LFLAGS) monitor.exe monitor.obj $(L_LIBS)
monitor.obj:  monitor.c
         $(CC) $(DEBUG) $(LIST) $(DEFS) $(CFLAGS) monitor.c

#===| end of file |============================================================
