1# serial = Linux box, g++, serial (no MPI) 2 3SHELL = /bin/sh 4 5# --------------------------------------------------------------------- 6# compiler/linker settings 7# specify flags and libraries needed for your compiler 8 9CC = g++ 10CCFLAGS = -O3 11SHFLAGS = -fPIC 12DEPFLAGS = -M 13 14LINK = g++ 15LINKFLAGS = -O 16LIB = 17SIZE = size 18 19ARCHIVE = ar 20ARFLAGS = -rc 21SHLIBFLAGS = -shared 22 23# --------------------------------------------------------------------- 24# SPARTA-specific settings 25# specify settings for SPARTA features you will use 26# if you change any -D setting, do full re-compile after "make clean" 27 28# SPARTA ifdef settings, OPTIONAL 29# see possible settings in doc/Section_start.html#2_2 (step 4) 30 31SPARTA_INC = -DSPARTA_GZIP 32 33# MPI library, REQUIRED 34# see discussion in doc/Section_start.html#2_2 (step 5) 35# can point to dummy MPI library in src/STUBS as in Makefile.serial 36# INC = path for mpi.h, MPI compiler settings 37# PATH = path for MPI library 38# LIB = name of MPI library 39 40MPI_INC = -I../STUBS 41MPI_PATH = -L../STUBS 42MPI_LIB = -lmpi_stubs 43 44# FFT library, OPTIONAL 45# see discussion in doc/Section_start.html#2_2 (step 6) 46# can be left blank to use provided KISS FFT library 47# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings 48# PATH = path for FFT library 49# LIB = name of FFT library 50 51FFT_INC = 52FFT_PATH = 53FFT_LIB = 54 55# JPEG library, OPTIONAL 56# see discussion in doc/Section_start.html#2_2 (step 7) 57# only needed if -DSPARTA_JPEG listed with SPARTA_INC 58# INC = path for jpeglib.h 59# PATH = path for JPEG library 60# LIB = name of JPEG library 61 62JPG_INC = 63JPG_PATH = 64JPG_LIB = 65 66# --------------------------------------------------------------------- 67# build rules and dependencies 68# no need to edit this section 69 70EXTRA_INC = $(SPARTA_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) 71EXTRA_PATH = $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) 72EXTRA_LIB = $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) 73 74# Path to src files 75 76vpath %.cpp .. 77vpath %.h .. 78 79# Link target 80 81$(EXE): $(OBJ) 82 $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) 83 $(SIZE) $(EXE) 84 85# Library targets 86 87lib: $(OBJ) 88 $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) 89 90shlib: $(OBJ) 91 $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ 92 $(OBJ) $(EXTRA_LIB) $(LIB) 93 94# Compilation rules 95 96%.o:%.cpp 97 $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< 98 99%.d:%.cpp 100 $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ 101 102# Individual dependencies 103 104DEPENDS = $(OBJ:.o=.d) 105include $(DEPENDS) 106