#==============================================================================
# Makefile
#
# OS/2 Makefile to build the Oracle ODBC driver
#
# (c) 1997 by Dirk Ohme - all rights reserved
#==============================================================================
# includes
#==============================================================================
include ..\..\Config.mk
include ..\..\Version.mk
#==============================================================================
# Site specific configuration (OS/2) -> normally set by autoconf (Config.mk)
#==============================================================================
## [BEGIN]
#
# option switches
# (do not remove the lines starting with "##" !!!)
#
# debug mode: select this to enable debugging of the software
##-DEBUG_MODE=Y
#
# list mode: select this (and DEBUG_MODE) to create a list file of each *.c
##-LIST_MODE=Y
#
## [END]
#==============================================================================

#---| definitions |------------------------------------------------------------
NAME     = libora
OBJECTS  = catalog.obj cli.obj connect.obj dll.obj execute.obj info.obj\
 log.obj options.obj prepare.obj results.obj transact.obj

#---| compiler |---------------------------------------------------------------
CC       = icc
!ifndef BCPP
!  ifdef VACPP
CFLAGS   = /c /DOS2 /G5 /Gd- /Ge- /Gf /Gi /Gm /Gs- /I.\
/I..\..\include /I$(ORA_INCL) /O /Ol /Q /Se /Ss+ /W1
!  else
CFLAGS   = /c /DOS2 /G4 /Gd- /Ge- /Gf /Gi /Gm /Gs- /I.\
/I..\..\include /I$(ORA_INCL) /Q /Se /Ss+
!  endif
!else
CFLAGS   = /c /DOS2 /DBCPP /I. /I..\..\include /I$(ORA_INCL)
!endif

CEXTRA   = /DVERSION="\"$(VERSION)$(EXTVER)\""

RC       = rc
RC_1st   = rc -r

#---| linker |-----------------------------------------------------------------
!ifdef VACPP
LN       = ilink
LFLAGS   = /nofree /dll /e /noi /nol /packc /packd /pm:PM /se:1024 /st:32768
LN_END   =
!else
LN       = link386
LFLAGS   = /noi /nol /pm:PM /se:1024 /st:32768
LN_END   = ;
!endif

#---| libraries |--------------------------------------------------------------
LIBS     = $(ORA_LIBS)

#---| debugging |--------------------------------------------------------------
!ifdef DEBUG_MODE
!  ifdef LIST_MODE
DEBUG    = /DDEBUG /Le /Ls /Ti+
LDEBUG   = /deb
!  else
DEBUG    = /DDEBUG /Ti+
LDEBUG   = /deb
!  endif
!else
DEBUG    =
LDEBUG   =
!endif

#---| library tool |-----------------------------------------------------------
!ifdef VACPP
AR       = ilib
!else
AR       = lib
!endif
ARFLAGS  = /noe /noi /nol
IMPLIB   = implib
IFLAGS   = /nol

#---| dependencies |-----------------------------------------------------------
.c.obj:
         $(CC) /DORACLE $(DEBUG) $(CFLAGS) $(CEXTRA) $*.c

#---| global dependencies |----------------------------------------------------
all:     $(NAME).DLL
clean:
         @if exist *.lst       del *.lst
         @if exist *.obj       del *.obj
         @if exist *.res       del *.res
delete:  clean
         @if exist *.def       del *.def
         @if exist *.dll       del *.dll
delete_all: delete

#---| local dependencies |-----------------------------------------------------
$(NAME).DLL: $(OBJECTS) $(NAME).res $(NAME).def
         $(LN) $(LFLAGS) $(LDEBUG) $(OBJECTS), $(NAME).dll, nul,\
$(LIBS), $(NAME).def $(LN_END)
         $(RC) $(NAME).res $(NAME).dll
         @if exist ..\..\lib\$(NAME).dll del ..\..\lib\$(NAME).dll
         @copy $(NAME).dll ..\..\lib /b
#         $(IMPLIB) $(IFLAGS) ..\..\LIB\$(NAME).lib $(NAME).def

log.obj: ..\SRC_LOG\log.c ..\SRC_LOG\log.h
         $(CC) /DORACLE $(DEBUG) $(CFLAGS) $(CEXTRA) -I..\SRC_LOG\
 ..\SRC_LOG\log.c

$(NAME).def: ..\..\lib\odbc.def
        @echo ; $(NAME).def                      >  $(NAME).def
        @echo LIBRARY LIBORA                     >> $(NAME).def
        @echo DESCRIPTION 'Oracle 7.x iODBC driver - (c) 1997 by Dirk Ohme'\
 >> $(NAME).def
        @type ..\..\lib\odbc.def | find " ORA" >> $(NAME).def

$(NAME).res: $(NAME).rc dll.h
         $(RC_1st) $(NAME)

#==============================================================================
