
ADLIB_HOME  = @HPF_HOME@

CC          = cc
CCC         = c++
F90         = f90
AR          = ar rcu
RANLIB      = ranlib

OPTFLAGS    = -g

ADLIB_INC_DIR = $(ADLIB_HOME)/include
ADLIB_INC     = $(ADLIB_INC_DIR)/Adlib.h
MPI_INC_DIR   = @MPI_INC_DIR@
MPI_INC       = $(MPIR_INC_DIR)/mpir.h

INCLUDE_DIR = -I$(MPI_INC_DIR) -I$(ADLIB_INC_DIR)
CFLAGS  = $(OPTFLAGS) $(INCLUDE_DIR)
CCFLAGS = $(CFLAGS)

OBJECTS = fadlib.o cadlib.o Cludge.o

$(ADLIB_HOME)/lib/libadapt.a : $(OBJECTS)
	$(AR) $@ $(OBJECTS)
	$(RANLIB) $@

fadlib.o : fadlib.c
	$(CC) $(CFLAGS) -c fadlib.c

cadlib.o : cadlib.cc $(ADLIB_INC)
	$(CCC) $(CCFLAGS) -c cadlib.cc

Cludge.o: Cludge.cc $(ADLIB_INC_DIR)/Cludge.h $(ADLIB_INC)
	$(CCC) $(CCFLAGS) -c Cludge.cc

clean:
	rm -f *.o

