# ************************************************************************
# *                                                                      *
# *   Makefile for compiling and linking a set of executables for        *
# *   computation of slanted path delay.                                 *
# *                                                                      *
# ************************************************************************
.SUFFIXES:
.SUFFIXES:	.f	.c	.o	.opt_o	.a	.d
SHELL = /bin/csh -f -c 'umask 0022; eval "$2"'

.c.o:
	$(SPC_C) -c -o $*.o $*.c

.f.o:
	$(SPC_F95) $(SPC_OPENMP) -I$(SPC_ROOT)/include -I$(PETOOLS_ROOT)/include -D SPC -c -o $*.o $*.f

.f.opt_o:
	$(SPC_F95_OPT)   $(SPC_OPENMP) -I$(SPC_ROOT)/include -I$(PETOOLS_ROOT)/include -D SPC -c -o $*.opt_o $*.f

OBJ =   \
	read_spd_cli_dat.o

OBJ1 =  \
	spd_cli_example_fortran.o

OBJ2 =  \
	spd_cli_example_c.o

LIB = libspc
SPC_LIB   = $(SPC_ROOT)/lib/$(LIB).a

LIBS =				\
	$(SPC_LIB) 		\
	$(SPC_PETOOLS_LIB) 	\
	$(SPC_LAPACK_LIB) 	\
	$(SPC_LDFLAGS) 

all:	spc_exa_for spc_exa_c


spc_exa_for: 	$(OBJ1) $(OBJ)
	$(SPC_LINK) -o $(SPC_ROOT)/bin/spd_cli_example_fortran $(OBJ1) $(OBJ) $(LIBS) 

spc_exa_c: 	$(OBJ2) $(OBJ)
	$(SPC_LINK) -o $(SPC_ROOT)/bin/spd_cli_example_c $(OBJ2) $(OBJ) $(LIBS) 


clean:
	rm -f \
		$(SPC_ROOT)/bin/spd_cli_example_fortran \
		$(SPC_ROOT)/bin/spd_cli_example_c       \
	        $(OBJ)  				\
	        $(OBJ1) 				\
	        $(OBJ2)
