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


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)


	




