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

#---| system |-----------------------------------------------------------------
#DB_DB2   = Y                          # enable this for use of DB2
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:     db2conv.exe monitor.exe showtab.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\libcli.dll
!endif

#--------| inference rules |---------------------------------------------------
.c.obj:
         $(CC) $(DEBUG) $(LIST) $(DEFS) $(CFLAGS) $*.c

#---| sample programs |--------------------------------------------------------
db2conv.obj:  db2conv.c
db2conv.exe:  db2conv.obj
         $(LN) $(DEBUG) $(LIST) $(LFLAGS) $*.exe $*.obj

monitor.obj:  monitor.c
monitor.exe:  monitor.obj
         $(LN) $(DEBUG) $(LIST) $(LFLAGS) $*.exe $*.obj $(L_LIBS)

showtab.obj:  showtab.c
showtab.exe:  showtab.obj
         $(LN) $(DEBUG) $(LIST) $(LFLAGS) $*.exe $*.obj $(L_LIBS)

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