
# Makefile configuration
include 	../../Make.conf

# Headers to be included in _each_ .o's dependencies
HEADERS		= ../debug.h ../ringbuf.h ../textfile.h ../subprocs.h
HEADERS	       += ../metadata.h ../metatype.h ../metaops.h ../metadict.h
HEADERS	       += ../md5.h ../misc.h ../constants.h
OBJECTS		= ringtest.o texttest.o metatest.o metamsgtest.o newproctest.o
LIBS		= ../common.a
TARGETS		= ringtest texttest metatest metamsgtest newproctest

# Add common directory to include path
CFLAGS		+= -I..


# To prevent Make from being satisfied after the first target
all:		$(TARGETS)


# The objects
ringtest.o:	ringtest.c $(HEADERS)
		$(CC) $(CFLAGS) -o $@ -c $<

texttest.o:	texttest.c $(HEADERS)
		$(CC) $(CFLAGS) -o $@ -c $<

metatest.o:	metatest.c $(HEADERS)
		$(CC) $(CFLAGS) -o $@ -c $<

metamsgtest.o:	metamsgtest.c $(HEADERS)
		$(CC) $(CFLAGS) -o $@ -c $<

newproctest.o:	newproctest.c $(HEADERS)
		$(CC) $(CFLAGS) -o $@ -c $<

# The targets
ringtest:	ringtest.o $(LIBS)
		$(CC) $(LDFLAGS) -o $@ ringtest.o $(LIBS)

texttest:	texttest.o $(LIBS)
		$(CC) $(LDFLAGS) -o $@ texttest.o $(LIBS)

metatest:	metatest.o $(LIBS)
		$(CC) $(LDFLAGS) -o $@ metatest.o $(LIBS)

metamsgtest:	metamsgtest.o $(LIBS)
		$(CC) $(LDFLAGS) -o $@ metamsgtest.o $(LIBS)

newproctest:	newproctest.o $(LIBS)
		$(CC) $(LDFLAGS) -o $@ newproctest.o $(LIBS)

# Clean
clean:
		rm -f $(OBJECTS) $(TARGETS) core

