# *************************************************************************
# *                                                                       *
# *  Makefile for TOOLS                                                   *
# *                                                                       *
# *                                                                       *
# *  Copyright (c) 2007 School of Computer Science and Informatics,       *
# *                     University College Dublin, Ireland.               *
# *                                                                       *
# *  All rights reserved. We assume no responsibility for the use         *
# *  or reliability of our software.                                      *
# *                                                                       *
# *************************************************************************

include ../../HSLmake.inc
include ./TOOLSFILES.list

CC_INCLUDES	= 	-I$(MPCHOME)/h -I$(HMPI_HOME)/include -I$(HSCALAPACKHOME)/include

all: tools

tools: $(TOOLSFILES)

$(TOOLSFILES): $(FRC)
	$(MPICC) $(CFLAGS) $(CC_INCLUDES) -o $@ $@.c -L$(HSCALAPACKHOME)/lib -lhscaltest -lhscalapack -L$(LIBSCALAPACKDIR) $(LIBSSCALAPACK) -L$(LIBBLACSDIR) $(LIBSBLACS) -L$(LIBBLASDIR) $(LIBSBLAS) -L$(LIBF2CDIR) $(LIBSF2C) $(MPCHOME)/lib/mpctopo.o $(MPCHOME)/lib/mpcrts.o -L$(HMPI_HOME)/lib -lhmpi -lm

FRC:

clean:
	$(RM) *.o $(TOOLSFILES)

%.o: %.c
	$(CC) $(CFLAGS) $(CC_INCLUDES) -c $<
