#==============================================================================
# Makefile
#
# OS/2 Makefile for use with IBM C/C++ Set/2 to build the CLI for mSQL
#
# (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     = mk_syslevel
DEST     = ..
OBJECTS  = mk_syslevel.obj main.obj

#---| 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_MODE
DEBUG   = /DEBUG /Ti+                  # debugging enabled
!endif

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

#---| definitions and libraries |----------------------------------------------
DEFS     =
LIBS     =

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

#---| global dependencies |----------------------------------------------------
all:     ..\$(NAME).exe install
clean:
         @if exist *.lst       del *.lst
         @if exist *.obj       del *.obj
delete:  clean
         @if exist *.def       del *.def
delete_all: delete
         @if exist $(DEST)\$(NAME).exe del $(DEST)\$(NAME).exe

#---| local dependencies |-----------------------------------------------------
$(DEST)\$(NAME).exe: $(OBJECTS)
         $(LN) $(DEBUG) $(LIST) $(LFLAGS) $*.exe $(OBJECTS) $(LIBS)

install: $(DEST)\$(NAME).exe
        $(DEST)\$(NAME).exe ..\..\syslevel.odb

test:  $(DEST)\$(NAME).exe
        $(DEST)\$(NAME) syslevel.tst
        syslevel
        del syslevel.tst

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