# Makefile of ReLaTIve Utility Functions
# Version 1.0

#***********************************************************************
#   Authors:                                                            
#       	Luisa D'Amore - University of Naples, Federico II	           
#		Rosanna Campagna - University of Naples, Federico II	        
#		Valeria Mele - University of Naples, Federico II	            
#		Almerico Murli - SPACI - NAPLES                   	            
# 		Mariarosaria Rizzardi - University of Naples, Parthenope        
#************************************************************************


ifneq ($(CC),gcc)
CC     = gcc
endif

ifndef rootdir 
rootdir  = ../..
endif

ifndef RELdir
RELdir  =  $(rootdir)/SRC
endif


## CHECK
#############################################################################################################
### GSL building directory:                                                                               ###	
ifndef gsllib																							  
gsllib=/usr/local
endif
#############################################################################################################
### change them if you know that they are different in your envirmoment                                   ###

# GSL include directory #
ifndef gsldirinc
gsldirinc   = $(gsllib)/include
endif

# GSL libraries directory #
ifndef gsldirlib
gsldirlib = $(gsllib)/lib
endif

#############################################################################################################


ifndef CFLAGS
CFLAGS 	= -Wall -ansi -pedantic 
endif

ifndef RM
RM     = rm -f
endif

OBJU	= Util.o 
BINU	= libutil.a



all: $(BINU)
	
Util.o: Util.c Util.h $(gsldirinc)/gsl/ $(RELdir)/ReLaTIve.h
	@echo "ReLaTIve: compiling utility functions..."
	@$(CC) $(CFLAGS) -I$(gsldirinc) -I$(RELdir) -c Util.c

$(BINU): $(OBJU)
	@echo "ReLaTIve: creating utility library..."
	@ar qc $(BINU) $(OBJU)
	@${RM} $(OBJU) 
	
clean: 
	@echo "ReLaTIve: deleting built utility files..."
	@${RM} $(BINU)

