# g++_meam = RedHat Linux box, g++, MPICH, FFTW, MEAM library

SHELL = /bin/sh
#.IGNORE:

# System-specific settings

CC =		g++
CCFLAGS =	-g -O -DFFT_FFTW -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK
DEPFLAGS =	-M
LINK =		g++
LINKFLAGS =	-g -O -L../../lib/meam -L/opt/intel/fce/10.0.023/lib
USRLIB =	-lfftw -lmpich -lmeam
SYSLIB =	-lpthread -lifcore -lsvml -lompstub -limf
ARCHIVE =	ar
ARFLAGS =	-rc
SIZE =		size

# Link target

$(EXE):	$(OBJ)
	$(LINK) $(LINKFLAGS) $(OBJ) $(USRLIB) $(SYSLIB) -o $(EXE)
	$(SIZE) $(EXE)

# Library target

lib:	$(OBJ)
	$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)

# Compilation rules

%.o:%.cpp
	$(CC) $(CCFLAGS) -c $<

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

# Individual dependencies

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