
# Makefile configuration
include 	../Make.conf

OBJECTS		= debug.o ringbuf.o textfile.o subprocs.o md5.o misc.o
OBJECTS         += metadata.o metatype.o metadict.o metaops.o 
TARGET		= common.a

CFLAGS          += -I.


# All
all:		$(TARGET)

testprogs:	$(TARGET)
		cd test && $(MAKE)


# Target
$(TARGET):	$(OBJECTS)
		$(AR) rc $@ $(OBJECTS)
		$(RANLIB) $@


# Objects
debug.o:	debug.c debug.h misc.h metatype.h
		$(CC) $(CFLAGS) $(HAVE_VSNPRINTF) $(HAVE_SYSLOG) -o $@ -c $<

ringbuf.o:	ringbuf.h debug.h
textfile.o:	textfile.h ringbuf.h debug.h
subprocs.o:	subprocs.h ringbuf.h constants.h debug.h
metadata.o:	metadata.h debug.h
metatype.o:	metatype.h metadata.h debug.h
metadict.o:	metadict.h metatype.h metadata.h textfile.h ringbuf.h debug.h
metaops.o:	metaops.h metatype.h metadata.h constants.h debug.h
md5.o:		md5.h
misc.o:		misc.h debug.h


# Clean
clean:		
		rm -f $(OBJECTS) $(TARGET)
		cd test && $(MAKE) clean

