Makefile in AIX

# Makefile for a parallel program on the SP2 using MPI.
#
# Note: This file is written for the gnu version of make, and it
# may not be compatible with other versions.
# Make configuration variables
SHELL = /bin/sh
VPATH = Object_MPI:Include:../bin

# Preprocessor variables
CPP = /usr/lib/cpp

# PRNG (Parallel Random Number Generator ) algorithm should be used for the parallel version.
# When using PRNG, LIBS should include the correct library.
CPPFLAGS = -P -DAIX -DSP2 -DMP -DMPI -DWPRNG

# Fortran compiler variables
FC = mpxlf
OPT = -O3 -g
FFLAGS = ${OPT} -qarch=pwr2 -qcheck -qsigtrap -IInclude \
-bmaxdata:500000000 -bmaxstack:500000000

# Linker/loader variables
LDFLAGS = -o mypackage-${MYPACKAGE_ARCH} -bmaxdata:500000000 \
-bmaxstack:500000000 -bloadmap:loadmap
#
# LIBS should include library for PRNG on the SP2
LIBS = -L/usr/local/lib -lctc -lesslp2 -limsl

# Suffix rule definitions
# All three of these need to be here. ".F.f" is necessary for working
# with RCS and GNU make, and ".f.o" and ".F.o" are always necessary.
.SUFFIXES: .o .f .F

  .F.f:
   ${CPP} ${CPPFLAGS} $*.F > $*.f 
   cp $*.f f_FILES_MPI/ 
  .f.o: 
   ${FC} -c ${FFLAGS} $<
   mv $*.o Object_MPI 
  .F.o: 
   ${CPP} ${CPPFLAGS} $*.F > $*.f
   cp $*.f f_FILES_MPI/ 
   ${FC} -c ${FFLAGS} $*.f
   mv $*.o Object_MPI 
   rm $*.f 
  objects = a.o  b.o  c.o  d.o

# All rules go below here mypackage-${MYPACKAGE_ARCH}: ${objects} cd Object_MPI; ${FC} ${LDFLAGS} ${objects} ${LIBS}; mv $(@F) ${MYPACKAGE_ROOT}/bin clean: rm -f Object_MPI/*.o *.o