xref: /trunk/ext_libraries/coinmp/makefile.mk (revision 079530e0cc63d88d2438d6ca375766814976df0e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22PRJ=.
23
24PRJNAME=coinmp
25TARGET=coinmp
26
27# --- Settings -----------------------------------------------------
28
29.INCLUDE :  settings.mk
30
31# --- Files --------------------------------------------------------
32
33.IF "$(ENABLE_COINMP)"!="YES"
34
35all:
36    @echo "CoinMP is disabled and will not be built."
37
38.ELIF "$(SYSTEM_COINMP)"=="YES"
39
40all:
41    @echo "Using system CoinMP.  Does not have to be built."
42
43.ELSE
44
45TARFILE_NAME=CoinMP-1.7.6
46TARFILE_MD5=1cce53bf4b40ae29790d2c5c9f8b1129
47
48PATCH_FILES=coinmp-1.7.6.patch coinmp-1.7.6-clang.patch coinmp-1.7.6-clang-1.8.patch coinmp-1.7.6-nopedantic.patch
49.IF "$(OS)"=="OS2"
50PATCH_FILES+=coinmp-1.6.0-os2.patch
51.ENDIF
52
53.IF "$(COM)$(CPU)"=="MSCI"
54BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv CoinMP\\MSVisualStudio\\v9\\CoinMP.sln "Release|Win32"
55.ELIF "$(COM)$(CPU)"=="MSCX"
56BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv CoinMP\\MSVisualStudio\\v9\\CoinMP.sln "Release|x64"
57.ELSE
58CONFIGURE_ACTION=./configure
59#CONFIGURE_FLAGS=--disable-pkg-config --disable-bzlib --disable-zlib CC='$(CC) $(ARCH_FLAGS)' CXX='$(CXX) $(ARCH_FLAGS)' CFLAGS='$(ARCH_FLAGS) -Wc,-arch -Wc,i386' CPPFLAGS='$(ARCH_FLAGS)' LDFLAGS='$(ARCH_FLAGS)' compiler_flags='$(ARCH_FLAGS)'
60CONFIGURE_FLAGS=--disable-pkg-config --with-blas=BUILD --with-lapack=BUILD --disable-bzlib --disable-zlib CC='$(CC) $(ARCH_FLAGS)' CXX='$(CXX) $(ARCH_FLAGS)'
61.IF "$(OS)"=="MACOSX"
62# Each CoinMP sub-library (Osi, Clp, ...) depends on symbols from its siblings
63# (CoinUtils, ...).  CoinMP's bundled 2013-era libtool only adds the Darwin
64# "-undefined dynamic_lookup" escape hatch for MACOSX_DEPLOYMENT_TARGET=10.x;
65# at 11.0+ (Apple Silicon baseline) that case falls through, leaving the flag
66# empty, so each .dylib is linked with unresolved sibling symbols and the
67# two-level-namespace linker rejects it ("symbol(s) not found for arm64").
68# --enable-dependency-linking makes the inter-library dependencies explicit on
69# each link line (and sets -no-undefined), which is the correct fix.
70CONFIGURE_FLAGS+=--enable-dependency-linking
71.ENDIF
72#BUILD_ACTION= CC="$(CC) $(ARCH_FLAGS)" CPP="$(CXX) $(ARCH_FLAGS)" $(GNUMAKE) -j8
73BUILD_ACTION= $(GNUMAKE) -j$(MAXPROCESS)
74.ENDIF
75
76.IF "$(OS)"=="OS2"
77CONFIGURE_FLAGS+= --disable-shared --enable-static
78.ENDIF
79
80OUT2INC+=CoinMP$/src/CoinMP.h
81
82.IF "$(OS)$(CPU)"=="WNTI"
83OUT2BIN+=CoinMP$/MSVisualStudio$/v9$/release$/CoinMP.dll
84OUT2LIB+=CoinMP$/MSVisualStudio$/v9$/release$/CoinMP.lib
85.ELIF "$(OS)$(CPU)"=="WNTX"
86OUT2BIN+=CoinMP$/MSVisualStudio$/v9$/x64$/Release$/CoinMP.dll
87OUT2LIB+=CoinMP$/MSVisualStudio$/v9$/x64$/Release$/CoinMP.lib
88.ELIF "$(OS)"=="OS2"
89OUT2BIN+=CoinMP$/src$/CoinMP.dll
90OUT2LIB+=CoinMP$/src$/.libs/CoinMP.lib
91.ELSE
92OUT2LIB+=CoinMP$/src$/.libs$/libCoinMP*$(DLLPOST)*
93OUT2LIB+=CoinUtils$/src$/.libs$/libCoinUtils*$(DLLPOST)*
94OUT2LIB+=Cbc$/src$/.libs$/libCbc*$(DLLPOST)*
95OUT2LIB+=Cbc$/src$/OsiCbc$/.libs$/libOsiCbc*$(DLLPOST)*
96OUT2LIB+=Cgl$/src$/.libs$/libCgl*$(DLLPOST)*
97OUT2LIB+=Clp$/src$/.libs$/libClp*$(DLLPOST)*
98OUT2LIB+=Clp$/src$/OsiClp$/.libs$/libOsiClp*$(DLLPOST)*
99OUT2LIB+=Osi$/src$/Osi$/.libs$/libOsi*$(DLLPOST)*
100.ENDIF
101
102
103
104# --- Targets ------------------------------------------------------
105
106.INCLUDE : set_ext.mk
107.INCLUDE : target.mk
108.INCLUDE : tg_ext.mk
109
110.ENDIF
111