forked from jzrake/Mara3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (45 loc) · 1.39 KB
/
Makefile
File metadata and controls
62 lines (45 loc) · 1.39 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
# =====================================================================
# Mara build system
# =====================================================================
#
#
# External library dependencies: HDF5, MPI
#
#
# Notes
# -----
#
# - A useful resource for techniques to process Makefile dependencies:
# www.microhowto.info/howto/automatically_generate_makefile_dependencies.html
#
# - Using -O0 rather than -O3 during development may reduce compilation time
# significantly.
# Build configuration
# =====================================================================
# Default build macros
CXX = mpicxx
CXXFLAGS = -std=c++17 -Wall -O0 -MMD -MP
LDFLAGS = -lhdf5
# If a Makefile.in exists in this directory, then use it
-include Makefile.in
# Build macros
# =====================================================================
SRC := $(wildcard src/*.cpp)
OBJ := $(SRC:%.cpp=%.o)
DEP := $(SRC:%.cpp=%.d)
EXE := mara
EXAMPLE_SRC := $(wildcard examples/*.cpp)
EXAMPLE_DEP := $(EXAMPLE_SRC:%.cpp=%.d)
EXAMPLE_EXE := $(EXAMPLE_SRC:%.cpp=%)
# Build rules
# =====================================================================
all: $(EXE) $(EXAMPLE_EXE) tutorial
$(EXE): $(OBJ)
$(CXX) -o $@ $^ $(LDFLAGS)
$(EXAMPLE_EXE): CXXFLAGS += -Isrc
tutorial:
$(MAKE) -C tutorial
clean:
$(RM) $(OBJ) $(DEP) $(EXE) $(EXAMPLE_EXE) $(EXAMPLE_DEP)
.PHONY: tutorial
-include $(DEP)