-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile.in
224 lines (153 loc) · 7.03 KB
/
Makefile.in
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#-----------------------------------------------------------------------
# Makefile for SNOPT C/C++ API
#-----------------------------------------------------------------------
FC = @FC@
FCFLAGS = @FCFLAGS@
FCLIBS = @FCLIBS@
CC = @CC@
CFLAGS = @CFLAGS@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
LDFLAGS = -avoid-version
LTFLAGS = --quiet
#-----------------------------------------------------------------------
SHELL = @SHELL@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
INSTALL = @INSTALL@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
libdir = @libdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
#-----------------------------------------------------------------------
blas = @blas@
ifeq ($(blas),yes)
blasLIB = @BLAS_LIBS@
endif
SNOPT_LIB = -L@snopt_dir@ -lsnopt7
LIBDIR = $(top_builddir)/lib
MODDIR = $(top_builddir)/mod
SNOPT_SRCDIR = $(top_srcdir)/src
SNOPT_OBJDIR = $(top_builddir)/src
SNOPT_C_EX_SRCDIR = $(top_srcdir)/cexamples
SNOPT_CPP_EX_SRCDIR = $(top_srcdir)/cppexamples
SNOPT_C_EX_OBJDIR = $(top_builddir)/cexamples
SNOPT_CPP_EX_OBJDIR = $(top_builddir)/cppexamples
#-----------------------------------------------------------------------
SNOPT_C_FILES = snopt_wrapper sqopt_wrapper snopt_cwrap sqopt_cwrap
SNOPT_CPP_FILES = snopt_wrapper sqopt_wrapper snoptProblem
SNOPT_C_LO = $(SNOPT_C_FILES:%=$(SNOPT_OBJDIR)/%.lo)
SNOPT_CPP_LO = $(SNOPT_CPP_FILES:%=$(SNOPT_OBJDIR)/%.lo)
#-----------------------------------------------------------------------
SNOPT_C_EX = toyA toyB toyC hs118 toyC_w
SNOPT_CPP_EX = sntoya sntoyB sntoyC catmixa hs118 sntoyB_w
SNOPT_C_EXAMPLES = $(SNOPT_C_EX:%=$(SNOPT_C_EX_OBJDIR)/%)
SNOPT_CPP_EXAMPLES = $(SNOPT_CPP_EX:%=$(SNOPT_CPP_EX_OBJDIR)/%)
#-----------------------------------------------------------------------
MODLOC = @FC_MODOUT@$(MODDIR)
MODINC = @FC_MODINC@$(MODDIR)
MODFLAGS = $(MODLOC) $(MODINC)
SNOPT_INCLUDE = -I$(top_srcdir)/include
SNOPT_C_LIBS = -L$(libdir) -lsnopt7_c $(blasLIB)
SNOPT_CPP_LIBS = -L$(libdir) -lsnopt7_cpp $(blasLIB)
#-----------------------------------------------------------------------
COMPILE_F = $(LIBTOOL) --mode=compile --tag=FC $(LTFLAGS) $(FC)
LINK_F = $(LIBTOOL) --mode=link --tag=FC $(LTFLAGS) $(FC)
COMPILE_C = $(LIBTOOL) --mode=compile --tag=CC $(LTFLAGS) $(CC)
LINK_C = $(LIBTOOL) --mode=link --tag=CC $(LTFLAGS) $(CC)
COMPILE_CXX = $(LIBTOOL) --mode=compile --tag=CXX $(LTFLAGS) $(CXX)
LINK_CXX = $(LIBTOOL) --mode=link --tag=CXX $(LTFLAGS) $(CXX)
CLEAN = $(LIBTOOL) --mode=clean $(LTFLAGS)
INSTALL_LIB = $(LIBTOOL) --mode=install $(LTFLAGS) $(INSTALL)
FINISH = $(LIBTOOL) --mode=finish $(LTFLAGS)
UNINSTALL = $(LIBTOOL) --mode=uninstall $(LTFLAGS)
#-----------------------------------------------------------------------
all: snopt_c snopt_cpp
examples: examples_snopt_c examples_snopt_cpp
examples_c: examples_snopt_c
examples_cpp: examples_snopt_cpp
examples_snopt_c: snopt_c $(SNOPT_C_EX_OBJDIR) $(SNOPT_C_EXAMPLES)
examples_snopt_cpp: snopt_cpp $(SNOPT_CPP_EX_OBJDIR) $(SNOPT_CPP_EXAMPLES)
install: install_cpp install_c
uninstall: uninstall_cpp uninstall_c
snopt_c: $(MODDIR) $(LIBDIR) $(LIBDIR)/libsnopt7_c.la
snopt_cpp: $(MODDIR) $(LIBDIR) $(LIBDIR)/libsnopt7_cpp.la
install_c: snopt_c $(libdir)
$(INSTALL_LIB) $(LIBDIR)/libsnopt7_c.la $(libdir)
$(FINISH) $(libdir)
uninstall_c:
$(UNINSTALL) rm -f $(libdir)/libsnopt7_c.la
$(CLEAN) rm -f $(LIBDIR)/libsnopt7_c.la
#-----------------------------------------------------------------------
install_cpp: snopt_cpp $(libdir)
$(INSTALL_LIB) $(LIBDIR)/libsnopt7_cpp.la $(libdir)
$(FINISH) $(libdir)
uninstall_cpp:
$(UNINSTALL) rm -f $(libdir)/libsnopt7_cpp.la
$(CLEAN) rm -f $(LIBDIR)/libsnopt7_cpp.la
#-----------------------------------------------------------------------
$(LIBDIR)/libsnopt7_cpp.la: $(SNOPT_CPP_LO)
$(LINK_F) $(LDFLAGS) $(CXXFLAGS) -o $@ $^ $(SNOPT_LIB) -rpath $(libdir)
$(LIBDIR)/libsnopt7_c.la: $(SNOPT_C_LO)
$(LINK_F) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(SNOPT_LIB) -rpath $(libdir)
#-----------------------------------------------------------------------
$(SNOPT_OBJDIR)/%.lo: $(SNOPT_SRCDIR)/%.f90
$(COMPILE_F) -c $(FCFLAGS) $(MODFLAGS) $(SNOPT_INCLUDE) $< -o $@
$(SNOPT_OBJDIR)/%.lo: $(SNOPT_SRCDIR)/%.c
$(COMPILE_C) -c $(CFLAGS) $(SNOPT_INCLUDE) $< -o $@
$(SNOPT_OBJDIR)/%.lo: $(SNOPT_SRCDIR)/%.cpp
$(COMPILE_CXX) -c $(CXXFLAGS) $(SNOPT_INCLUDE) $< -o $@
#-----------------------------------------------------------------------
$(SNOPT_C_EX_OBJDIR)/%: $(SNOPT_C_EX_OBJDIR)/%.lo
$(LINK_C) $(CFLAGS) $^ -o $@ $(SNOPT_C_LIBS) $(FCLIBS)
$(SNOPT_C_EX_OBJDIR)/%.lo : $(SNOPT_C_EX_SRCDIR)/%.c
$(COMPILE_C) $(CFLAGS) $(SNOPT_INCLUDE) -c $< -o $@
#-----------------------------------------------------------------------
$(SNOPT_CPP_EX_OBJDIR)/%: $(SNOPT_CPP_EX_OBJDIR)/%.lo
$(LINK_CXX) $(CXXFLAGS) $^ -o $@ $(SNOPT_CPP_LIBS) $(FCLIBS)
$(SNOPT_CPP_EX_OBJDIR)/%.lo: $(SNOPT_CPP_EX_SRCDIR)/%.cpp
$(COMPILE_CXX) $(CXXFLAGS) $(SNOPT_INCLUDE) -c $< -o $@
#-----------------------------------------------------------------------
$(top_builddir):
if [ ! -d $(top_builddir) ]; then mkdir $(top_builddir); fi
$(libdir):
if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
$(LIBDIR):
if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR); fi
$(MODDIR): $(top_builddir)
if [ ! -d $(MODDIR) ]; then mkdir $(MODDIR); fi
$(SNOPT_OBJDIR): $(top_builddir)
if [ ! -d $(SNOPT_OBJDIR) ]; then mkdir $(SNOPT_OBJDIR); fi
$(SNOPT_C_EX_OBJDIR): $(top_builddir)
if [ ! -d $(SNOPT_C_EX_OBJDIR) ]; then mkdir $(SNOPT_C_EX_OBJDIR); fi
$(SNOPT_CPP_EX_OBJDIR): $(top_builddir)
if [ ! -d $(SNOPT_CPP_EX_OBJDIR) ]; then mkdir $(SNOPT_CPP_EX_OBJDIR); fi
#-----------------------------------------------------------------------
clean:
$(CLEAN) rm -f $(SNOPT_OBJDIR)/*.lo
$(CLEAN) rm -f $(SNOPT_CPP_EX_OBJDIR)/*.lo
$(CLEAN) rm -f $(SNOPT_C_EX_OBJDIR)/*.lo
veryclean: clean
$(CLEAN) rm -f $(SNOPT_C_EX_OBJDIR)/*.out
$(CLEAN) rm -f $(SNOPT_CPP_EXAMPLES)
$(CLEAN) rm -f $(SNOPT_C_EXAMPLES)
$(CLEAN) rm -f $(SNOPT_CPP_EX_OBJDIR)/*.out
distclean: veryclean
-rm -rf $(LIBDIR) $(MODDIR)
-rm -f config.cache config.log config.status Makefile libtool
#-----------------------------------------------------------------------
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool
config.status: $(top_srcdir)/configure
./config.status --recheck
Makefile: $(top_srcdir)/Makefile.in $(top_builddir)/config.status
./config.status
#-----------------------------------------------------------------------
.PRECIOUS: $(SNOPT_C_EX_OBJDIR)/%.lo
.PHONY: all examples install uninstall snopt_c snopt_cpp \
examples_snopt_c examples_snopt_cpp \
install_c install_cpp uninstall_c uninstall_cpp \
clean