CC = cc -std=c99
CFLAGS = -Wall -g -I$(PSLIB_DIR)/include

PSLIB_DIR = ../..

libUtils.a : array.o dlist.o hash.o logmsg.o memory.o misc.o trace.o
	ar r libUtils.a $?
	ranlib libUtils.a
#
# Test code
#
TST_PROGS = tst_array tst_dlist tst_hash tst_logmsg tst_memory tst_trace
test : $(TST_PROGS)
	for p in $(TST_PROGS); do \
		echo $$p; \
		$$p; \
	done
tst_array : libUtils.a tst_array.o
	$(CC) -o tst_array tst_array.o libUtils.a
tst_dlist : libUtils.a tst_dlist.o
	$(CC) -o tst_dlist tst_dlist.o libUtils.a
tst_hash : libUtils.a tst_hash.o
	$(CC) -o tst_hash tst_hash.o libUtils.a
tst_logmsg : libUtils.a tst_logmsg.o
	$(CC) -o tst_logmsg tst_logmsg.o libUtils.a
tst_memory : libUtils.a tst_memory.o
	$(CC) -o tst_memory tst_memory.o libUtils.a
tst_trace : libUtils.a tst_trace.o
	$(CC) -o tst_trace tst_trace.o libUtils.a
#
#
_tags :;
tags : _tags
	etags *.[ch]
#
clean :
	$(RM) $(TST_PROGS) *.o *.a *.log *.dvi *.aux *.toc *.log *.out *~ core TAGS
empty : clean
