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
86 lines (74 loc) · 3.15 KB
/
Makefile
File metadata and controls
86 lines (74 loc) · 3.15 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
##############################################################################
# (c) Crown copyright 2022 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
#
# Make file for coupling model component
# Targets provided our detailed below.
#
# all: (default) Complete build and test the coupling model component.
# 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.
##############################################################################
PROJECT_NAME = coupling
PROFILE ?= fast-debug
export PROJECT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
export CORE_ROOT_DIR ?= ../..
export INTERNAL_DEPENDENCIES = $(CORE_ROOT_DIR)/infrastructure
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: documentation doc docs
documentation doc docs: document-uml document-api
$(Q)echo > /dev/null
include $(CORE_ROOT_DIR)/infrastructure/build/lfric.mk
include $(INTERNAL_DEPENDENCIES:=/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-api
document-api: PROJECT = coupling
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 CXX_LINK = TRUE
unit-tests/%: export EXTERNAL_STATIC_LIBRARIES += pfunit
unit-tests/%: export IMPORT_PARTS = $(CORE_ROOT_DIR)/infrastructure
unit-tests/%: export META_FILE_DIR = rose-meta/lfric-coupling/HEAD
unit-tests/%: export PROGRAMS = coupling_unit_tests
unit-tests/%: export PROJECT = coupling
unit-tests/%: export SOURCE_DIR = source
unit-tests/%: export TEST_DIR = unit-test
unit-tests/%: export WORKING_DIR := $(WORKING_DIR)/unit-tests
unit-tests: unit-tests/run
##############################################################################
# Clean
#
.PHONY: clean
clean: ALWAYS
$(call MESSAGE,Removing,"coupling work space")
$(Q)-rm -r $(WORKING_DIR)
$(call MESSAGE,Removing,"coupling documents")
$(Q)if [ -d documents ] ; then rm -r documents; fi