forked from gotm-model/cases
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (69 loc) · 1.8 KB
/
Makefile
File metadata and controls
87 lines (69 loc) · 1.8 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
#
# Master Makefile for making GOTM git examples
#
SHELL = /bin/bash
ver=5.3
ifndef GOTMDIR
export GOTMDIR=$(HOME)/GOTM/code
endif
ifdef GOTM_PREFIX
external_GOTM_PREFIX=$(GOTM_PREFIX)
else
GOTM_PREFIX=$(CURDIR)/build
ifneq ($(wildcard $(GOTMDIR)/CMakeLists.txt),)
GOTM_CMAKE_SRC=$(GOTMDIR)
else
GOTM_CMAKE_SRC=$(GOTMDIR)/src
endif
endif
ifndef FABM_PREFIX
ifdef FABMDIR
FABM_ARG="-DFABM_BASE=$(FABMDIR)"
endif
endif
# Set the subdirectories of the different test cases
SUBDIRS = $(shell grep -v not_ready READY_CASES)
all: link
gotm-exe:
ifndef external_GOTM_PREFIX
@mkdir -p build
@(cd build ; cmake $(GOTM_CMAKE_SRC) -DCMAKE_INSTALL_PREFIX=`pwd` -DCMAKE_Fortran_FLAGS="$(EXTRA_FFLAGS)" $(FABM_ARG) || false)
@(cd build ; make -s install)
endif
link: gotm-exe
@test -x $(GOTM_PREFIX)/bin/gotm || \
(echo "ERROR: invalid GOTM_PREFIX=$(GOTM_PREFIX)" ; false)
@ln -sfv $(GOTM_PREFIX)/bin/gotm
release: distclean examples scenarios
tar -cvzf templates.tar.gz templates/
tar -cvzf gotm-cases-v4.2.tar.gz *.tar.gz
. ./RSYNC
namelist:
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
endif
example:
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
endif
scenario:
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
endif
run: link
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
endif
clean: realclean
realclean:
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
endif
distclean:
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
endif
$(RM) -r *.tar.gz gotm build
#-----------------------------------------------------------------------
# Copyright by the GOTM-team under the GNU Public License - www.gnu.org
#-----------------------------------------------------------------------