-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (37 loc) · 1.5 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
# Makefile.in - Template for Fortran 2003 code Makefile
# Variables
SRC_DIR := src
MAIN := $(SRC_DIR)/atomic_PTMC_look-up_Table_v3.f03
SUBS := $(SRC_DIR)/DrawMolecularConfiguration_v9.f03 $(SRC_DIR)/ClockSeed_v1.f03 $(SRC_DIR)/RandomNumber_v1.f03 $(SRC_DIR)/DisplaceAtoms_v1.f03 $(SRC_DIR)/RotateCluster_v1.f03 $(SRC_DIR)/AtomicMass_v1.f03
OUT := PTMC.exe
MULTIHIST_SRC := $(SRC_DIR)/multihist_dCv.f
MULTIHIST_OUT := multihist_dCv.exe
# Compiler
FC := gfortran
# Default flags
FFLAGS := -O3 -fimplicit-none
# Check the command line argument and set the appropriate flags
ifeq ($(MAKECMDGOALS),openmp)
FFLAGS += -fopenmp
endif
ifeq ($(MAKECMDGOALS),array)
FFLAGS += -fbounds-check -fbacktrace -fcheck=all
endif
ifeq ($(MAKECMDGOALS),debug)
FFLAGS += -fbounds-check -g -Wall -Wextra -Warray-temporaries -Wconversion -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan -Og
endif
ifeq ($(MAKECMDGOALS),debug-openmp)
FFLAGS += -fopenmp -fbounds-check -g -Wall -Wextra -Warray-temporaries -Wconversion -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan -Og
endif
.PHONY: all openmp array debug debug-openmp clean
all: $(OUT) $(MULTIHIST_OUT)
openmp: $(OUT) $(MULTIHIST_OUT)
array: $(OUT) $(MULTIHIST_OUT)
debug: $(OUT) $(MULTIHIST_OUT)
debug-openmp: $(OUT) $(MULTIHIST_OUT)
$(OUT): $(MAIN) $(SUBS)
$(FC) $(FFLAGS) $^ -o $@
$(MULTIHIST_OUT): $(MULTIHIST_SRC)
$(FC) $< -ffpe-summary=none -o $@
clean:
rm -f $(OUT) $(MULTIHIST_OUT)