2011-08-11 18:43:41 +00:00
|
|
|
# Top level declarations
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: help
|
|
|
|
|
help: help_all
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
|
all: build_all
|
|
|
|
|
|
2019-01-16 14:27:15 +01:00
|
|
|
.PHONY: check
|
|
|
|
|
check: check_all
|
|
|
|
|
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: test
|
|
|
|
|
test: test_all
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
clean: clean_all
|
|
|
|
|
|
|
|
|
|
.PHONY: detect
|
|
|
|
|
detect: detect_all
|
2011-08-11 18:43:41 +00:00
|
|
|
|
2012-03-28 00:09:22 +00:00
|
|
|
# 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
|
2012-03-28 15:10:00 +00:00
|
|
|
# $(OR_TOOLS_TOP)/ or $(OR_TOOLS_TOP)\\ depending on the platform. It
|
|
|
|
|
# contains the trailing separator if not empty.
|
2012-03-28 00:09:22 +00:00
|
|
|
#
|
2012-03-28 00:26:48 +00:00
|
|
|
# OR_ROOT_FULL is always the complete path to or-tools. It is useful
|
|
|
|
|
# to store path informations inside libraries for instance.
|
2012-03-28 04:57:54 +00:00
|
|
|
ifeq ($(OR_TOOLS_TOP),)
|
2012-03-28 00:26:48 +00:00
|
|
|
OR_ROOT =
|
2012-03-27 21:50:20 +00:00
|
|
|
else
|
2017-01-12 17:51:41 +01:00
|
|
|
ifeq ($(OS), Windows_NT)
|
2012-03-28 04:57:54 +00:00
|
|
|
OR_ROOT = $(OR_TOOLS_TOP)\\
|
2012-03-28 00:09:22 +00:00
|
|
|
else
|
2017-01-12 17:51:41 +01:00
|
|
|
OR_ROOT = $(OR_TOOLS_TOP)/
|
2012-03-28 00:09:22 +00:00
|
|
|
endif
|
2012-03-27 21:50:20 +00:00
|
|
|
endif
|
2012-01-13 10:28:29 +00:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
# Delete all implicit rules to speed up makefile
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
# Remove some rules from gmake that .SUFFIXES does not remove.
|
|
|
|
|
SUFFIXES =
|
|
|
|
|
|
|
|
|
|
# Keep all intermediate files
|
|
|
|
|
# ToDo: try to remove it later
|
|
|
|
|
.SECONDARY:
|
|
|
|
|
|
2017-06-07 10:26:41 +02:00
|
|
|
# Read version.
|
|
|
|
|
include $(OR_ROOT)Version.txt
|
|
|
|
|
|
2022-03-07 14:05:12 +01:00
|
|
|
# We try to detect the platform, and load system specific macros.
|
2017-07-31 09:45:30 -07:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.port.mk
|
2012-03-28 04:57:54 +00:00
|
|
|
OR_ROOT_FULL=$(OR_TOOLS_TOP)
|
2011-12-04 20:05:48 +00:00
|
|
|
|
2018-10-29 14:17:53 +01:00
|
|
|
# Check SOURCE argument
|
|
|
|
|
SOURCE_SUFFIX = $(suffix $(SOURCE))
|
|
|
|
|
# will contain “/any/path/foo.cc” on unix and “\\any\\path\\foo.cc” on windows
|
|
|
|
|
SOURCE_PATH = $(subst /,$S,$(SOURCE))
|
|
|
|
|
SOURCE_NAME= $(basename $(notdir $(SOURCE)))
|
|
|
|
|
ifeq ($(SOURCE),) # Those rules will be used if SOURCE is empty
|
|
|
|
|
.PHONY: build run
|
|
|
|
|
build run:
|
|
|
|
|
$(error no source file provided, the "$@" target must be used like so: \
|
|
|
|
|
make $@ SOURCE=relative/path/to/filename.extension)
|
|
|
|
|
else
|
|
|
|
|
ifeq (,$(wildcard $(SOURCE)))
|
|
|
|
|
$(error File "$(SOURCE)" does not exist !)
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2011-07-14 23:27:43 +00:00
|
|
|
# Include .mk files.
|
2022-02-22 10:46:37 +01:00
|
|
|
BUILT_LANGUAGES = C++
|
|
|
|
|
ifeq ($(BUILD_PYTHON),ON)
|
|
|
|
|
BUILT_LANGUAGES +=, Python$(PYTHON_VERSION)
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(BUILD_JAVA),ON)
|
|
|
|
|
BUILT_LANGUAGES +=, Java
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(BUILD_DOTNET),ON)
|
|
|
|
|
BUILT_LANGUAGES +=, .Net (6.0)
|
|
|
|
|
endif
|
|
|
|
|
|
2012-03-28 00:09:22 +00:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.cpp.mk
|
|
|
|
|
include $(OR_ROOT)makefiles/Makefile.python.mk
|
|
|
|
|
include $(OR_ROOT)makefiles/Makefile.java.mk
|
2018-04-24 02:40:11 -07:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.dotnet.mk
|
2016-07-01 13:21:14 +02:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.archive.mk
|
2022-03-07 14:05:12 +01:00
|
|
|
ifneq ($(PLATFORM),WIN64)
|
2019-06-13 13:46:16 +02:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.doc.mk
|
2020-01-31 15:21:03 +01:00
|
|
|
else
|
2020-02-05 08:13:54 +01:00
|
|
|
# Remove some rules on windows
|
2020-01-31 15:21:03 +01:00
|
|
|
help_doc:
|
|
|
|
|
|
|
|
|
|
endif
|
2011-03-31 08:39:26 +00:00
|
|
|
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: help_usage
|
|
|
|
|
help_usage:
|
|
|
|
|
@echo Use one of the following targets:
|
|
|
|
|
@echo help, help_all: Print this help.
|
2022-03-07 17:03:19 +01:00
|
|
|
@echo all: Build OR-Tools for all available languages.
|
2019-01-16 14:27:15 +01:00
|
|
|
@echo check, check_all: Check OR-Tools for all available languages.
|
2018-03-02 13:41:00 +01:00
|
|
|
@echo test, test_all: Test OR-Tools for all available languages.
|
|
|
|
|
@echo clean, clean_all: Clean output from previous build for all available languages \(won\'t clean third party\).
|
|
|
|
|
@echo detect, detect_all: Show variables used to build OR-Tools for all available languages.
|
2022-03-07 14:05:12 +01:00
|
|
|
ifeq ($(PLATFORM),WIN64)
|
2018-03-06 15:03:19 +01:00
|
|
|
@echo off & echo(
|
2018-03-06 13:58:23 +01:00
|
|
|
else
|
|
|
|
|
@echo
|
|
|
|
|
endif
|
2016-11-23 15:38:19 +01:00
|
|
|
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: help_all
|
2022-03-07 17:03:19 +01:00
|
|
|
help_all: help_usage help_cc help_python help_java help_dotnet help_archive help_doc
|
2018-03-02 13:41:00 +01:00
|
|
|
|
2022-03-09 17:33:48 +01:00
|
|
|
# Commands to build/clean all languages.
|
|
|
|
|
.PHONY: compile
|
|
|
|
|
compile:
|
|
|
|
|
cmake --build dependencies --target install --config $(BUILD_TYPE) -j $(JOBS) -v
|
|
|
|
|
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: build_all
|
2022-03-30 09:25:33 +02:00
|
|
|
build_all:
|
2022-03-07 14:05:12 +01:00
|
|
|
$(MAKE) third_party BUILD_PYTHON=ON BUILD_JAVA=ON BUILD_DOTNET=ON
|
2022-03-30 09:25:33 +02:00
|
|
|
cmake --build $(BUILD_DIR) --target install --config $(BUILD_TYPE) -j $(JOBS) -v
|
2022-02-22 11:03:26 +01:00
|
|
|
@echo Or-tools has been built for "$(BUILT_LANGUAGES)"
|
2018-03-02 13:41:00 +01:00
|
|
|
|
2019-01-16 14:27:15 +01:00
|
|
|
.PHONY: check_all
|
2022-03-30 09:25:33 +02:00
|
|
|
check_all: check_cpp check_python check_java check_dotnet
|
2022-02-22 11:03:26 +01:00
|
|
|
@echo Or-tools has been built and checked for "$(BUILT_LANGUAGES)"
|
2019-01-16 14:27:15 +01:00
|
|
|
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: test_all
|
2022-03-30 09:25:33 +02:00
|
|
|
test_all: test_cpp test_python test_java test_dotnet
|
2022-02-22 11:03:26 +01:00
|
|
|
@echo Or-tools have been built and tested for "$(BUILT_LANGUAGES)"
|
2018-03-02 13:41:00 +01:00
|
|
|
|
|
|
|
|
.PHONY: clean_all
|
2022-03-30 09:25:33 +02:00
|
|
|
clean_all: clean_cpp clean_python clean_java clean_dotnet clean_archive
|
2022-02-22 11:03:26 +01:00
|
|
|
@echo Or-Tools has been cleaned for "$(BUILT_LANGUAGES)"
|
2018-03-02 13:41:00 +01:00
|
|
|
|
|
|
|
|
.PHONY: detect_all
|
2022-03-30 09:25:33 +02:00
|
|
|
detect_all: detect_port detect_cpp detect_python detect_java detect_dotnet detect_archive
|
2018-10-29 14:17:53 +01:00
|
|
|
@echo SOURCE = $(SOURCE)
|
|
|
|
|
@echo SOURCE_PATH = $(SOURCE_PATH)
|
|
|
|
|
@echo SOURCE_NAME = $(SOURCE_NAME)
|
|
|
|
|
@echo SOURCE_SUFFIX = $(SOURCE_SUFFIX)
|
2022-03-07 14:05:12 +01:00
|
|
|
ifeq ($(PLATFORM),WIN64)
|
2018-10-29 14:17:53 +01:00
|
|
|
@echo off & echo(
|
|
|
|
|
else
|
|
|
|
|
@echo
|
|
|
|
|
endif
|
2018-02-23 14:55:24 +01:00
|
|
|
|
2019-06-29 13:20:46 +02:00
|
|
|
print-% : ; @echo $* = \'$($*)\'
|
2018-10-29 14:17:53 +01:00
|
|
|
|
|
|
|
|
.PHONY: FORCE
|
|
|
|
|
FORCE:
|