-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGNUmakefile
74 lines (53 loc) · 2.27 KB
/
GNUmakefile
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
GRTECLYN_HOME = $(realpath ..)
include $(GRTECLYN_HOME)/Tools/GNUMake/Make.defaults
# We don't want to use MPI by default for the tests
USE_MPI = FALSE
EBASE = Tests
AMREX_HOME ?= $(realpath ../../amrex)
include $(AMREX_HOME)/Tools/GNUMake/Make.defs
include ./Make.package
include $(AMREX_HOME)/Src/Base/Make.package
include $(AMREX_HOME)/Src/Boundary/Make.package
include $(AMREX_HOME)/Src/AmrCore/Make.package
include $(AMREX_HOME)/Src/Amr/Make.package
GRTECLYN_SOURCE = $(GRTECLYN_HOME)/Source
src_dirs := $(GRTECLYN_SOURCE)/utils \
$(GRTECLYN_SOURCE)/CCZ4 \
$(GRTECLYN_SOURCE)/BoxUtils \
$(GRTECLYN_SOURCE)/simd
GRTECLYN_TESTS_HOME = $(GRTECLYN_HOME)/Tests
# test_dirs = $(GRTECLYN_TESTS_HOME)/Common \
# $(GRTECLYN_TESTS_HOME)/CCZ4RHSTest \
# $(GRTECLYN_TESTS_HOME)/DerivativeUnitTests \
# $(GRTECLYN_TESTS_HOME)/PositiveChiAndAlphaUnitTest \
# $(GRTECLYN_TESTS_HOME)/CCZ4GeometryUnitTests \
# $(GRTECLYN_TESTS_HOME)/CoordinateTransformationsTest \
# $(GRTECLYN_TESTS_HOME)/SphericalHarmonicTest
# Find all directories that end in "Test" or "Tests"
# Note that hidden directories (i.e. those starting with a '.') are not included
test_dirs_match := $(wildcard $(GRTECLYN_TESTS_HOME)/*Test/ $(GRTECLYN_TESTS_HOME)/*Tests/)
# Strip the trailing path separator (probably not necessary)
test_dirs := $(patsubst %/, %, $(test_dirs_match))
# Finally add in the Common directory
test_dirs += $(GRTECLYN_TESTS_HOME)/Common
src_pack := $(foreach dir, $(src_dirs), $(dir)/Make.package)
test_pack := $(foreach dir, $(test_dirs), $(dir)/Make.package)
include $(src_pack)
include $(test_pack)
doctest_dir := $(GRTECLYN_HOME)/External/doctest
doctest_headers := doctest.h
CEXE_sources += $(GRTECLYN_CEXE_sources)
CEXE_headers += $(GRTECLYN_CEXE_headers) $(doctest_headers)
VPATH_LOCATIONS += $(src_dirs) $(test_dirs)
INCLUDE_LOCATIONS += $(realpath .) $(src_dirs) $(test_dirs)
SYSTEM_INCLUDE_LOCATIONS += $(doctest_dir)
include $(GRTECLYN_HOME)/Tools/GNUMake/Make.rules
ifeq ($(USE_MPI), TRUE)
LAUNCH = mpiexec -n 2 ./
else
LAUNCH = ./
endif
DOCTEST_OPTIONS := -dt-d=yes
run: $(executable)
$(info Running tests for configuration: $(optionsSuffix))
$(SILENT) $(LAUNCH)$(executable) $(DOCTEST_OPTIONS)