################################################################################
##
##  Makefile:   test/collections
##
##  $Revision: 1.10 $  $Name: not supported by cvs2svn $
##  $Date: 2004-06-04 23:49:14 $
##
##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
##
###############################################################################

include ../../src/Makefile.Globals

PSLIB_INCL_DIR = ../../include

PSLIB_LIB_DIR = ../../lib

TARGET = tst_psVector_01 \
         tst_psVector_02 \
         tst_psVector_03 \
         tst_psBitSet_01 \
         tst_psBitSet_02 \
         tst_psBitSet_03 \
         tst_psBitSet_04 \
         tst_psBitSet_05 \
         tst_psBitSet_06 \
         tst_psSort_01   \
         tst_psSort_02   \
         tst_psSort_03   \
         tst_psSort_04   \
         tst_psImage     \
         tst_psDlist

OBJS = $(addsuffix .o,$(TARGET))

all: $(TARGET)

include $(OBJS:.o=.d)

clean:
	@echo "    Deleting executable and binary files for 'test/collections'"
	$(RM) $(TARGET) *.o *.lint *.i *.d

%.o : %.i
	$(CC) $(CFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $<

%.o : %.c
	$(CC) $(CFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $<

%   : %.o
	$(CC) -o $@ $< -L$(PSLIB_LIB_DIR) -lpslib -lpstest $(LDFLAGS)

%.lint: %.c
	splint +posixlib -exportlocal -realcompare $(INCLUDE_GLOBAL) $? > $@; cat $@

%.i: %.c
	$(CC) -E $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -o $@ $<

%.d: %.c
	$(CC) -M $(CFLAGS) -I$(PSLIB_INCL_DIR) $< > $@.tmp
	sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' $@.tmp > $@
	$(RM) -f $@.tmp

