more cleaning on makefiles

This commit is contained in:
lperron@google.com
2012-03-28 00:26:48 +00:00
parent 6a42842ec2
commit 42949fd564
8 changed files with 59 additions and 54 deletions

View File

@@ -12,24 +12,28 @@ OR_TOOLS_VERSION = 1.0.0
# OR_ROOT is the minimal prefix to define the root of or-tools, if we
# are compiling in the or-tools root, it is empty. Otherwise, it is
# $(TOP)/ or $(TOP)\\ depending on the platform.
# $(TOP)/ or $(TOP)\\ depending on the platform. It contains the
# trailing separator if not empty.
#
# OR_ROOT_INC is like OR_ROOT, but with a default of '.' instead of
# empty. It is used for instance in include directives (-I.).
#
# OR_ROOT_FULL is always the complete path to or-tools. It is useful
# to store path informations inside libraries for instance.
ifeq ($(TOP),)
OR_ROOT=
OR_ROOT_INC=.
OR_ROOT =
OR_ROOT_INC = .
else
ifeq "$(SHELL)" "cmd.exe"
OR_ROOT=$(TOP)\\
OR_ROOT = $(TOP)\\
else
ifeq "$(SHELL)" "sh.exe"
OR_ROOT=$(TOP)\\
OR_ROOT = $(TOP)\\
else
OR_ROOT=$(TOP)/
OR_ROOT = $(TOP)/
endif
endif
OR_ROOT_INC=$(TOP)
OR_ROOT_INC = $(TOP)
endif
.PHONY : python cc java csharp
@@ -38,6 +42,7 @@ clean: clean_cc clean_java clean_python clean_csharp
# First, we try to detect the platform.
include $(OR_ROOT)makefiles/Makefile.port
OR_ROOT_FULL=$(TOP)
# We include predefined variables
include $(OR_ROOT)makefiles/Makefile.def

View File

@@ -37,9 +37,9 @@ clean_csharp:
# csharplp
ifeq ($(SYSTEM),win)
IMPORTPREFIX=$(TOP)\\bin\\
IMPORTPREFIX=$(OR_ROOT_FULL)\\bin\\
else
IMPORTPREFIX=$(TOP)/lib/lib
IMPORTPREFIX=$(OR_ROOT_FULL)/lib/lib
endif
csharplp: $(BINPREFIX)/Google.OrTools.LinearSolver.dll

View File

@@ -111,10 +111,10 @@ endif
rpy: $(OR_ROOT)lib/_pywraplp.$(SHAREDLIBEXT) $(OR_ROOT)lib/_pywrapcp.$(SHAREDLIBEXT) $(OR_ROOT)lib/_pywrapgraph.$(SHAREDLIBEXT) $(OR_ROOT)lib/_pywrapknapsack_solver.$(SHAREDLIBEXT) $(OR_ROOT)lib/_pywraprouting.$(SHAREDLIBEXT) $(OR_ROOT)python/$(EX).py
ifeq ($(SYSTEM),win)
@echo Running python$S$(EX).py
@set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)$Spython $(OR_ROOT)python$S$(EX).py
@set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)$Spython $(OR_ROOT)python$S$(EX).py
else
@echo Running python$S$(EX).py
@PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python$S$(EX).py
@PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python$S$(EX).py
endif

View File

@@ -9,12 +9,12 @@ test_cc: cc
$(OR_ROOT)bin/integer_programming
test_python: python
PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python/hidato_table.py
PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python/tsp.py
PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python/pyflow_example.py
PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python/knapsack.py
PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python/linear_programming.py
PYTHONPATH=$(TOP) python$(PYTHONVERSION) $(OR_ROOT)python/integer_programming.py
PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python/hidato_table.py
PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python/tsp.py
PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python/pyflow_example.py
PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python/knapsack.py
PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python/linear_programming.py
PYTHONPATH=$(OR_ROOT_FULL) python$(PYTHONVERSION) $(OR_ROOT)python/integer_programming.py
test_java: java run_RabbitsPheasants run_FlowExample run_LinearProgramming run_IntegerProgramming run_Knapsack

