# cheetah = ORNL IBM machine, mpCC, native MPI, FFTW

SHELL = /bin/sh
.SUFFIXES: .cpp .u
.IGNORE:

# System-specific settings

# LINKFORT & FORTLIB settings can be blank if not using LAMMPS Fortran libs
# LINKGPU & GPULIB settings can be blank if not using LAMMPS gpu lib

include		Makefile.package

CC =		mpCC_r
CCFLAGS =	$(PKGINC) -O4 -qnoipa -I/usr/apps/include -DFFT_FFTW
DEPFLAGS =	-M
LINK =		mpCC_r
LINKFORT =	
LINKGPU =	
LINKFLAGS =	$(PKGPATH) $(LINKFORT) -O -L/usr/apps/lib $(LINKGPU)
USRLIB =	$(PKGLIB) -lfftw
FORTLIB =	
GPULIB =	
SYSLIB =	$(FORTLIB) -lm $(GPULIB)
SIZE =		size

# Link rule

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

# --------- old section -------------

# Compilation rules

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

# Individual dependencies

#$(OBJ):	     $(INC)

# --------- new section -------------

# Compilation rules

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

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

# Individual dependencies

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