# Makefile of ReLaTIve Utility Functions, with a locally installed GSL
# 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: change it if you know a different one in your envirmoment                     ###	
ifndef gslloc																							  
gslloc = ../GSL
endif
#############################################################################################################

ifndef gsldirinc
gsldirinc   = $(gslloc)/include
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 $(gslloc) $(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)

