# Makefile to create a Laplace Transforms Database, 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

ifndef utildir
utildir  =  ../utility
endif

ifndef incdir 
incdir  = $(utildir)
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 gsldirlib
gsldirlib = $(gslloc)/lib
endif

ifndef CFLAGS
CFLAGS 	= -Wall -ansi -pedantic 
endif

ifndef RM
RM     = rm -f
endif


OBJ	= dbInvLaplace.o dbLaplace.o
BIN	= libdatabase.a

all: $(BIN) 
	
dbInvLaplace.o: dbInvLaplace.c dbL.h $(utildir)/Util.h $(RELdir)/ReLaTIve.h
	@$(CC) $(CFLAGS) -I$(gsldirinc) -I$(utildir) -I$(RELdir) -c dbInvLaplace.c 
	
dbLaplace.o: dbLaplace.c dbL.h $(utildir)/Util.h $(RELdir)/ReLaTIve.h
	@$(CC) $(CFLAGS) -I$(gsldirinc) -I$(utildir) -I$(RELdir) -c dbLaplace.c 

$(BIN): $(OBJ)
	@echo "ReLaTIve: compiling functions database..."
	@ar qc $(BIN) $(OBJ)
	@${RM} $(OBJ)
	
clean: 
	@echo "ReLaTIve: deleting the built database file..."
	@${RM} $(BIN)
	




