# Makefile for use with IBM C/C++ Set/2

include ..\site.mm

#
# This makegen template is grafted from the original Makefile (also
# included in this directory).  Look there for further porting hints
#


# Things you might want to put in LENV:
# -Dvoid=int            compilers that don't do void
# -DCHARBITS=0377       compilers that don't do unsigned char
# -DSTATIC=extern       compilers that don't like "static foo();" as forward dec
# -DSTRCSPN             library does not have strcspn()
# -Dstrchr=index        library does not have strchr()

#LENV=-Dvoid=int -DCHARBITS=0377
LENV=

CC_FLAGS= $(CFLAGS) $(LENV) /I. $(U_INT)


#all : mSQLrexp.lib timer.exe try.exe
all : ..\..\lib\mSQL.lib try.exe

clean:
        @if exist *.obj del *.obj

delete: clean
        @if exist *.exe del *.exe

..\..\lib\mSQL.lib: regexp.obj regsub.obj
        $(RANLIB) $@ -+regexp.obj -+regsub.obj;
        @if exist $*.bak del $*.bak
        @if exist ..\..\include\regexp.h del ..\..\include\regexp.h
        copy /b regexp.h ..\..\include\regexp.h

regexp.obj: regexp.c
        $(CC) $(CC_FLAGS) regexp.c

regsub.obj: regsub.c
        $(CC) $(CC_FLAGS) regsub.c

timer.obj: timer.c
        $(CC) $(CC_FLAGS) timer.c

timer.exe: timer.obj ..\..\lib\mSQL.lib
        $(LINK) $(LFLAGS) timer.exe timer.obj ..\..\lib\mSQL.lib

try.obj: try.c
        $(CC) $(CC_FLAGS) try.c

try.exe: try.obj ..\..\lib\mSQL.lib
        $(LINK) $(LFLAGS) try.exe try.obj ..\..\lib\mSQL.lib