View File

@@ -9,12 +9,12 @@ test_cc: cc
$(BINPREFIX)\\tsp
test_python: python
set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)\\python $(TOP)\\python\\hidato_table.py
set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)\\python $(TOP)\\python\\tsp.py
set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)\\python $(TOP)\\python\\pyflow_example.py
set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)\\python $(TOP)\\python\\knapsack.py
set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)\\python $(TOP)\\python\\linear_programming.py
set PYTHONPATH=$(TOP) && $(WINDOWS_PYTHON_PATH)\\python $(TOP)\\python\\integer_programming.py
set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)\\python $(OR_ROOT)python\\hidato_table.py
set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)\\python $(OR_ROOT)python\\tsp.py
set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)\\python $(OR_ROOT)python\\pyflow_example.py
set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)\\python $(OR_ROOT)python\\knapsack.py
set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)\\python $(OR_ROOT)python\\linear_programming.py
set PYTHONPATH=$(OR_ROOT_FULL) && $(WINDOWS_PYTHON_PATH)\\python $(OR_ROOT)python\\integer_programming.py
test_java: java run_RabbitsPheasants run_FlowExample run_LinearProgramming run_IntegerProgramming run_Knapsack

View File

@@ -20,7 +20,7 @@ ifeq ($(wildcard dependencies/archives/ziboptsuite-$(SCIP_TAG).tgz),)
SCIP_MAKEFILE = # UNIX_SCIP_DIR support not included.
else
SCIP_TARGET = dependencies/install/ziboptsuite-$(SCIP_TAG)/scip-$(SCIP_TAG)/bin/scip
SCIP_MAKEFILE = UNIX_SCIP_DIR = $(TOP)/dependencies/install/ziboptsuite-$(SCIP_TAG)/scip-$(SCIP_TAG)
SCIP_MAKEFILE = UNIX_SCIP_DIR = $(OR_ROOT_FULL)/dependencies/install/ziboptsuite-$(SCIP_TAG)/scip-$(SCIP_TAG)
ifeq ($(PLATFORM), LINUX)
BUILD_SCIP = make ZIMPL=false READLINE=false USRCXXFLAGS=-fPIC CFLAGS=-fPIC
endif
@@ -35,7 +35,7 @@ ifeq ($(wildcard dependencies/archives/glpk-$(GLPK_TAG).tar.gz),)
GLPK_MAKEFILE = # GLPK support not included.
else
GLPK_TARGET = dependencies/install/bin/glpsol
GLPK_MAKEFILE = UNIX_GLPK_DIR = $(TOP)/dependencies/install
GLPK_MAKEFILE = UNIX_GLPK_DIR = $(OR_ROOT_FULL)/dependencies/install
endif
# Detect if mono archive is there
@@ -44,7 +44,7 @@ ifeq ($(wildcard dependencies/archives/mono-$(MONO_TAG).tar.bz2),)
MONO_MAKEFILE = # MONO support not included.
else
MONO_TARGET = dependencies/install/bin/gmcs
MONO_MAKEFILE = UNIX_MONO_DIR = $(TOP)/dependencies/install
MONO_MAKEFILE = UNIX_MONO_DIR = $(OR_ROOT_FULL)/dependencies/install
endif
@@ -71,7 +71,7 @@ dependencies/install/bin/gflags_completions.sh: dependencies/sources/gflags/Make
cd dependencies/sources/gflags && make install
dependencies/sources/gflags/Makefile: dependencies/sources/gflags/configure
cd dependencies/sources/gflags && ./configure --prefix=$(TOP)/dependencies/install
cd dependencies/sources/gflags && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install
dependencies/sources/gflags/configure: dependencies/sources/gflags/autogen.sh
cd dependencies/sources/gflags && ./autogen.sh
@@ -86,7 +86,7 @@ dependencies/install/bin/protoc: dependencies/sources/protobuf/Makefile
cd dependencies/sources/protobuf && make install
dependencies/sources/protobuf/Makefile: dependencies/sources/protobuf/configure
cd dependencies/sources/protobuf && ./configure --prefix=$(TOP)/dependencies/install
cd dependencies/sources/protobuf && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install
dependencies/sources/protobuf/configure: dependencies/sources/protobuf/autogen.sh
cd dependencies/sources/protobuf && ./autogen.sh
@@ -107,7 +107,7 @@ dependencies/install/include/google/dense_hash_map: dependencies/sources/sparseh
cd dependencies/sources/sparsehash && make install
dependencies/sources/sparsehash/Makefile: dependencies/sources/sparsehash/configure
cd dependencies/sources/sparsehash && ./configure --prefix=$(TOP)/dependencies/install
cd dependencies/sources/sparsehash && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install
dependencies/sources/sparsehash/configure: dependencies/sources/sparsehash/autogen.sh
cd dependencies/sources/sparsehash && ./autogen.sh
@@ -124,7 +124,7 @@ dependencies/install/bin/cbc: dependencies/sources/coin-cbc/Makefile
dependencies/sources/coin-cbc/Makefile:
svn co https://projects.coin-or.org/svn/Cbc/releases/$(CBC_TAG) dependencies/sources/coin-cbc
cd dependencies/sources/coin-cbc && ./configure --prefix=$(TOP)/dependencies/install --disable-bzlib --without-lapack
cd dependencies/sources/coin-cbc && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install --disable-bzlib --without-lapack
# Install pcre (dependency of SWIG).
install_pcre: dependencies/install/bin/pcretest
@@ -133,7 +133,7 @@ dependencies/install/bin/pcretest: dependencies/sources/pcre/Makefile
cd dependencies/sources/pcre && make install
dependencies/sources/pcre/Makefile: dependencies/sources/pcre/configure
cd dependencies/sources/pcre && ./configure --disable-shared --prefix=$(TOP)/dependencies/install
cd dependencies/sources/pcre && ./configure --disable-shared --prefix=$(OR_ROOT_FULL)/dependencies/install
dependencies/sources/pcre/configure: dependencies/sources/pcre/autogen.sh
cd dependencies/sources/pcre && ./autogen.sh
@@ -148,7 +148,7 @@ dependencies/install/bin/swig: dependencies/sources/swig/Makefile
cd dependencies/sources/swig && make && make install
dependencies/sources/swig/Makefile: dependencies/sources/swig/configure dependencies/install/bin/pcretest
cd dependencies/sources/swig && ./configure --prefix=$(TOP)/dependencies/install --with-pcre-prefix=$(TOP)/dependencies/install --disable-ccache
cd dependencies/sources/swig && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install --with-pcre-prefix=$(OR_ROOT_FULL)/dependencies/install --disable-ccache
dependencies/sources/swig/configure: dependencies/sources/swig/autogen.sh
cd dependencies/sources/swig && ./autogen.sh
@@ -163,7 +163,7 @@ dependencies/install/bin/glpsol: dependencies/sources/glpk-$(GLPK_TAG)/Makefile
cd dependencies/sources/glpk-$(GLPK_TAG) && make install
dependencies/sources/glpk-$(GLPK_TAG)/Makefile: dependencies/sources/glpk-$(GLPK_TAG)/configure
cd dependencies/sources/glpk-$(GLPK_TAG) && ./configure --prefix=$(TOP)/dependencies/install
cd dependencies/sources/glpk-$(GLPK_TAG) && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install
dependencies/sources/glpk-$(GLPK_TAG)/configure: dependencies/archives/glpk-$(GLPK_TAG).tar.gz
cd dependencies/sources && tar xvzmf ../archives/glpk-$(GLPK_TAG).tar.gz
@@ -182,9 +182,9 @@ dependencies/install/bin/gmcs: dependencies/sources/mono-$(MONO_TAG)/Makefile
dependencies/sources/mono-$(MONO_TAG)/Makefile: dependencies/sources/mono-$(MONO_TAG)/configure
ifeq ($(PLATFORM),MACOSX)
cd dependencies/sources/mono-$(MONO_TAG) && ./configure --prefix=$(TOP)/dependencies/install --with-glib=embedded --enable-nls=no --host=x86_64-apple-darwin10
cd dependencies/sources/mono-$(MONO_TAG) && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install --with-glib=embedded --enable-nls=no --host=x86_64-apple-darwin10
else
cd dependencies/sources/mono-$(MONO_TAG) && ./configure --prefix=$(TOP)/dependencies/install
cd dependencies/sources/mono-$(MONO_TAG) && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install
endif
dependencies/sources/mono-$(MONO_TAG)/configure: dependencies/archives/mono-$(MONO_TAG).tar.bz2
@@ -207,12 +207,12 @@ install_python_modules:
Makefile.local:
@echo Generating Makefile.local
@echo UNIX_PYTHON_VER = $(PYTHONVERSION) > Makefile.local
@echo UNIX_GFLAGS_DIR = $(TOP)/dependencies/install >> Makefile.local
@echo UNIX_PROTOBUF_DIR = $(TOP)/dependencies/install >> Makefile.local
@echo UNIX_SPARSEHASH_DIR = $(TOP)/dependencies/install >> Makefile.local
@echo UNIX_SWIG_BINARY = $(TOP)/dependencies/install/bin/swig >> Makefile.local
@echo UNIX_CLP_DIR = $(TOP)/dependencies/install >> Makefile.local
@echo UNIX_CBC_DIR = $(TOP)/dependencies/install >> Makefile.local
@echo UNIX_GFLAGS_DIR = $(OR_ROOT_FULL)/dependencies/install >> Makefile.local
@echo UNIX_PROTOBUF_DIR = $(OR_ROOT_FULL)/dependencies/install >> Makefile.local
@echo UNIX_SPARSEHASH_DIR = $(OR_ROOT_FULL)/dependencies/install >> Makefile.local
@echo UNIX_SWIG_BINARY = $(OR_ROOT_FULL)/dependencies/install/bin/swig >> Makefile.local
@echo UNIX_CLP_DIR = $(OR_ROOT_FULL)/dependencies/install >> Makefile.local
@echo UNIX_CBC_DIR = $(OR_ROOT_FULL)/dependencies/install >> Makefile.local
@echo $(GLPK_MAKEFILE) >> Makefile.local
@echo $(SCIP_MAKEFILE) >> Makefile.local
@echo $(MONO_MAKEFILE) >> Makefile.local

