
ADLIB_HOME  = @HPF_HOME@

CCC         = c++
CCLINKER    = $(CCC)
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@

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

THREADS_INC      = $(ADLIB_INC_DIR)/Threads.h
PROCTREE_INC     = $(ADLIB_INC_DIR)/ProcTree.h $(ADLIB_INC_DIR)/Tags.h $(THREADS_INC)
DATAEXCHANGE_INC = $(ADLIB_INC_DIR)/DataExchange.h $(PROCTREE_INC)
PROCS_INC        = $(ADLIB_INC_DIR)/Procs.h $(PROCTREE_INC) $(ADLIB_INC_DIR)/Seq.h
RANGE_INC        = $(ADLIB_INC_DIR)/Range.h $(PROCS_INC)
ARRAY_INC        = $(ADLIB_INC_DIR)/Array.h $(RANGE_INC)
REDUCE_INC       = $(ADLIB_INC_DIR)/reduce.h $(ARRAY_INC)
REMAP_INC        = $(ADLIB_INC_DIR)/remap.h $(ARRAY_INC) $(ADLIB_INC_DIR)/DataExchange.h

OBJECTS = remap.o reduce.o Array.o Range.o Procs.o mapVirtuals.o DataExchange.o ProcTree.o Threads.o

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

remap.o: remap.cc $(REMAP_INC)
	$(CCC) $(CCFLAGS) -c remap.cc

reduce.o: reduce.cc $(REDUCE_INC)
	$(CCC) $(CCFLAGS) -c reduce.cc

Array.o: Array.cc $(ARRAY_INC)
	$(CCC) $(CCFLAGS) -c Array.cc

Range.o: Range.cc $(RANGE_INC)
	$(CCC) $(CCFLAGS) -c Range.cc

Procs.o: Procs.cc $(PROCS_INC)
	$(CCC) $(CCFLAGS) -c Procs.cc

mapVirtuals.o: mapVirtuals.cc
	$(CCC) $(CCFLAGS) -c mapVirtuals.cc

DataExchange.o: DataExchange.cc $(DATAEXCHANGE_INC)
	$(CCC) $(CCFLAGS) -c DataExchange.cc

ProcTree.o: ProcTree.cc $(PROCTREE_INC)
	$(CCC) $(CCFLAGS) -c ProcTree.cc

Threads.o: Threads.cc $(THREADS_INC)
	$(CCC) $(CCFLAGS) -c Threads.cc

clean:
	rm -f *.o


