source: trunk/Cbc/src/Makefile.am @ 319

Last change on this file since 319 was 319, checked in by andreasw, 13 years ago

added --enable-gnu-packages flag; third party solvers need to be provided with link flags

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 8.9 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 319 2006-05-15 19:20:53Z andreasw $
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        CbcBranchActual.cpp CbcBranchActual.hpp \
22        CbcBranchBase.cpp CbcBranchBase.hpp \
23        CbcBranchCut.cpp CbcBranchCut.hpp \
24        CbcBranchDynamic.cpp CbcBranchDynamic.hpp \
25        CbcBranchLotsize.cpp CbcBranchLotsize.hpp \
26        CbcCompareActual.cpp CbcCompareActual.hpp \
27        CbcCompareBase.hpp \
28        CbcCountRowCut.cpp CbcCountRowCut.hpp \
29        CbcCutGenerator.cpp CbcCutGenerator.hpp \
30        CbcEventHandler.cpp CbcEventHandler.hpp \
31        CbcFathom.cpp CbcFathom.hpp \
32        CbcFathomDynamicProgramming.cpp CbcFathomDynamicProgramming.hpp \
33        CbcFeasibilityBase.hpp \
34        CbcHeuristic.cpp CbcHeuristic.hpp \
35        CbcHeuristicFPump.cpp CbcHeuristicFPump.hpp \
36        CbcHeuristicGreedy.cpp CbcHeuristicGreedy.hpp \
37        CbcHeuristicLocal.cpp CbcHeuristicLocal.hpp \
38        CbcMessage.cpp CbcMessage.hpp \
39        CbcModel.cpp CbcModel.hpp \
40        CbcNode.cpp CbcNode.hpp \
41        CbcStatistics.cpp CbcStatistics.hpp \
42        CbcStrategy.cpp CbcStrategy.hpp \
43        CbcTree.cpp CbcTree.hpp \
44        CbcTreeLocal.cpp CbcTreeLocal.hpp
45
46# This is for libtool (on Windows)
47libCbc_la_LDFLAGS = -no-undefined
48
49########################################################################
50#                            cbc program                               #
51########################################################################
52
53# Name of the executable compiled in this directory.  We want it to be
54# installed in the 'bin' directory
55bin_PROGRAMS = cbc
56
57# List all source files for this executable, including headers
58cbc_SOURCES = \
59        CbcMain.cpp \
60        CbcParam.cpp CbcParam.hpp \
61        unitTest.cpp
62
63# The following file is not to be distributed, since it is "borrowed" from Clp
64nodist_cbc_SOURCES = CbcOrClpParam.cpp
65
66cbc_LDADD = libCbc.la \
67        $(CGLOBJDIR)/src/libCgl.la \
68        $(OSIOBJDIR)/src/OsiCbc/libOsiCbc.la
69CXXFLAGS += -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiCbc`
70
71# List all additionally required solver and Osi libraries
72if COIN_HAS_CLP
73  CXXFLAGS += -I`$(CYGPATH_W) $(CLPSRCDIR)/src` \
74        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp` \
75        -I`$(CYGPATH_W) $(CLPOBJDIR)/inc`
76  cbc_LDADD += $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
77        $(CLPOBJDIR)/src/libClp.la
78  LIBS  += `cat $(CLPOBJDIR)/clp_addlibs.txt`
79endif
80
81if COIN_HAS_CPX
82  CXXFLAGS += -I`$(CYGPATH_W) $(CPXINCDIR)` \
83        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiCpx`
84  cbc_LDADD += $(OSIOBJDIR)/src/OsiCpx/libOsiCpx.la
85endif
86
87if COIN_HAS_DYLP
88  CXXFLAGS += -I`$(CYGPATH_W) $(DYLPSRCDIR)/src` \
89        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiDylp`
90  cbc_LDADD += $(OSIOBJDIR)/src/OsiDylp/libOsiDylp.la \
91        $(DYLPOBJDIR)/src/libDylp.la
92  LIBS += `cat $(DYLPOBJDIR)/dylp_addlibs.txt`
93endif
94
95if COIN_HAS_FMP
96  CXXFLAGS += -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiFmp`
97  cbc_LDADD += $(OSIOBJDIR)/src/OsiFmp/libOsiFmp.la
98endif
99
100if COIN_HAS_GLPK
101  CXXFLAGS += -I`$(CYGPATH_W) $(GLPKINCDIR)` \
102        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiGlpk`
103  cbc_LDADD += $(OSIOBJDIR)/src/OsiGlpk/libOsiGlpk.la
104endif
105
106if COIN_HAS_MSK
107  CXXFLAGS += -I`$(CYGPATH_W) $(MSKINCDIR)` \
108        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiMsk`
109  cbc_LDADD += $(OSIOBJDIR)/src/OsiMsk/libOsiMsk.la
110endif
111
112if COIN_HAS_OSL
113  CXXFLAGS += -I`$(CYGPATH_W) $(OSLINCDIR)` \
114        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiOsl`
115  cbc_LDADD += $(OSIOBJDIR)/src/OsiOsl/libOsiOsl.la
116endif
117
118if COIN_HAS_SPX
119  CXXFLAGS += -I`$(CYGPATH_W) $(SPXINCDIR)` \
120        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiSpx`
121  cbc_LDADD += $(OSIOBJDIR)/src/OsiSpx/libOsiSpx.la
122endif
123
124if COIN_HAS_SYM
125  CXXFLAGS += -I`$(CYGPATH_W) $(SYMSRCDIR)/src` \
126        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiSym`
127  cbc_LDADD += $(OSIOBJDIR)/src/OsiSym/libOsiSym.la \
128        $(SYMOBJDIR)/src/libSym.la
129  LIBS += `cat $(SYMOBJDIR)/sym_addlibs.txt`
130endif
131
132if COIN_HAS_VOL
133  CXXFLAGS += -I`$(CYGPATH_W) $(VOLSRCDIR)/src` \
134        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiVol`
135  cbc_LDADD += $(OSIOBJDIR)/src/OsiVol/libOsiVol.la \
136        $(VOLOBJDIR)/src/libVol.la
137  LIBS += `cat $(VOLOBJDIR)/vol_addlibs.txt`
138endif
139
140if COIN_HAS_XPR
141  CXXFLAGS += -I`$(CYGPATH_W) $(XPRINCDIR)` \
142        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiXpr`
143  cbc_LDADD += $(OSIOBJDIR)/src/OsiXpr/libOsiXpr.la
144endif
145
146# Finally the Osi Coin library (many of the above need it)
147cbc_LDADD += $(OSIOBJDIR)/src/libOsi.la \
148        $(COINUTILSOBJDIR)/src/libCoinUtils.la
149LIBS += `cat $(OSIOBJDIR)/osi_addlibs.txt` \
150        `cat $(COINUTILSOBJDIR)/coinutils_addlibs.txt` $(ADDLIBS)
151
152# Finally, the -rpath flag is used by libtool to make sure that the shared
153# library is found (in the lib install directory) when we are using dynamic
154# libraries.
155cbc_LDFLAGS = -rpath $(libdir)
156
157########################################################################
158#                           solve program                              #
159########################################################################
160
161#ToDo: I'm not sure if I'm doing the right thing here
162
163# Name of the executable compiled in this directory.  We want it to be
164# installed in the 'bin' directory
165bin_PROGRAMS += solve
166
167# List all source files for this executable, including headers
168solve_SOURCES = \
169        CoinSolve.cpp \
170        Cbc_ampl.cpp Cbc_ampl.h \
171        unitTestClp.cpp
172
173# The following file is not to be distributed, since it is "borrowed" from Clp
174nodist_solve_SOURCES = CbcOrClpParam.cpp
175
176# Additional COIN libraries
177solve_LDADD = libCbc.la \
178        $(CGLOBJDIR)/src/libCgl.la \
179        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
180        $(OSIOBJDIR)/src/libOsi.la \
181        $(CLPOBJDIR)/src/libClp.la \
182        $(COINUTILSOBJDIR)/src/libCoinUtils.la
183
184# Finally, the -rpath flag is used by libtool to make sure that the shared
185# library is found (in the lib install directory) when we are using dynamic
186# libraries.
187solve_LDFLAGS = -rpath $(libdir)
188
189########################################################################
190#                            Additional flags                          #
191########################################################################
192
193# Here list all include flags, relative to this "srcdir" directory.  This
194# "cygpath" stuff is necessary to compile with native compilers on Windows.
195# "top_srcdir" refers to the basic directory for the main package that is
196# being compiled.
197CXXFLAGS += \
198        -I`$(CYGPATH_W) $(CGLSRCDIR)/src` \
199        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglClique` \
200        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglFlowCover` \
201        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglGomory` \
202        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglKnapsackCover` \
203        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglMixedIntegerRounding` \
204        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglMixedIntegerRounding2` \
205        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglOddHole` \
206        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglPreProcess` \
207        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglProbing` \
208        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglRedSplit` \
209        -I`$(CYGPATH_W) $(CGLSRCDIR)/src/CglTwomir` \
210        -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src` \
211        -I`$(CYGPATH_W) $(OSISRCDIR)/src`
212
213# List additional defines
214DEFS += -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG
215
216########################################################################
217#                Headers that need to be installed                     #
218########################################################################
219
220# Here list all the header files that are required by a user of the library,
221# and that therefore should be installed in 'install'
222include_HEADERS = \
223        CbcBranchActual.hpp \
224        CbcBranchBase.hpp \
225        CbcCompareActual.hpp \
226        CbcCompareBase.hpp \
227        CbcCutGenerator.hpp \
228        CbcEventHandler.hpp \
229        CbcHeuristic.hpp \
230        CbcHeuristicFPump.hpp \
231        CbcHeuristicGreedy.hpp \
232        CbcHeuristicLocal.hpp \
233        CbcMessage.hpp \
234        CbcModel.hpp \
235        CbcNode.hpp \
236        CbcStrategy.hpp \
237        CbcTree.hpp \
238        CbcTreeLocal.hpp
239
240########################################################################
241#     Generating the configure header that is to be distributed        #
242########################################################################
243
244CONFIG_DIST = CbcConfig.hpp
245CONFIG_H = config_cbc.h
246$(libCbc_la_OBJECTS) $(cbc_OBJECTS) $(solve_OBJECTS): ../inc/$(CONFIG_DIST)
247
248nodist_include_HEADERS = ../inc/$(CONFIG_DIST)
249
250../inc/$(CONFIG_DIST): ../inc/$(CONFIG_H)
251        echo "/** Required defines from $(CONFIG_H) */" >bla.tmp
252        echo "#ifndef __$(CONFIG_DIST)__" | sed -e 's/\./_/g' >>bla.tmp
253        echo "#define __$(CONFIG_DIST)__" | sed -e 's/\./_/g' >>bla.tmp
254        $(EGREP) 'COIN_|CBC_DEFAULT_SOLVER' $< >>bla.tmp
255        echo "#endif" >>bla.tmp
256        if test -r ../inc/$(CONFIG_DIST); then \
257          if diff ../inc/$(CONFIG_DIST) bla.tmp >/dev/null 2>&1 ; then \
258            rm -f bla.tmp; \
259          else \
260            rm -f ../inc/$(CONFIG_DIST); \
261            mv bla.tmp ../inc/$(CONFIG_DIST); \
262          fi; \
263        else \
264          mv bla.tmp ../inc/$(CONFIG_DIST); \
265        fi
266
267CLEANFILES = bla.tmp
268
269DISTCLEANFILES = ../inc/$(CONFIG_DIST)
Note: See TracBrowser for help on using the repository browser.