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

#---| system |-----------------------------------------------------------------
#DEBUG    = Y                          # enable this for debugging
#LIST     = Y                          # enable this for compiler listing

#---| includes |---------------------------------------------------------------
include ..\Config.mk
include ..\Version.mk

#---| compiler and linker |----------------------------------------------------
#CC       = icc
LN       = $(CC)

!ifdef VACPP
CFLAGS   = /c /DVERSION="\"$(VERSION)$(EXTVER)\"" /Gm /O /Ol /Q /Se /Ss+
LFLAGS   = /Gm /O /Ol /Q /Fe
!else
CFLAGS   = /c /DVERSION="\"$(VERSION)$(EXTVER)\"" /Gm /Q /Se /Ss+
LFLAGS   = /Gm /Q /Fe
!endif

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

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

#---| libraries |--------------------------------------------------------------
#
# iODBC is disabled 'til it's working!!!
#
#!ifdef iODBC
!ifdef XXXXXXXXXX
DEFS    = /D$(DBENV) /D$(ODBC) /D$(OS) /I..\..\include
L_LIBS  = ..\..\lib\iodbc.lib
!else
!  ifdef DB2
DEFS    = /D$(DBENV) /D$(OS)
L_LIBS  = $(DB2PATH)\lib\db2cli.lib
!  endif
!  ifdef mSQL
DEFS    = /D$(DBENV) /D$(OS) /I..\..\include
L_LIBS  = ..\..\lib\cli_dll.lib
!  endif
!endif

#---| common parts |-----------------------------------------------------------
all:     db2conv.exe monitor.exe showtab.exe clean
clean:
         @if exist *.lst del *.lst
         @if exist *.obj del *.obj
delete:  clean
         @if exist *.dll del *.dll
         @if exist *.exe del *.exe
delete_all: delete

#--------| 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 |============================================================
