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

include ..\site.OS2

OBJS     = debug.obj dirent.obj flock.obj mman.obj strlib.obj tmpnam.obj\
 ualarm.obj

all:    ..\..\lib\mSQL.lib dir_test.exe mm_test.exe
clean:
        @if exist *.obj del *.obj
delete: clean
        @if exist mm_test.exe del mm_test.exe
delete_all: delete
test:   dir_test.exe mm_test.exe test1
        dir_test
        mm_test 1>mm_test.out 2>>&1
        type mm_test.out | more

.c.obj:
        $(CC) $(CFLAGS) $*.c

debug.obj:    debug.c
dirent.obj:   dirent.c
#        $(CC) $(CFLAGS) /DDEBUG dirent.c
dir_test.obj: dir_test.c
flock.obj:    flock.c
mman.obj:     mman.c
#        $(CC) $(CFLAGS) /DDEBUG mman.c
mm_test.obj:  mm_test.c
strlib.obj:   strlib.c
tmpnam.obj:   tmpnam.c
        $(CC) $(CFLAGS) /DMSQL_HOME="\"$(INST_DIR)\"" tmpnam.c
ualarm.obj:   ualarm.c

..\..\lib\mSQL.lib: $(OBJS)
        $(RANLIB) $@ -+debug.obj -+dirent.obj -+flock.obj -+mman.obj\
 -+strlib.obj  -+tmpnam.obj -+ualarm.obj;
        @if exist $*.bak del $*.bak

dir_test.exe: dir_test.obj dirent.obj
        $(LINK) $(LFLAGS) dir_test.exe dirent.obj dir_test.obj

mm_test.exe: mm_test.obj mman.obj
        $(LINK) $(LFLAGS) mm_test.exe mman.obj mm_test.obj

test1:  mm_test.obj
        if exist mman.obj del mman.obj
        $(CC) $(CFLAGS) /DDEBUG mman.c
        $(LINK) $(LFLAGS) mm_test.exe mman.obj mm_test.obj
        if exist mman.obj del mman.obj

