# Makefile
#
# Makefile for the ODBC sample(s)
#
# (c) 1997 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 |--------------------------------------------------------------
!ifdef ODBC
DEFS    = /D$(ODBC) /D$(OS) /I..\include
L_LIBS  = ..\lib\$(ODBC_FILE).lib
!else
!  ifdef mSQL2
DEFS    = /DmSQL2 /D$(OS) /I..\include
L_LIBS  = ..\lib\libmsql2.lib
!  else
DEFS    = /DmSQL2 /D$(OS) /I..\include
L_LIBS  = ..\lib\libmsql.lib
!  endif
!endif

#---| common parts |-----------------------------------------------------------
all:     monitor.exe showtab.exe clean
#!ifdef ODBC
#         @copy /b ..\lib\$(ODBC_FILE).dll .
#         @copy /b ..\lib\$(ODBC_INI) .
#!endif
clean:
         @if exist *.lst del *.lst
         @if exist *.obj del *.obj
delete:  clean
#!ifdef ODBC
#         @if exist $(ODBC_FILE).dll del $(ODBC_FILE).dll
#         @if exist $(ODBC_INI) del $(ODBC_INI)
#!endif
         @if exist *.dll del *.dll
delete_all: delete
         @if exist *.exe del *.exe

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

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