-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (48 loc) · 2 KB
/
Makefile
File metadata and controls
77 lines (48 loc) · 2 KB
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
# © 2002 – 2014 NorthWest Research Associates, Inc. All Rights Reserved
# Author: Thomas S. Lund, lund@cora.nwra.com
include compiler.spec
include dependencies.make
#-------------------------------------------------------------------------------
# Defile lists of mpi and serial programs
MPI_PROGRAMS = sam \
tst_input \
tst_transpose \
SERIAL_PROGRAMS = check \
compare_vel \
planes2vtk \
remesh \
tst_pointer \
#-------------------------------------------------------------------------------
# Define lists of mpi and serial object files
MPI_OBJECTS := $(shell grep -l 'mpif\.h' *.f | sed 's:\.f:\.o:')
SERIAL_OBJECTS := $(shell grep -L 'mpif\.h' *.f | sed 's:\.f:\.o:')
#-------------------------------------------------------------------------------
# Rule for syncing the header file with set_labels.f
header:
syncHeader
sam.h: set_labels.f
syncHeader
#-------------------------------------------------------------------------------
# Rule for generating dependency information
depend:
get_dependencies $(MPI_PROGRAMS) $(SERIAL_PROGRAMS)
#-------------------------------------------------------------------------------
# Rule for doing some gentle cleaning
clean:
rm *.o
#-------------------------------------------------------------------------------
# Rule for doing some more serious cleaning
clean_all:
rm *.o $(SERIAL_PROGRAMS) $(MPI_PROGRAMS)
#-------------------------------------------------------------------------------
# Rules for building both mpi and serial programs
$(MPI_PROGRAMS): %:
$(MPIFC) $(FFLAGS) $^ -o $@
$(SERIAL_PROGRAMS): %:
$(FC) $(FFLAGS) $^ -o $@
#-------------------------------------------------------------------------------
# Rules for compiling both mpi and serial object files
$(MPI_OBJECTS): %.o: %.f
$(MPIFC) $(FFLAGS) -c $<
$(SERIAL_OBJECTS): %.o: %.f
$(FC) $(FFLAGS) -c $<