-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
69 lines (51 loc) · 2.84 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Makefile for Experiment 'cm4p12_xanadu_2021.01'
BUILDROOT = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
SRCROOT = $(abspath $(BUILDROOT)../src)/ # Final '/' added to denote directory
# Select the make template (default is intel)
ifeq ($(gcc),on)
MK_TEMPLATE = $(BUILDROOT)templates/gnu.mk
else
MK_TEMPLATE = $(BUILDROOT)templates/intel.mk
endif
# Set shell to sh
ifeq ($(SH),sh)
SHELL=/bin/sh
endif
# Override default compile options. See templates/intel.mk for more compile options.
# BLD_TYPE configures the type of build, PROD (production), REPRO (regression) or
# DEBUG (debug options)
BLD_TYPE = PROD
OPENMP = t # Build with OpenMP enabled
include $(MK_TEMPLATE)
SUBMAKEFLAGS = BUILDROOT=$(BUILDROOT) SRCROOT=$(SRCROOT) MK_TEMPLATE=$(MK_TEMPLATE) BLD_TYPE=$(BLD_TYPE)
am4_xanadu_2021.03.x: coupler/libcoupler.a atmos_dyn/libatmos_dyn.a ice_sis/libice_sis.a atmos_cubed_sphere/libatmos_cubed_sphere.a atmos_phys/libatmos_phys.a mom6/libmom6.a land_lad2/libland_lad2.a fms/build/libFMS/.libs/libFMS.a
$(LD) $^ $(LDFLAGS) -o $@ $(STATIC_LIBS)
fms/build/libFMS/.libs/libFMS.a: FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)fms $(@F)
atmos_phys/libatmos_phys.a: fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)atmos_phys $(@F)
atmos_cubed_sphere/libatmos_cubed_sphere.a: atmos_phys/libatmos_phys.a fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)atmos_cubed_sphere $(@F)
atmos_dyn/libatmos_dyn.a: atmos_cubed_sphere/libatmos_cubed_sphere.a atmos_phys/libatmos_phys.a fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)atmos_dyn $(@F)
ice_sis/libice_sis.a: mom6/libmom6.a fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)ice_sis $(@F)
land_lad2/libland_lad2.a: fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)land_lad2 $(@F)
# MOM6 is currently unable to run with OpenMP enabled
mom6/libmom6.a: fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) --directory=$(BUILDROOT)mom6 $(@F)
coupler/libcoupler.a: atmos_dyn/libatmos_dyn.a ice_sis/libice_sis.a mom6/libmom6.a land_lad2/libland_lad2.a atmos_phys/libatmos_phys.a fms/build/libFMS/.libs/libFMS.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)coupler $(@F)
FORCE:
clean:
$(MAKE) --directory=$(BUILDROOT)fms clean
$(MAKE) --directory=$(BUILDROOT)atmos_phys clean
$(MAKE) --directory=$(BUILDROOT)atmos_dyn clean
$(MAKE) --directory=$(BUILDROOT)atmos_cubed_sphere clean
$(MAKE) --directory=$(BUILDROOT)ice_sis clean
$(MAKE) --directory=$(BUILDROOT)land_lad2 clean
$(MAKE) --directory=$(BUILDROOT)mom6 clean
$(MAKE) --directory=$(BUILDROOT)coupler clean
clean_all: clean
$(RM) *.x