File: TopMakefileOasis3

package info (click to toggle)
oasis3 3.mct%2Bdfsg.121022-13
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 61,660 kB
  • sloc: f90: 40,319; fortran: 5,859; ansic: 2,780; sh: 728; makefile: 702; perl: 552; xml: 278; awk: 25; csh: 7
file content (91 lines) | stat: -rwxr-xr-x 2,754 bytes parent folder | download | duplicates (4)
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
##############################################################################
#This is the top makefile for compiling OASIS3-MCT coupling library including
#  mct/mpeu, scrip and psmile (i.e. interpolation and communication)
#Platform dependent settings, compiler options, cpp keys, 
#paths and other stuff has to be set in an include file indicated in make.inc.
# 
# default : mct/mpeu, scrip and psmile
# oasis3_psmile (for OASIS3 upward compatibility): mct/mpeu, scrip and psmile
# realclean : Automatic recompilation of all sources
#
#######
include make.inc
#
SHELL = /bin/sh
MAKEf = $(MAKE) -f TopMakefileOasis3
#
# Defining path for FORTRAN and C sources
LIBSRC  = $(COUPLE)/lib
#
# Log and error files for compiling
LOG = $(COUPLE)/util/make_dir/COMP.log
ERR = $(COUPLE)/util/make_dir/COMP.err
#
#######
default: 
	 $(MAKEf) makedirs
	 $(MAKEf) makemct
	 $(MAKEf) makelibs
	 $(MAKEf) makepsmile
#
oasis3_psmile:
	$(MAKEf) makedirs
	$(MAKEf) makemct
	$(MAKEf) makelibs
	$(MAKEf) makepsmile
#
realclean:
	$(MAKEf) cleanlibs
#
# Rules for creating build and library directories
#
makedirs:
	@mkdir -p $(ARCHDIR)/build/lib/scrip
	@mkdir -p $(ARCHDIR)/build/lib/mctdir
	@mkdir -p $(ARCHDIR)/build/lib/mct
	@mkdir -p $(ARCHDIR)/build/lib/psmile.$(CHAN)
	@mkdir -p $(ARCHDIR)/lib
#
# Rules for compiling mpeu/mct library
# 
makemct:
	@echo "=> Compiling library mpeu and mct"
	(cd $(ARCHDIR)/build/lib/mctdir; cp -f -r -p $(LIBSRC)/mct/* .;\
         ./configure MPIFC="$(F90)" FC="$(F90)" CC="$(CC)" ; \
         $(MAKE)  ; \
         cp -f ./*/lib*.a   $(ARCHDIR)/lib/; \
         cp -f ./*/*.o    $(ARCHDIR)/build/lib/mct/; \
         cp -f ./*/*.mod  $(ARCHDIR)/build/lib/mct/;)
#
# Rules for compiling the libraries scrip and psmile
#
makelibs:
	@echo "=> Compiling library scrip"
	(cd $(ARCHDIR)/build/lib/scrip; cp -f $(LIBSRC)/scrip/src/Makefile .;\
         $(modifmakefile) ; $(MAKE) all )

makepsmile:
	@echo "=> Compiling library psmile"
	(cd $(ARCHDIR)/build/lib/psmile.$(CHAN) ; \
         cp -f $(LIBSRC)/psmile/src/Makefile . ; $(modifmakefile) ; \
         $(MAKE) all )
#
# Rules for cleaning
#
cleanlibs:
	@echo cleaning oasis3-mct libraries
	rm -f $(ARCHDIR)/build/lib/scrip/*
	rm -f $(ARCHDIR)/build/lib/mct/*
	rm -f -r $(ARCHDIR)/build/lib/mctdir/*
	rm -f $(ARCHDIR)/build/lib/psmile.$(CHAN)/*
	rm -f $(ARCHDIR)/lib/libscrip.a
	rm -f $(ARCHDIR)/lib/libmct.a
	rm -f $(ARCHDIR)/lib/libmpeu.a
	rm -f $(ARCHDIR)/lib/libpsmile.$(CHAN).a
#
## Some rules to modify/add variables in makefiles
#
modifmakefile =	( echo 'include $(COUPLE)/util/make_dir/make.inc' \
                         > infile; cat Makefile >> infile ; cp -f infile Makefile )
#
########################################################################################