source: branches/devel/Bonmin/experimental/Bcp/Makefile.am @ 136

Last change on this file since 136 was 136, checked in by ladanyi, 13 years ago

fix linking for bonminbcp

  • Property svn:eol-style set to native
  • Property svn:keywords set to Authors Date Id Revision
File size: 4.4 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 136 2006-11-28 21:25:16Z ladanyi $
6
7AUTOMAKE_OPTIONS = foreign
8
9# What is done in this directory:
10
11bin_PROGRAMS = bonminbcp
12
13########################################################################
14
15COINLIBS = \
16        $(BCPOBJDIR)/src/libBcp.la \
17        $(CBCOBJDIR)/src/libCbc.la \
18        $(CGLOBJDIR)/src/libCgl.la \
19        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
20        $(OSIOBJDIR)/src/libOsi.la \
21        $(CLPOBJDIR)/src/libClp.la \
22        $(COINUTILSOBJDIR)/src/libCoinUtils.la
23
24if COIN_HAS_CPX
25  COINLIBS += \
26        $(OSIOBJDIR)/src/OsiCpx/libOsiCpx.la \
27        $(CPXLIB)
28endif
29
30IPOPTLIBS = \
31        $(IPOPTOBJDIR)/src/Interfaces/libipopt.la
32
33LIBS += `cat $(IPOPTOBJDIR)/src/Interfaces/ipopt_addlibs_cpp.txt` \
34        `cat $(BCPOBJDIR)/bcp_addlibs.txt` \
35        `cat $(CBCOBJDIR)/cbc_addlibs.txt` \
36        `cat $(CGLOBJDIR)/cgl_addlibs.txt` \
37        `cat $(OSIOBJDIR)/osi_addlibs.txt` \
38        `cat $(CLPOBJDIR)/clp_addlibs.txt` \
39        `cat $(COINUTILSOBJDIR)/coinutils_addlibs.txt`
40
41########################################################################
42#                                bonminbcp                                #
43########################################################################
44
45bonminbcp_SOURCES = BB_cut.hpp BM.hpp \
46        BB_cut.cpp BM.cpp BM_tm.cpp BM_lp.cpp BM_lp_branch.cpp BM_pack.cpp
47
48bonminbcp_DEPENDENCIES = amplsolver.a
49
50AMPL_PATHED_FILES = \
51        asl.h \
52        jac0dim.c \
53        misc.c \
54        pfg_read.c
55AMPL_SRC = $(abs_source_dir)/../ThirdParty/ASL/solvers
56
57amplsolver.a:
58        rm -rf solvers
59        mkdir -p solvers ; \
60        cd solvers ; \
61        for f in $(AMPL_SRC)/*.c* $(AMPL_SRC)/*.h* $(AMPL_SRC)/makefile.u; do \
62                $(LN_S) $$f ; \
63        done ; \
64        for f in $(AMPL_PATHED_FILES); do \
65                rm $$f ; \
66                cp $(AMPL_SRC)/$$f . ; \
67        done ; \
68        patch -p1 < $(abs_source_dir)/experimental/Bcp/ampl_bcp.patch ; \
69        for f in `grep -l 'strtod' *.c *.h`; do \
70                mv $$f $$f.orig ; \
71                sed -e 's/strtod/ASLstrtod/g' -e 's/ASLASLstrtod/ASLstrtod/g' $$f.orig > $$f ; \
72                rm $$f.orig ; \
73        done ; \
74        for f in `grep -l 'atof(' *.c`; do \
75                mv $$f $$f.orig ; \
76                sed -e 's/atof/ASLatof/g' -e 's/ASLASLatof/ASLatof/g' $$f.orig > $$f ; \
77                rm $$f.orig ; \
78        done ; \
79        rm -f aslflags.txt ; \
80        grep ASLMAKEFLAGS ../../../../ThirdParty/ASL/config.log | tail -1 > aslflags.txt ; \
81        cat aslflags.txt ; \
82        eval `sed -e "s/ CFLAGS=\".*\"//" aslflags.txt`; \
83        eval `sed -e "s/.*CFLAGS=\"\(.*\)\".*/CFLAGS=\"-DNO_FUNCADD \1\"/" aslflags.txt` ; \
84        if test x"$$CC" = x; then \
85                CC=cc ; \
86        fi; \
87        $(MAKE) CC="$$CC" $$ASLMAKEFLAGS CFLAGS="$$CFLAGS" -f makefile.u ; \
88        cp amplsolver.a ..
89
90bonminbcp_LDADD = \
91        ../../src/Apps/libbonmin.la \
92        ../../src/Interfaces/Ampl/libamplinterface.la \
93        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
94        $(IPOPTLIBS) \
95        $(LIBCBCCOPY) \
96        $(COINLIBS) \
97        amplsolver.a \
98        $(ADDLIBS)
99
100# Finally, the -rpath flag is used by libtool to make sure that the shared
101# library is found (in the lib install directory) when we are using dynamic
102# libraries.
103bonminbcp_LDFLAGS = -rpath $(libdir)
104
105# Here list all include flags, relative to this "srcdir" directory.  This
106# "cygpath" stuff is necessary to compile with native compilers on Windows
107AM_CPPFLAGS = \
108        -I`$(CYGPATH_W) $(srcdir)/../../src/OaAlgorithms` \
109        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces` \
110        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ipopt` \
111        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ampl` \
112        -I`$(CYGPATH_W) $(srcdir)/../../src/CbcBonmin` \
113        -I`$(CYGPATH_W) $(IPOPTOBJDIR)/inc` \
114        -I`$(CYGPATH_W) $(IPOPTSRCDIR)/src/Common` \
115        -I`$(CYGPATH_W) $(IPOPTSRCDIR)/src/Interfaces` \
116        -I`$(CYGPATH_W) $(IPOPTSRCDIR)/src/LinAlg` \
117        -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src` \
118        -I`$(CYGPATH_W) $(COINUTILSOBJDIR)/inc` \
119        -I`$(CYGPATH_W) $(CBCSRCDIR)/src` \
120        -I`$(CYGPATH_W) $(CLPSRCDIR)/src` \
121        -I`$(CYGPATH_W) $(CLPOBJDIR)/inc` \
122        -I`$(CYGPATH_W) $(OSISRCDIR)/src` \
123        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp` \
124        -I`$(CYGPATH_W) $(CGLSRCDIR)/src` \
125        -I`$(CYGPATH_W) $(BCPSRCDIR)/src/include`
126
127if COIN_HAS_CPX
128  AM_CPPFLAGS += \
129        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiCpx` \
130        -I`$(CYGPATH_W) $(CPXINCDIR)`
131endif
132
133# This line is necessary to allow VPATH compilation with MS compilers
134# on Cygwin
135DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
136
137########################################################################
138#                         make distclean stuff                         #
139########################################################################
140
141CLEANFILES = $(LIBCBCCOPY) amplsolver.a
142
143DISTCLEANFILES =
Note: See TracBrowser for help on using the repository browser.