# the source files sources = pool_tasks.cc main.cc # objects are the same as the source files with .cc replaced with .o objects = pool_tasks.o main.o # headers files headers = pool_tasks.h CC = mpicc CLINKER = mpicc CCC = mpic++ CCLINKER = $(CCC) CXXFLAGS = -O CCFLAGS = -O F77 = mpif77 FLINKER = mpif77 OPTFLAGS = -g LIB_PATH = LIB_LIST = INCLUDE_DIR = -I/usr/include/openmpi-x86_64/ ### End User configurable options ### SHELL = /bin/bash CFLAGS = $(OPTFLAGS) $(INCLUDE_DIR) -DMPI_$(ARCH) CCFLAGS = $(CFLAGS) FFLAGS = $(OPTFLAGS) FLIBS = $(FLIB_PATH) $(LIB_LIST) LIBS = $(LIB_PATH) $(PROFLIB) $(LIB_LIST) LIBSPP = $(MPIPPLIB) $(LIBS) exec = tpool default: all # make all will run commands regardless of whether there is a file "all" all: $(exec) $(exec): $(objects) $(headers) $(CCLINKER) $(OPTFLAGS) -o $(exec) $(objects) $(LIBS) # make clean will run commands regardless of whether there is a file "clean" clean: rm -rf *.o rm -f $(exec) run: mpirun -np 10 ./$(exec) # -hostfile hosts .c.o: $(CC) $(CFLAGS) -w -c $*.c .cc.o: $(CCC) $(CFLAGS) -w -c $*.cc .f.o: $(F77) $(FFLAGS) -w -c $*.f