SIGN IN SIGN UP
google / or-tools UNCLAIMED

Google's Operations Research tools:

0 0 652 C++
2025-01-10 11:35:44 +01:00
# Copyright 2010-2025 Google LLC
2022-10-05 18:33:10 +02:00
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
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: detect
detect: detect_all
2018-03-02 13:41:00 +01:00
.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: archive
archive: archive_all
2018-03-02 13:41:00 +01:00
.PHONY: clean
clean: clean_all
# 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: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.
ifeq ($(OR_TOOLS_TOP),)
2012-03-28 00:26:48 +00:00
OR_ROOT =
else
2017-01-12 17:51:41 +01:00
ifeq ($(OS), Windows_NT)
OR_ROOT = $(OR_TOOLS_TOP)\\
else
2017-01-12 17:51:41 +01:00
OR_ROOT = $(OR_TOOLS_TOP)/
endif
endif
# 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.
ifeq ($(OR_TOOLS_MAJOR)$(OR_TOOLS_MINOR),)
include $(OR_ROOT)Version.txt
endif
2017-06-07 10:26:41 +02:00
# We try to detect the platform, and load system specific macros.
include $(OR_ROOT)makefiles/Makefile.port.mk
OR_ROOT_FULL=$(OR_TOOLS_TOP)
# 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
include $(OR_ROOT)makefiles/Makefile.cpp.mk
include $(OR_ROOT)makefiles/Makefile.dotnet.mk
include $(OR_ROOT)makefiles/Makefile.java.mk
include $(OR_ROOT)makefiles/Makefile.python.mk
2016-07-01 13:21:14 +02:00
include $(OR_ROOT)makefiles/Makefile.archive.mk
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.
ifeq ($(PLATFORM),WIN64)
2018-03-06 15:03:19 +01:00
@echo off & echo(
else
@echo
endif
2018-03-02 13:41:00 +01:00
.PHONY: help_all
help_all: help_usage help_cpp help_dotnet help_java help_python help_archive
.PHONY: check_all
check_all: check_cpp check_dotnet check_java check_python
@echo Or-tools has been built and checked for "$(BUILT_LANGUAGES)"
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
build_all:
$(MAKE) third_party BUILD_DOTNET=ON BUILD_JAVA=ON BUILD_PYTHON=ON
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
.PHONY: test_all
test_all: test_cpp test_dotnet test_java test_python
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: archive_all
archive_all: archive_cpp archive_dotnet archive_java archive_python archive_data
@echo Or-tools has been built and archived for "$(BUILT_LANGUAGES)"
.PHONY: test_archive_all
test_archive_all: test_archive_cpp test_archive_dotnet test_archive_java test_archive_python
@echo Or-tools archives have been checked for "$(BUILT_LANGUAGES)"
2018-03-02 13:41:00 +01:00
.PHONY: clean_all
clean_all: clean_cpp clean_dotnet clean_java clean_python 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
detect_all: detect_port detect_cpp detect_dotnet detect_java detect_python detect_archive
@echo SOURCE = $(SOURCE)
@echo SOURCE_PATH = $(SOURCE_PATH)
@echo SOURCE_NAME = $(SOURCE_NAME)
@echo SOURCE_SUFFIX = $(SOURCE_SUFFIX)
ifeq ($(PLATFORM),WIN64)
@echo off & echo(
else
@echo
endif
2018-02-23 14:55:24 +01:00
2019-06-29 13:20:46 +02:00
print-% : ; @echo $* = \'$($*)\'
.PHONY: FORCE
FORCE: