-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.hab
executable file
·126 lines (106 loc) · 2.6 KB
/
Makefile.hab
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
HEADERS= \
XMLDocument2.h \
calpop.h \
Map.h \
Matrices.h \
Numfunc.h \
ReadWrite.h \
Param.h \
Date.h \
SaveTimeArea.h \
SeapodymCoupled.h \
SimtunaFunc.h \
mytypes.h \
SeapodymDocConsole.h \
ctrace.h \
Utilities.h \
VarMatrices.h \
VarParamCoupled.h \
VarSimtunaFunc.h
SRCS= \
main_habitats.cpp \
ad_buffers.cpp \
XMLDocument2.cpp \
VarParamCoupled.cpp \
seapodym_habitat.cpp \
Map.cpp \
Matrices.cpp \
Numfunc.cpp \
ReadWrite_TXT.cpp \
ReadWrite_DYM.cpp \
ReadWrite_fisheries.cpp \
Param.cpp \
Date.cpp \
SaveTimeArea.cpp \
SimtunaFunc.cpp \
VarParamCoupled_xinit.cpp \
VarParamCoupled_reset.cpp \
SeapodymCoupled_EditRunCoupled.cpp \
SeapodymCoupled_Funcs.cpp \
Seapodym_OnRunHabitat.cpp \
SeapodymHabitat_OnRunFirstStep.cpp \
SeapodymCoupled_OnReadForcing.cpp \
SeapodymCoupled_OnWriteOutput.cpp \
SeapodymCoupled_ReadTags.cpp \
SeapodymDocConsole_UpdateDisplay.cpp \
spawning_habitat.cpp \
juvenile_habitat.cpp \
spawning.cpp \
accessibility.cpp \
feeding_habitat.cpp \
seasonal_switch.cpp \
dv_spawning_habitat.cpp \
dv_juvenile_habitat.cpp \
dv_spawning.cpp \
dv_accessibility.cpp \
dv_feeding_habitat.cpp \
dv_seasonal_switch.cpp \
Calpop_InitCalPop.cpp \
hessian.cpp \
like.cpp
SRCPATH=DOM/src:src
INCPATH=-IDOM/src -Isrc
BINPATH=bin
##############################################################
OBJPATH=objs
ADMODEL_HOME=$(ADMB_HOME)
#DEBUG=-pg -g
DEBUG= -g
#production code
CFLAGS=-DTRUE=true -DFALSE=false -D __GNUDOS__ -Dlinux -O3 -DOPT_LIB -Wall -Wno-deprecated -I$(ADMODEL_HOME)/include -I/usr/include/libxml2 $(INCPATH)
###### with safe library ################################
#LFLAGS=-lm -L$(ADMODEL_HOME)/lib -ladmb -lstdc++ -lxml2
###### with optimized library ###########################
LFLAGS= -L$(ADMODEL_HOME)/lib -ladmbo -lstdc++ -lxml2 -lm
CC=gcc
LL=$(CC)
vpath %.cpp $(SRCPATH)
vpath %.h $(SRCPATH)
OBJECTS=$(SRCS:%.cpp=$(OBJPATH)/%.o)
##############################################################
export OBJECTS
export OBJPATH
export CFLAGS
export LFLAGS
export CC
export LL
##############################################################
all: init $(BINPATH)/seapodym_habitats
init:
@test -d $(OBJPATH) || mkdir -v $(OBJPATH)
test: init $(OBJECTS)
make -f Makefile.test
docs: $(SRCS) $(HEADERS)
@doxygen
$(BINPATH)/seapodym_habitats : $(OBJECTS)
$(LL) -o$@ $(DEBUG) $^ $(LFLAGS)
$(OBJPATH)/%.o : %.cpp
$(CC) -o$@ $(DEBUG) -c $(CFLAGS) $(filter %.cpp, $^)
$(OBJECTS) : $(HEADERS)
clean:
@rm -vf $(OBJECTS) $(BINPATH)/seapodym_habitats
@rm -vf $(OBJECTS) $(BINPATH)/seapodym_habitats.exe
@rm -vf $(OBJECTS) $(BINPATH)/TestSeapodymCoupled
@rm -vrf $(OBJPATH)
#@rm -vrf docs/code-dox
#@rm -vf gmon.out