-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile.nuopc
51 lines (37 loc) · 1.49 KB
/
makefile.nuopc
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
# User must customize the following two make variables
#installdate=latest
installdate := $(shell date '+%Y-%m-%d-%H-%M-%S')
ifneq ($(origin ESMFMKFILE), environment)
$(error Environment variable ESMFMKFILE was not set.)
endif
include $(ESMFMKFILE)
ESMF_INC = $(ESMF_F90COMPILEPATHS)
ESMF_LIB = $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) $(ESMF_F90ESMFLINKLIBS)
UTILINCS = -I$(LANLCICEDIR)/compile
.SUFFIXES: .F90
%.o : %.F90
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(UTILINCS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $<
.PRECIOUS: %.o
PWDDIR := $(shell pwd)
MAKEFILE = makefile.nuopc
LIBRARY = libcice.a
MODULES = cice_cap.o
all default:
@gmake -f $(MAKEFILE) $(LIBRARY)
$(LIBRARY): $(MODULES)
$(AR) $(ARFLAGS) $@ $?
install: $(LIBRARY)
rm -f cice.mk.install
@echo "# ESMF self-describing build dependency makefile fragment" > cice.mk.install
@echo "# src location Zeus: $pwd" >> cice.mk.install
@echo >> cice.mk.install
@echo "ESMF_DEP_FRONT = cice_cap_mod" >> cice.mk.install
@echo "ESMF_DEP_INCPATH = $(INSTALLDIR)" >> cice.mk.install
@echo "ESMF_DEP_CMPL_OBJS = " >> cice.mk.install
@echo "ESMF_DEP_LINK_OBJS = $(INSTALLDIR)/libcice.a $(INSTALLDIR)/liblanl_cice.a" >> cice.mk.install
mkdir -p $(INSTALLDIR)
cp -f $(LANLCICEDIR)/liblanl_cice.a $(INSTALLDIR)
cp -f libcice.a cice_cap_mod.mod $(INSTALLDIR)
cp -f cice.mk.install $(INSTALLDIR)/cice.mk
clean:
$(RM) -f $(LIBRARY) *.f90 *.o *.mod *.lst depend