CFLAGS = $(CCOPTS) $(DEFS) -I$(srcdir)/../des

##DOSBUILDTOP = ..\..\..
##DOSLIBNAME=..\crypto.lib
##DOS!include $(BUILDTOP)\config\windows.in

.c.o:
	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
@SHARED_RULE@

OBJS=	md5.$(OBJEXT) md5glue.$(OBJEXT) md5crypto.$(OBJEXT)

SRCS=	$(srcdir)/md5.c $(srcdir)/md5glue.c $(srcdir)/md5crypto.c

all:: all-$(WHAT) $(OBJS) 

all-unix:: shared
all-mac:: shared
all-windows::

shared:
	mkdir shared

t_mddriver: t_mddriver.o md5.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o t_mddriver t_mddriver.o md5.o

t_mddriver.exe:
	$(CC) $(CFLAGS2) -o t_mddriver.exe t_mddriver.c md5.c

t_cksum: t_cksum.o $(TOPLIBD)/libcrypto.a
	$(CC) $(CFLAGS) -o t_cksum t_cksum.o $(TOPLIBD)/libcrypto.a $(LIBS)

check-unix:: t_mddriver t_cksum
	$(C)t_mddriver -x
	$(C)t_cksum "this is a test"

check-windows:: t_mddriver$(EXEEXT)
	$(C)t_mddriver$(EXEEXT) -x

check:: check-$(WHAT)

clean:: clean-$(WHAT)
	$(RM) t_mddriver$(EXEEXT) t_mddriver.$(OBJEXT)
	$(RM) t_cksum$(EXEEXT) t_cksum.$(OBJEXT)

clean-unix::
	$(RM) shared/*
clean-mac::
	$(RM) shared/*
clean-windows::
