#
# Makefile
#

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

include $(CRYPTOTOP)/common.mk

# Input and output files for this subdirectory
LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c \
       aes_ctr.c aes_ige.c aes_wrap.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)/*.*
