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

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

# System-specific settings

# LINKFORT/FORTLIB settings can be removed if not using meam or reax packages
# LINKBLAS/BLASLIB settings can be removed if not using user-atc package
# LINKGPU/GPULIB settings can be removed if not using gpu package

include		Makefile.package

CC =		mpCC_r
CCFLAGS =	$(PKGINC) -O4 -qnoipa -I/usr/apps/include -DFFT_FFTW
DEPFLAGS =	-M
LINK =		mpCC_r
LINKFORT =	
LINKBLAS =	
LINKGPU =	
LINKFLAGS =	$(PKGPATH) $(LINKFORT) $(LINKBLAS) $(LINKGPU)
USRLIB =	$(PKGLIB) -lfftw
FORTLIB =	
BLASLIB =	
GPULIB =	
SYSLIB =	$(FORTLIB) $(BLASLIB) $(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)