regroup system detection in Makefile.port
This commit is contained in:
14
Makefile
14
Makefile
@@ -9,18 +9,10 @@ help:
|
||||
|
||||
all: cplibs cpexe pycp javacp algorithmslibs pyalgorithms javaalgorithms graphlibs pygraph javagraph lplibs lpexe pylp javalp
|
||||
|
||||
# Let's discover something about where we run
|
||||
ifeq "$(SHELL)" "cmd.exe"
|
||||
SYSTEM=win
|
||||
else
|
||||
ifeq "$(SHELL)" "sh.exe"
|
||||
SYSTEM=win
|
||||
else
|
||||
SYSTEM=unix
|
||||
endif
|
||||
endif
|
||||
# First, we try to detect the platform.
|
||||
include Makefile.port
|
||||
|
||||
# First, we include predefined variables
|
||||
# We include predefined variables
|
||||
include Makefile.def
|
||||
|
||||
# Then we overwrite the local ones if the Makefile.local file exists.
|
||||
|
||||
12
Makefile.def
12
Makefile.def
@@ -23,17 +23,7 @@ UNIX_PROTOBUF_DIR=../protobuf-2.4.1
|
||||
#UNIX_SCIP_DIR=../ziboptsuite-2.1.0/scip-2.1.0
|
||||
|
||||
# Linux jdk root
|
||||
# first, determine 32 or 64 bits.
|
||||
ifeq "$(SYSTEM)" "unix"
|
||||
LBITS := $(shell getconf LONG_BIT)
|
||||
ifeq ($(LBITS),64)
|
||||
JDK_EXT=64
|
||||
else
|
||||
JDK_EXT=32
|
||||
endif
|
||||
endif
|
||||
|
||||
LINUX_JDK_ROOT=/usr/local/buildtools/java/jdk-$(JDK_EXT)
|
||||
LINUX_JDK_ROOT=/usr/local/buildtools/java/jdk-$(PTRLENGTH)
|
||||
# Include files path for java on mac os X
|
||||
MAC_JDK_HEADERS=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/include
|
||||
#MAC_JDK_HEADERS=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bundle/Headers
|
||||
|
||||
34
Makefile.port
Normal file
34
Makefile.port
Normal file
@@ -0,0 +1,34 @@
|
||||
# Useful variable.
|
||||
TOP ?= $(shell pwd)
|
||||
OS = $(shell uname -s)
|
||||
|
||||
# Let's discover something about where we run
|
||||
ifeq "$(SHELL)" "cmd.exe"
|
||||
SYSTEM=win
|
||||
else
|
||||
ifeq "$(SHELL)" "sh.exe"
|
||||
SYSTEM=win
|
||||
PLATFORM=WINDOWS
|
||||
else
|
||||
SYSTEM=unix
|
||||
ifeq ($(OS),Linux)
|
||||
PLATFORM=LINUX
|
||||
LBITS : = $(shell getconf LONG_BIT)
|
||||
ifeq ($(LBITS),64)
|
||||
PTRLENGTH=64
|
||||
else
|
||||
PTRLENGTH=32
|
||||
endif
|
||||
endif
|
||||
ifeq ($(OS),Darwin) # Assume Mac Os X
|
||||
PLATFORM=MACOSX
|
||||
PTRLENGTH=64
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
printport:
|
||||
@echo SHELL=$(SHELL)
|
||||
@echo SYSTEM=$(SYSTEM)
|
||||
@echo PLATFORM=$(PLATFORM)
|
||||
@echo PTRLENGTH=$(PTRLENGTH)
|
||||
@@ -5,22 +5,21 @@ GOOGLE_APPUTILS_TAG=11 # trunk
|
||||
CBC_TAG=2.7.5
|
||||
SWIG_TAG=rel-2.0.4
|
||||
|
||||
# Useful variable.
|
||||
TOP ?= $(shell pwd)
|
||||
|
||||
# Build extra dependencies (GLPK, SCIP) from archive only if the archive is present.
|
||||
GLPK_TAG=4.47 # The archive should be glpk-4.47.tar.gz
|
||||
SCIP_TAG=2.1.0 # The archive should be ziboptsuite-2.1.0.tgz
|
||||
# The archive should be glpk-4.47.tar.gz
|
||||
GLPK_TAG=4.47
|
||||
# The archive should be ziboptsuite-2.1.0.tgz
|
||||
SCIP_TAG=2.1.0
|
||||
|
||||
# Detect if scip archive is there.
|
||||
ifeq ($(wildcard dependencies/archives/ziboptsuite-$(SCIP_TAG).tgz),)
|
||||
SCIP_TARGET=
|
||||
else
|
||||
SCIP_TARGET=dependencies/install/ziboptsuite-$(SCIP_TAG)/scip-$(SCIP_TAG)/bin/scip
|
||||
ifeq ($(OS),Linux)
|
||||
ifeq ($(PLATFORM), LINUX)
|
||||
BUILD_SCIP=make ZIMPL=false READLINE=false USRCXXFLAGS=-fPIC CFLAGS=-fPIC
|
||||
endif
|
||||
ifeq ($(OS),Darwin) # Assume Mac Os X
|
||||
ifeq ($(PLATFORM), MACOSX)
|
||||
BUILD_SCIP=make ZIMPL=false READLINE=false ARCH=x86_64
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -59,7 +59,7 @@ UNIX_CLP_COIN = /coin
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS),Linux)
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
LD = gcc -shared
|
||||
# This is needed to find libgflags.a
|
||||
GFLAGS_LNK = -Wl,-rpath $(UNIX_GFLAGS_DIR)/lib -L$(UNIX_GFLAGS_DIR)/lib -lgflags
|
||||
@@ -79,9 +79,7 @@ endif
|
||||
ifdef UNIX_SCIP_DIR
|
||||
SCIP_LNK = -Wl,-rpath $(UNIX_SCIP_DIR)/lib -L$(UNIX_SCIP_DIR)/lib -lscip.$(SCIP_ARCH) -lnlpi.$(SCIP_ARCH) -llpispx.$(SCIP_ARCH) -lsoplex.$(SCIP_ARCH) -lreadline
|
||||
endif
|
||||
# Detect 32 bit or 64 bit OS and define ARCH and SCIP_ARCH flags correctly.
|
||||
LBITS : = $(shell getconf LONG_BIT)
|
||||
ifeq ($(LBITS),64)
|
||||
ifeq ($(PTRLENGTH),64)
|
||||
ARCH = -DARCH_K8
|
||||
SCIP_ARCH = linux.x86_64.gnu.opt
|
||||
else
|
||||
@@ -95,7 +93,7 @@ JAVA_BIN = $(LINUX_JDK_ROOT)/bin/java
|
||||
JAR_BIN = $(LINUX_JDK_ROOT)/bin/jar
|
||||
JNILIBEXT = so
|
||||
endif
|
||||
ifeq ($(OS),Darwin) # Assume Mac Os X
|
||||
ifeq ($(PLATFORM),MACOSX)
|
||||
LD = ld -arch x86_64 -bundle -flat_namespace -undefined suppress
|
||||
GFLAGS_LNK = -L$(UNIX_GFLAGS_DIR)/lib -lgflags
|
||||
ZLIB_LNK = -lz
|
||||
|
||||
Reference in New Issue
Block a user