View File

@@ -18,7 +18,7 @@ ifeq ($(wildcard dependencies/archives/ziboptsuite-$(SCIP_TAG).tgz),)
SCIP_MAKEFILE = \# WINDOWS_SCIP_DIR support not included.
else
SCIP_TARGET = dependencies/install/ziboptsuite-$(SCIP_TAG)/scip-$(SCIP_TAG)/bin/scip
SCIP_MAKEFILE = WINDOWS_SCIP_DIR = $(TOP)/dependencies/install/ziboptsuite-2.1.0/scip-2.1.0
SCIP_MAKEFILE = WINDOWS_SCIP_DIR = $(OR_ROOT_FULL)/dependencies/install/ziboptsuite-2.1.0/scip-2.1.0
ifeq ($(PLATFORM), LINUX)
BUILD_SCIP = make ZIMPL=false READLINE=false USRCXXFLAGS=-fPIC CFLAGS=-fPIC
endif
@@ -33,7 +33,7 @@ ifeq ($(wildcard dependencies/archives/glpk-$(GLPK_TAG).tar.gz),)
GLPK_MAKEFILE = \# GLPK support not included.
else
GLPK_TARGET = dependencies\install\bin\glpsol.exe
GLPK_MAKEFILE = WINDOWS_GLPK_DIR = $(TOP)\\dependencies\\install
GLPK_MAKEFILE = WINDOWS_GLPK_DIR = $(OR_ROOT_FULL)\\dependencies\\install
endif
# Main target.
.PHONY: third_party build_third_party makefile_third_party
@@ -162,7 +162,7 @@ dependencies\install\include\google\dense_hash_map: dependencies\sources\sparseh
cd dependencies\sources\sparsehash && make install
dependencies\sources\sparsehash\Makefile: dependencies\sources\sparsehash\configure
cd dependencies\sources\sparsehash && ./configure --prefix=$(TOP)/dependencies/install
cd dependencies\sources\sparsehash && ./configure --prefix=$(OR_ROOT_FULL)/dependencies/install
dependencies\sources\sparsehash\configure: dependencies\sources\sparsehash\autogen.sh
cd dependencies\sources\sparsehash && ./autogen.sh
@@ -241,14 +241,14 @@ install_python_modules:
Makefile.local:
@echo Generating Makefile.local
@echo WINDOWS_ZLIB_DIR = $(TOP)\\dependencies\\install> Makefile.local
@echo WINDOWS_ZLIB_DIR = $(OR_ROOT_FULL)\\dependencies\\install> Makefile.local
@echo WINDOWS_ZLIB_NAME=zlib.lib>> Makefile.local
@echo WINDOWS_GFLAGS_DIR = $(TOP)\\dependencies\\install>> Makefile.local
@echo WINDOWS_PROTOBUF_DIR = $(TOP)\\dependencies\\install>> Makefile.local
@echo WINDOWS_SPARSEHASH_DIR = $(TOP)\\dependencies\\install>> Makefile.local
@echo WINDOWS_SWIG_BINARY = $(TOP)\\dependencies\\install\\swigwin-2.0.4\\swig.exe>> Makefile.local
@echo WINDOWS_CLP_DIR = $(TOP)\\dependencies\\install>> Makefile.local
@echo WINDOWS_CBC_DIR = $(TOP)\\dependencies\\install>> Makefile.local
@echo WINDOWS_GFLAGS_DIR = $(OR_ROOT_FULL)\\dependencies\\install>> Makefile.local
@echo WINDOWS_PROTOBUF_DIR = $(OR_ROOT_FULL)\\dependencies\\install>> Makefile.local
@echo WINDOWS_SPARSEHASH_DIR = $(OR_ROOT_FULL)\\dependencies\\install>> Makefile.local
@echo WINDOWS_SWIG_BINARY = $(OR_ROOT_FULL)\\dependencies\\install\\swigwin-2.0.4\\swig.exe>> Makefile.local
@echo WINDOWS_CLP_DIR = $(OR_ROOT_FULL)\\dependencies\\install>> Makefile.local
@echo WINDOWS_CBC_DIR = $(OR_ROOT_FULL)\\dependencies\\install>> Makefile.local
@echo $(GLPK_MAKEFILE)>> Makefile.local
@echo $(SELECTED_JDK_DEF)>> Makefile.local
@echo WINDOWS_PYTHON_VERSION = \# Please define the python version (27 by default)>> Makefile.local

