forked from MetOffice/lfric_core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
127 lines (110 loc) · 4.88 KB
/
Copy pathMakefile
File metadata and controls
127 lines (110 loc) · 4.88 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
##############################################################################
# (c) Crown copyright 2017 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
#
# Master make file for LFRic infrastructure project.
# Targets provided our detailed below...
#
# all: (default) Complete build and test the infrastructure.
# Intended for interactive use.
# build: Build all executables and any supporting files
# test: Run test battery including unit tests and others
# clean: Delete all final products and working files
#
# The following variables may be specified to modify the build process...
#
# WORKING_DIR: Path to scratch space in which intermediate files will be
# placed. This should be somewhere with good "many small
# files" performance, i.e. probably not Lustre.
# Default: ./working
# VERBOSE: Set in order to see actual commands issued by the build system.
# PROFILE: Set to a string representing a package of compiler options.
# Potential profiles are 'full-debug', 'fast-debug' and 'production'.
# Default: fast-debug
# LINK_TYPE: Either 'static' or 'dynamic'.
# Default: dynamic
#
##############################################################################
PROJECT_NAME = infrastructure
PROFILE ?= fast-debug
export PROJECT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
export CORE_ROOT_DIR ?= ..
export SUITE_GROUP ?= developer
export SUITE_GROUP_NAME ?= $(notdir $(realpath $(shell pwd)/$(CORE_ROOT_DIR)))-$(PROJECT_NAME)-.*
META_VN ?= HEAD
META_FILE_DIR = $(PROJECT_DIR)/rose-meta/lfric-$(PROJECT_NAME)/$(META_VN)
.PHONY: default
default: unit-tests integration-tests
$(Q)echo > /dev/null
.PHONY: documentation doc docs
documentation doc docs: document-uml document-latex document-api
$(Q)echo > /dev/null
include build/lfric.mk
include build/import.mk
##############################################################################
# Documentation
#
.PHONY: document-uml
document-uml: DOCUMENT_DIR ?= $(PROJECT_DIR)/documents/uml
document-uml: SOURCE_DIR = documentation/uml
document-uml: WORKING_DIR := $(WORKING_DIR)/uml
document-uml: uml-documentation
$(Q)echo > /dev/null
.PHONY: document-latex
document-latex: DOCUMENT_DIR ?= $(PROJECT_DIR)/documents
document-latex: SOURCE_DIR = documentation
document-latex: DOCUMENTS = $(shell find $(SOURCE_DIR) -name '*.latex' -print)
document-latex: WORKING_DIR := $(WORKING_DIR)/latex
document-latex: TEX_STUFF = documentation/tex
document-latex: COMMON_FIGURES = documentation/common-figures
document-latex: ALWAYS
$(Q)$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/latex.mk \
SOURCE_DIR=$(SOURCE_DIR) \
WORKING_DIR=$(WORKING_DIR) \
DOCUMENT_DIR=$(DOCUMENT_DIR) \
TEX_STUFF=$(TEX_STUFF) \
COMMON_FIGURES=$(COMMON_FIGURES) \
DOCUMENTS="$(DOCUMENTS)"
.PHONY: document-api
document-api: PROJECT = infrastructure
document-api: DOCUMENT_DIR ?= $(PROJECT_DIR)/documents/api
document-api: CONFIG_DIR = documentation
document-api: SOURCE_DIR = source
document-api: WORKING_DIR := $(WORKING_DIR)/api
document-api: api-documentation
$(Q)echo > /dev/null
##############################################################################
# Unit tests
#
unit-tests/%: export BIN_DIR ?= $(PROJECT_DIR)/test
unit-tests/%: export PRE_PROCESS_INCLUDE_DIRS = $(realpath unit-test/include)
unit-tests/%: export PROGRAMS = infrastructure_unit_tests
unit-tests/%: export PROJECT = infrastructure
unit-tests/%: export SOURCE_DIR = source
unit-tests/%: export TEST_DIR = unit-test
unit-tests/%: export WORKING_DIR := $(WORKING_DIR)/unit-tests
unit-tests/%: export MPI_TESTS = YES
unit-tests: unit-tests/run
##############################################################################
# Integration tests
#
integration-tests/%: export BIN_DIR ?= $(PROJECT_DIR)/test
integration-tests/%: export META_FILE_DIR = integration-test/configuration_test/resources
integration-tests/%: export PROJECT = infrastructure
integration-tests/%: export SOURCE_DIR = source
integration-tests/%: export TEST_DIR = integration-test
integration-tests/%: export WORKING_DIR := $(WORKING_DIR)/integration-tests
integration-tests: integration-tests/run
##############################################################################
# Clean
#
.PHONY: clean
clean: ALWAYS
$(call MESSAGE,Removing,"infrastructure work space")
$(Q)-rm -r $(WORKING_DIR)
$(call MESSAGE,Removing,"infrastructure documents")
$(Q)if [ -d documents ] ; then rm -r documents; fi
$(call MESSAGE,Removing,"infrastructure binaries")
$(Q)-if [ -d test ] ; then rm -r test ; fi