SHELL = /bin/sh

# which file will be copied to Makefile.lammps

EXTRAMAKE = Makefile.lammps.installed

# ------ FILES ------

SRC = \
    ivutils/src/logexc.cpp \
    systems/interact/TCP/wpmd.cpp \
    systems/interact/TCP/wpmd_split.cpp

INC = \
    cerf.h \
    cerf2.h \
    cerf_octave.h \
    cvector_3.h \
    lapack_inter.h \
    logexc.h \
    pairhash.h \
    refobj.h \
    tcpdefs.h \
    vector_3.h \
    wavepacket.h \
    wpmd.h \
    wpmd_split.h

# ------ DEFINITIONS ------

LIB = libawpmd.a
OBJ =   $(SRC:.cpp=.o)

# ------ SETTINGS ------

# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with

CC =	    mpic++ 
CCFLAGS = -O -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include
ARCHIVE =	ar
ARCHFLAG =	-rc
DEPFLAGS =  -M
#LINK =         
#LINKFLAGS =	
USRLIB =
SYSLIB =

# ------ MAKE PROCEDURE ------

lib: 	$(OBJ)
	$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
	@cp $(EXTRAMAKE) Makefile.lammps

# ------ COMPILE RULES ------

%.o:%.cpp
	$(CC) $(CCFLAGS) -c $< -o $@
%.d:%.cpp
	$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@		

# ------ DEPENDENCIES ------

DEPENDS = $(OBJ:.o=.d)

# ------ CLEAN ------

clean:
	-rm *.d *~ $(OBJ) $(LIB)
