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
|
|
|
|
|
|
|
|
|
|
.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 13:09:20 +00:00
|
|
|
# INC_DIR is like OR_ROOT, but with a default of '.' instead of
|
2012-03-28 00:09:22 +00:00
|
|
|
# empty. It is used for instance in include directives (-I.).
|
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
|
|
|
|
|
|
|
|
|
|
# We try to detect the platform.
|
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
|
|
|
|
2016-01-12 11:15:27 -08:00
|
|
|
# Load local variables
|
|
|
|
|
include $(OR_ROOT)Makefile.local
|
2010-09-15 12:42:33 +00:00
|
|
|
|
2017-03-07 11:25:32 -05:00
|
|
|
# Change the file extensions to increase diff tool friendliness.
|
2011-04-06 16:26:35 +00:00
|
|
|
# Then include specific system commands and definitions
|
2017-03-07 11:25:32 -05:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.$(SYSTEM).mk
|
2010-09-15 12:42:33 +00:00
|
|
|
|
2011-12-02 16:10:31 +00:00
|
|
|
# Rules to fetch and build third party dependencies.
|
2017-03-07 11:25:32 -05:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.third_party.$(SYSTEM).mk
|
2011-12-02 16:10:31 +00:00
|
|
|
|
2011-07-14 23:27:43 +00:00
|
|
|
# Include .mk files.
|
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
|
2011-03-31 08:39:26 +00:00
|
|
|
|
2011-04-06 13:37:23 +00:00
|
|
|
# Finally include user makefile if it exists
|
2012-03-28 00:09:22 +00:00
|
|
|
-include $(OR_ROOT)Makefile.user
|
2016-06-27 15:30:24 +02: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.
|
|
|
|
|
@echo all: Build OR-Tools for all available languages \(need a call to \"make third_party\" first\).
|
|
|
|
|
@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.
|
2018-03-06 13:58:23 +01:00
|
|
|
ifeq ($(SYSTEM),win)
|
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
|
2018-07-05 14:56:31 +02:00
|
|
|
help_all: help_usage help_third_party help_cc help_python help_java help_dotnet help_archive
|
2018-03-02 13:41:00 +01:00
|
|
|
|
|
|
|
|
.PHONY: build_all
|
2018-04-26 20:41:34 -07:00
|
|
|
build_all: cc python java dotnet
|
2018-03-02 13:41:00 +01:00
|
|
|
@echo Or-tools have been built for $(BUILT_LANGUAGES)
|
|
|
|
|
|
|
|
|
|
.PHONY: test_all
|
2018-04-26 20:41:34 -07:00
|
|
|
test_all: test_cc test_python test_java test_dotnet
|
2018-03-02 13:41:00 +01:00
|
|
|
@echo Or-tools have been built and tested for $(BUILT_LANGUAGES)
|
|
|
|
|
|
|
|
|
|
.PHONY: clean_all
|
2018-07-05 14:56:31 +02:00
|
|
|
clean_all: clean_cc clean_python clean_java clean_dotnet clean_compat clean_archive
|
2018-07-02 11:21:12 +02:00
|
|
|
-$(DELREC) $(BIN_DIR)
|
|
|
|
|
-$(DELREC) $(LIB_DIR)
|
|
|
|
|
-$(DELREC) $(OBJ_DIR)
|
2018-07-04 09:05:22 +02:00
|
|
|
-$(DELREC) $(GEN_PATH)
|
2018-03-02 13:41:00 +01:00
|
|
|
@echo Or-tools have been cleaned for $(BUILT_LANGUAGES)
|
|
|
|
|
|
|
|
|
|
.PHONY: detect_all
|
2018-07-05 14:56:31 +02:00
|
|
|
detect_all: detect_port detect_third_party detect_cc detect_python detect_java detect_dotnet detect_archive
|
2018-02-23 14:55:24 +01:00
|
|
|
|
2017-01-24 19:33:22 +01:00
|
|
|
print-% : ; @echo $* = $($*)
|