source: branches/BSP/trunk/Cbc/src/Makefile.am @ 735

Last change on this file since 735 was 735, checked in by lou, 14 years ago

Correct linking of cbc-generic when ASL is present.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.3 KB
Line 
1# Copyright (C) 2006 International Business Machines and others.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: Makefile.am 735 2007-08-10 01:27:17Z lou $
6
7# Author:  Andreas Waechter           IBM    2006-04-13
8
9AUTOMAKE_OPTIONS = foreign
10
11########################################################################
12#                               libCbc                                 #
13########################################################################
14
15# Name of the library compiled in this directory.  We want it to be installed
16# in the 'lib' directory
17lib_LTLIBRARIES = libCbc.la
18
19# List all source files for this library, including headers
20libCbc_la_SOURCES = \
21        Cbc_C_Interface.cpp Cbc_C_Interface.h \
22        CbcConfig.h \
23        CbcBranchActual.cpp CbcBranchActual.hpp \
24        CbcBranchBase.cpp CbcBranchBase.hpp \
25        CbcBranchCut.cpp CbcBranchCut.hpp \
26        CbcBranchDynamic.cpp CbcBranchDynamic.hpp \
27        CbcBranchLotsize.cpp CbcBranchLotsize.hpp \
28        CbcCompareActual.cpp CbcCompareActual.hpp \
29        CbcCompareBase.hpp \
30        CbcCountRowCut.cpp CbcCountRowCut.hpp \
31        CbcCutGenerator.cpp CbcCutGenerator.hpp \
32        CbcEventHandler.cpp CbcEventHandler.hpp \
33        CbcFathom.cpp CbcFathom.hpp \
34        CbcFathomDynamicProgramming.cpp CbcFathomDynamicProgramming.hpp \
35        CbcFeasibilityBase.hpp \
36        CbcHeuristic.cpp CbcHeuristic.hpp \
37        CbcHeuristicFPump.cpp CbcHeuristicFPump.hpp \
38        CbcHeuristicGreedy.cpp CbcHeuristicGreedy.hpp \
39        CbcHeuristicLocal.cpp CbcHeuristicLocal.hpp \
40        CbcHeuristicRINS.cpp CbcHeuristicRINS.hpp \
41        CbcMessage.cpp CbcMessage.hpp \
42        CbcModel.cpp CbcModel.hpp \
43        CbcNode.cpp CbcNode.hpp \
44        CbcSolver.cpp CbcCbcParam.cpp \
45        CbcStatistics.cpp CbcStatistics.hpp \
46        CbcStrategy.cpp CbcStrategy.hpp \
47        CbcTree.cpp CbcTree.hpp \
48        CbcLinked.cpp CbcLinked.hpp \
49        CbcTreeLocal.cpp CbcTreeLocal.hpp \
50        ClpConstraintAmpl.hpp ClpAmplObjective.hpp ClpAmplStuff.cpp
51
52## If we have the Ampl solver library, we need to add additional things
53## also see lower down
54## new idea is to add in source code anyway
55libCbc_la_SOURCES += Cbc_ampl.cpp Cbc_ampl.h
56
57
58# This is for libtool (on Windows)
59
60libCbc_la_LDFLAGS = $(LT_LDFLAGS)
61
62# Some common setup for cbc and cbc-generic.
63
64bin_PROGRAMS =
65AM_CPPFLAGS =
66
67LIBS += `cat $(CGLOBJDIR)/cgl_addlibs.txt` \
68        `cat $(OSIOBJDIR)/osi_addlibs.txt` \
69        `cat $(COINUTILSOBJDIR)/coinutils_addlibs.txt` $(ADDLIBS)
70
71
72########################################################################
73#                            cbc program                               #
74########################################################################
75
76if COIN_HAS_CLP
77
78# Name of the executable compiled in this directory.  We want it to be
79# installed in the 'bin' directory
80bin_PROGRAMS += cbc
81
82# List all source files for this executable, including headers
83cbc_SOURCES = \
84        CoinSolve.cpp \
85        unitTestClp.cpp
86
87# Additional COIN libraries
88cbc_LDADD = libCbc.la \
89        $(CGLOBJDIR)/src/libCgl.la \
90        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
91        $(OSIOBJDIR)/src/libOsi.la \
92        $(CLPOBJDIR)/src/libClp.la \
93        $(COINUTILSOBJDIR)/src/libCoinUtils.la
94
95# Finally, the -rpath flag is used by libtool to make sure that the shared
96# library is found (in the lib install directory) when we are using dynamic
97# libraries.
98cbc_LDFLAGS = -rpath $(libdir)
99
100# Add locations of include files.
101
102AM_CPPFLAGS += -I`$(CYGPATH_W) $(CLPSRCDIR)/src` \
103        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp` \
104        -I`$(CYGPATH_W) $(CLPOBJDIR)/inc`
105LIBS  += `cat $(CLPOBJDIR)/clp_addlibs.txt`
106
107# If we have the Ampl solver library, we need to add additional things
108if COIN_HAS_ASL
109#cbc_SOURCES += Cbc_ampl.cpp Cbc_ampl.h
110cbc_LDADD += $(ASLLIB)
111AM_CPPFLAGS += $(ASL_CPPFLAGS) -DCOIN_HAS_ASL
112endif
113
114endif
115
116
117########################################################################
118#                        cbc-generic program                           #
119########################################################################
120
121if CBC_BUILD_CBC_GENERIC
122
123# Name of the executable compiled in this directory.  We want it to be
124# installed in the 'bin' directory
125
126bin_PROGRAMS += cbc-generic
127
128# List all source files for this executable, including headers
129
130cbc_generic_SOURCES = \
131        CbcGenBaB.cpp \
132        CbcGenCbcParam.cpp CbcGenCbcParam.hpp CbcGenCbcParamUtils.cpp \
133        CbcGenCtlBlk.cpp CbcGenCtlBlk.hpp \
134        CbcGeneric.cpp \
135        CbcGenMessages.cpp CbcGenMessages.hpp \
136        CbcGenOsiParam.cpp CbcGenOsiParam.hpp CbcGenOsiParamUtils.cpp \
137        CbcGenParam.cpp CbcGenParam.hpp CbcGenParamUtils.cpp \
138        CbcGenSolution.cpp \
139        CbcGenSolvers.cpp
140
141cbc_generic_LDADD = libCbc.la \
142        $(CGLOBJDIR)/src/libCgl.la
143
144# List all additionally required solver and Osi libraries
145
146if COIN_HAS_CLP
147  AM_CPPFLAGS += -I`$(CYGPATH_W) $(CLPSRCDIR)/src` \
148        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp` \
149        -I`$(CYGPATH_W) $(CLPOBJDIR)/inc`
150  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
151        $(CLPOBJDIR)/src/libClp.la
152  LIBS  += `cat $(CLPOBJDIR)/clp_addlibs.txt`
153endif
154
155if COIN_HAS_CPX
156  AM_CPPFLAGS += -I`$(CYGPATH_W) $(CPXINCDIR)` \
157        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiCpx`
158  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiCpx/libOsiCpx.la
159endif
160
161if COIN_HAS_DYLP
162  AM_CPPFLAGS += -I`$(CYGPATH_W) $(DYLPSRCDIR)/src/DylpStdLib` \
163        -I`$(CYGPATH_W) $(DYLPSRCDIR)/src/Dylp` \
164        -I`$(CYGPATH_W) $(DYLPOBJDIR)/inc` \
165        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiDylp`
166  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiDylp/libOsiDylp.la \
167        $(DYLPOBJDIR)/src/Dylp/libDylp.la
168  LIBS += `cat $(DYLPOBJDIR)/dylp_addlibs.txt`
169endif
170
171if COIN_HAS_FMP
172  AM_CPPFLAGS += -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiFmp`
173  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiFmp/libOsiFmp.la
174endif
175
176if COIN_HAS_GLPK
177  AM_CPPFLAGS += -I`$(CYGPATH_W) $(GLPKINCDIR)` \
178        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiGlpk`
179  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiGlpk/libOsiGlpk.la
180endif
181
182if COIN_HAS_MSK
183  AM_CPPFLAGS += -I`$(CYGPATH_W) $(MSKINCDIR)` \
184        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiMsk`
185  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiMsk/libOsiMsk.la
186endif
187
188if COIN_HAS_OSL
189  AM_CPPFLAGS += -I`$(CYGPATH_W) $(OSLINCDIR)` \
190        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiOsl`
191  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiOsl/libOsiOsl.la
192endif
193
194if COIN_HAS_SPX
195  AM_CPPFLAGS += -I`$(CYGPATH_W) $(SPXINCDIR)` \
196        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiSpx`
197  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiSpx/libOsiSpx.la
198endif
199
200if COIN_HAS_SYMPHONY
201  AM_CPPFLAGS += -I`$(CYGPATH_W) $(SYMPHONYSRCDIR)/src` \
202        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiSym`
203  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiSym/libOsiSym.la \
204        $(SYMPHONYOBJDIR)/src/libSym.la
205  LIBS += `cat $(SYMPHONYOBJDIR)/sym_addlibs.txt`
206endif
207
208if COIN_HAS_VOL
209  AM_CPPFLAGS += -I`$(CYGPATH_W) $(VOLSRCDIR)/src` \
210        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiVol`
211  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiVol/libOsiVol.la \
212        $(VOLOBJDIR)/src/libVol.la
213  LIBS += `cat $(VOLOBJDIR)/vol_addlibs.txt`
214endif
215
216if COIN_HAS_XPR
217  AM_CPPFLAGS += -I`$(CYGPATH_W) $(XPRINCDIR)` \
218        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiXpr`
219  cbc_generic_LDADD += $(OSIOBJDIR)/src/OsiXpr/libOsiXpr.la
220endif
221
222if COIN_HAS_ASL
223  cbc_generic_LDADD += $(ASLLIB)
224  AM_CPPFLAGS += $(ASL_CPPFLAGS) -DCOIN_HAS_ASL
225endif
226
227# Finally the Osi Coin library (many of the above need it)
228cbc_generic_LDADD += $(OSIOBJDIR)/src/libOsi.la \
229        $(COINUTILSOBJDIR)/src/libCoinUtils.la
230
231# Finally, the -rpath flag is used by libtool to make sure that the shared
232# library is found (in the lib install directory) when we are using dynamic
233# libraries.
234
235cbc_generic_LDFLAGS = -rpath $(libdir)
236
237endif
238
239########################################################################
240#                            Additional flags                          #
241########################################################################
242
243# Here list all include flags, relative to this "srcdir" directory.  This
244# "cygpath" stuff is necessary to compile with native compilers on Windows.
245# "top_srcdir" refers to the basic directory for the main package that is
246# being compiled.
247AM_CPPFLAGS += \
248        -I`$(CYGPATH_W) $(CGLSRCDIR)/src` \
249        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglClique` \
250        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglDuplicateRow` \
251        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglFlowCover` \
252        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglGomory` \
253        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglKnapsackCover` \
254        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglMixedIntegerRounding` \
255        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglMixedIntegerRounding2` \
256        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglOddHole` \
257        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglPreProcess` \
258        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglProbing` \
259        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglRedSplit` \
260        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglTwomir` \
261        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglLandP` \
262        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglResidualCapacity` \
263        -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src` \
264        -I`$(CYGPATH_W) $(COINUTILSOBJDIR)/inc` \
265        -I`$(CYGPATH_W) $(OSISRCDIR)/src` \
266        -I`$(CYGPATH_W) $(OSIOBJDIR)/inc`
267
268# List additional defines
269AM_CPPFLAGS += -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG
270
271# This line is necessary to allow VPATH compilation with MS compilers
272# on Cygwin
273DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
274
275########################################################################
276#                Headers that need to be installed                     #
277########################################################################
278
279# Here list all the header files that are required by a user of the library,
280# and that therefore should be installed in 'install'
281include_HEADERS = \
282        ../inc/config_cbc.h \
283        Cbc_C_Interface.h \
284        CbcBranchActual.hpp \
285        CbcBranchBase.hpp \
286        CbcBranchDynamic.hpp \
287        CbcBranchLotsize.hpp \
288        CbcBranchCut.hpp \
289        CbcCompareActual.hpp \
290        CbcCompareBase.hpp \
291        CbcCutGenerator.hpp \
292        CbcFathom.hpp \
293        CbcEventHandler.hpp \
294        CbcFeasibilityBase.hpp \
295        CbcHeuristic.hpp \
296        CbcHeuristicFPump.hpp \
297        CbcHeuristicGreedy.hpp \
298        CbcHeuristicLocal.hpp \
299        CbcHeuristicRINS.hpp \
300        CbcMessage.hpp \
301        CbcModel.hpp \
302        CbcNode.hpp \
303        CbcStrategy.hpp \
304        CbcTree.hpp \
305        CbcLinked.hpp \
306        CbcTreeLocal.hpp \
307        ClpConstraintAmpl.hpp \
308        ClpAmplObjective.hpp
309
310#############################################################################
311# Create the Config.h file that always defines HAVE_CONFIG_H and install it #
312#############################################################################
313
314# You only need to adapt the following line
315ConfigHeader = CbcConfig.h
316
317install-exec-local:
318        echo "#ifndef HAVE_CONFIG_H" >bla
319        echo "#define HAVE_CONFIG_H" >>bla
320        echo "#endif" >> bla
321        cat $(srcdir)/$(ConfigHeader) >> bla
322        $(install_sh_DATA) bla $(DESTDIR)$(includedir)/$(ConfigHeader)
323        rm -f bla
324
325uninstall-local:
326        rm -f $(DESTDIR)$(includedir)/$(ConfigHeader)
Note: See TracBrowser for help on using the repository browser.