-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
executable file
·90 lines (77 loc) · 2.99 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# ======================================================================
#
# Makefile for SA_MESH
#
# ======================================================================
# ======================================================================
# Include definition file
# ======================================================================
include makefile.def
# ======================================================================
# Declaring variables
# ======================================================================
# The Compiler
# Ensure to disable the MPI stub if using an MPI compiler.
# SERIAL compilers
# FC=gfortran for GNU compiler (Cygwin or MinGW)
# FC=ifort for Intel compiler (Intel Visual Compiler or plato.usask.ca)
# ALSO UPDATE FTN90PP PRECOMPILER FOR SVS.
FC=gfortran
#FC=ifort
# MPI compilers for parallel computing
# FC=mpifort for OpenMPI wrapper with either GNU or Intel compiler (Cygwin or plato.usask.ca)
# COMMENT MPI STUB IF USING AN MPI COMPILER.
#FC=mpifort
# Flags for compiling, profiling, and debugging - comment as necessary
# -O2: Default optimization.
# -O3 -ffast-math: faster optimization (for GCC/gfortran only).
# -g: For debugging.
LFLAG=-c -g -O2 -Wall
#LFLAG=-c -Wall
#LFLAG=-c -O2
#LFLAG=-c -O3 -ffast-math
#LFLAG=-c -g
TARGET := ./bin/sa_mesh_sed
#SRC = $(wildcard src/*.f90)
#OBJECTS = $(SRC:.f90=.o) #main.o stats.o utils.o
# ======================================================================
# Build SA_MESH executable and print message
# ======================================================================
all: ${OBJECTS}
$(FC) -o $(TARGET) $(OBJECTS)
# $(FC) -o mpi_sa_mesh $(OBJECTS)
#static: ${OBJECTS}
# For MinGW only (the Cygwin library cannot be statically linked to the binary):
# $(FC) -o sa_mesh_static -static $(OBJECTS)
# ======================================================================
# General rules
# ======================================================================
%.o: %.f
$(FC) $(LFLAG) $<
%.o: %.F90
$(FC) $(LFLAG) $<
%.o: %.f90
$(FC) $(LFLAG) $<
%.o: %.for
$(FC) $(LFLAG) $<
# ======================================================================
# Target to create dependencies by the program makedepf90
# ======================================================================
depend .depend:
#makedepf90 -o sa_mesh_sed $(SOURCES) > .depend
makedepf90 -o sa_mesh_sed $(VPATH)*.f90 > .depend
# ======================================================================
# Cleaning object files
# ======================================================================
clean:
# 'rm' for Cygwin, 'del' for MinGW - comment as necessary
rm *.mod *.o
# del *.mod *.o
# ======================================================================
# Cleaning everything including the previously built executable
# ======================================================================
veryclean:
# 'rm' for Cygwin, 'del' for MinGW - comment as necessary
rm *.mod *.o $(TARGET)
# rm *.mod *.o mpi_sa_mesh
# del *.mod *.o sa_mesh.exe