# 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 : mSQLrexp.lib try.exe

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

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

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

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

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

timer.exe: timer.c mSQLrexp.lib
        $(CC) $(CC_FLAGS) timer.c
        $(LINK) $(LFLAGS) timer.exe timer.obj mSQLrexp.lib

try.exe: try.c mSQLrexp.lib
        $(CC) $(CC_FLAGS) try.c
        $(LINK) $(LFLAGS) try.exe try.obj mSQLrexp.lib