View File

@@ -106,7 +106,7 @@ ifeq ($(PLATFORM),LINUX)
LIBSUFFIX = so
LINKCMD = g++ -shared
LINKPREFIX = -o # Need the space.
PRE_LIB = -Wl,-rpath $(TOP)/lib -L$(TOP)/lib -l
PRE_LIB = -Wl,-rpath $(OR_ROOT_FULL)/lib -L$(OR_ROOT_FULL)/lib -l
POST_LIB =
endif # LINUX
ifeq ($(PLATFORM),MACOSX)
@@ -131,7 +131,7 @@ ifeq ($(PLATFORM),MACOSX)
JAVA_BIN = java
JAR_BIN = jar
PRE_LIB = -L$(TOP)/lib -l
PRE_LIB = -L$(OR_ROOT_FULL)/lib -l
POST_LIB =
LIBSUFFIX = dylib
LINKCMD = ld -arch x86_64 -dylib -flat_namespace -undefined suppress -macosx_version_min 10.6 -lSystem -compatibility_version 1.0 -current_version $(OR_TOOLS_VERSION)
@@ -167,7 +167,7 @@ SWIG_BINARY = $(UNIX_SWIG_BINARY)
MKDIR=mkdir
COPY=cp
TOUCH=touch
LIBPREFIX = $(OR_ROOT)lib/lib
LIBPREFIX = $(OR_ROOT_FULL)/lib/lib
BINPREFIX = $(OR_ROOT)bin
O = o
E =