Commit 3680e881 authored by Roy Fabrice's avatar Roy Fabrice
Browse files

Changes in makefile

Add mod and obj directory for build
parent 32e875d4
......@@ -6,8 +6,9 @@ FC=h5pfc
# -DOPTI: uses new algorithm to distribute halos and particles amongst processes (under development and buggy)
# GNU release flags
FCFLAGS= -O3 -g -cpp #-DLONGINT #-DOPTI #-fconvert=big-endian
FCFLAGS= -O3 -g -J$(MODDIR) -cpp #-DLONGINT #-DOPTI #-fconvert=big-endian
# GNU debug flags
DEBUGFLAGS= -O0 -g -Wall -Wextra -finit-real=zero -finit-integer=0 -std=f2008 -fcheck=all -fbacktrace -fmax-errors=10 -cpp -DDEBUG #-DDEBUGHDF5 #-DLONGINT #-DOPTI -fconvert=big-endian
DEBUGFLAGS= -O0 -g -J$(MODDIR) -Wall -Wextra -finit-real=zero -finit-integer=0 -std=f2008 -fcheck=all -fbacktrace -fmax-errors=10 -cpp -DDEBUG #-DDEBUGHDF5 #-DLONGINT #-DOPTI -fconvert=big-endian
LDFLAGS=-g
FC=h5pfc
# Optional precompiler options used in the code:
# -DDEBUGHDF5: print some debug info in HDF5 I/O routines
# -DLONGING: uses integer(kind=8) for ID
# -DOPTI: uses new algorithm to distribute halos and particles amongst processes (under development and buggy)
# GNU release flags
FCFLAGS= -O3 -g -J$(MODDIR) -cpp #-DLONGINT #-DOPTI #-fconvert=big-endian
# GNU debug flags
DEBUGFLAGS= -O0 -g -J$(MODDIR) -Wall -Wextra -finit-real=zero -finit-integer=0 -std=f2008 -fcheck=all -fbacktrace -fmax-errors=10 -cpp -DDEBUG #-DDEBUGHDF5 #-DLONGINT #-DOPTI -fconvert=big-endian
LDFLAGS=-g
MPIFC=h5pfc
FC=h5pfc
# Intel release flags
FCFLAGS= -O3 -g -cpp -DLONGINT #-DOPTI -convert big_endian
FCFLAGS= -O3 -g -module $(MODDIR) -cpp -DLONGINT #-DOPTI -convert big_endian
# Intel debug flags
DEBUGFLAGS= -O0 -g -warn all -check all,noarg_temp_created -traceback -cpp -DLONGINT -DDEBUG -DOPTI #-convert big_endian
DEBUGFLAGS= -O0 -g -module $(MODDIR) -warn all -check all,noarg_temp_created -traceback -cpp -DLONGINT -DDEBUG -DOPTI #-convert big_endian
LDFLAGS=-g
......
......@@ -3,6 +3,8 @@ include ../../Make.inc
EXE = pfof_snap
COMMONDIR = ../../common/src/
OBJDIR=../../obj/
MODDIR=../../mod/
VPATH= $(COMMONDIR):.
SRC = modhdf5.f90 \
......@@ -32,8 +34,9 @@ SRC = modhdf5.f90 \
modfofpara.f90 \
pfof_snap.f90
OBJS = $(SRC:%.f90=%.o)
OBJS_NOPREFIX=$(SRC:%.f90=%.o)
#OBJS = $(SRC:%.f90=%.o)
OBJS=$(addprefix $(OBJDIR), $(OBJS_NOPREFIX))
# variable containing if git is used or not
ifeq ($(wildcard ../../.git/HEAD ../../.git/index),)
......@@ -45,11 +48,11 @@ else
endif
%.o:%.f90
$(OBJDIR)%.o:%.f90
@echo "--------------------------------"
@echo building $*.o with parameters \
FC=$(FC), FCFLAGS=$(FCFLAGS)
$(FC) -c $(FCFLAGS) $<
$(FC) -c $(FCFLAGS) $< -o $@
%.mod:%.f90
@echo "--------------------------------"
......@@ -73,7 +76,7 @@ $(EXE) : gitversion $(OBJS)
clean :
@echo "--------------------------------"
@echo cleaning compiled objects, modules and executable
rm -f *.o *.mod *~ $(EXE) $(COMMONDIR)/gitversion.h
rm -f $(OBJDIR)*.o $(MODDIR)*.mod *~ $(EXE) $(COMMONDIR)/gitversion.h
# create file for git version
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment