#
# Makefile
#

TOPLEVEL=../../..
CRYPTOTOP=..
OBJDIRNAME = obj

include $(CRYPTOTOP)/common.mk

# Input and output files for this subdirectory
LIBSRC= bio_lib.c bio_cb.c bio_err.c \
	bss_mem.c bss_null.c bss_fd.c \
	bss_file.c bss_sock.c bss_conn.c \
	bf_null.c bf_buff.c b_print.c b_dump.c \
	bss_acpt.c bf_nbio.c bss_log.c bss_bio.c
LIB= $(LIBDIR)/libcrypto.a

#
# Where to put the output binaries from this build
#
OUTPUTDIR = $(LIBDIR)

# Search paths (none for this project)
VPATH =

.PHONY: dobuild all clean cleanobjs

all: dobuild $(LIB)

SOURCE_FILES = $(LIBSRC)

DEPENDS = $(patsubst %.c, $(OBJDIR)/%.d, $(SOURCE_FILES))

COBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(SOURCE_FILES))

OBJS = $(COBJS)

# Include the various dependancy files.
ifneq ($(MAKECMDGOALS), clean)
 ifneq ($(MAKECMDGOALS), cleanobjs)
  -include $(DEPENDS)
 endif # cleanobjs
endif # clean

$(LIB):	$(OBJS)
	$(AR) r $(LIB) $(OBJS)
	$(RANLIB) $(LIB) || echo Never mind.

clean: cleanobjs
	rm -f lib tags core .pure .nfs* *.old *.bak

cleanobjs:
	rm -f $(OBJDIR)/*.*
