2018-02-28 10:02:06 +01:00
|
|
|
# ---------- C++ support ----------
|
2018-03-02 13:41:00 +01:00
|
|
|
.PHONY: help_cc # Generate list of C++ targets with descriptions.
|
2018-02-28 10:02:06 +01:00
|
|
|
help_cc:
|
2018-03-02 13:41:00 +01:00
|
|
|
@echo Use one of the following C++ targets:
|
2018-02-28 10:02:06 +01:00
|
|
|
ifeq ($(SYSTEM),win)
|
2018-07-05 16:08:54 +02:00
|
|
|
@$(GREP) "^.PHONY: .* #" $(CURDIR)/makefiles/Makefile.cpp.mk | $(SED) "s/\.PHONY: \(.*\) # \(.*\)/\1\t\2/"
|
2018-03-06 15:03:19 +01:00
|
|
|
@echo off & echo(
|
2018-02-28 10:02:06 +01:00
|
|
|
else
|
2018-07-05 16:08:54 +02:00
|
|
|
@$(GREP) "^.PHONY: .* #" $(CURDIR)/makefiles/Makefile.cpp.mk | $(SED) "s/\.PHONY: \(.*\) # \(.*\)/\1\t\2/" | expand -t20
|
2018-03-06 13:58:23 +01:00
|
|
|
@echo
|
2018-02-28 10:02:06 +01:00
|
|
|
endif
|
2012-01-10 14:16:39 +00:00
|
|
|
|
2018-04-25 16:52:01 +02:00
|
|
|
# Checks if the user has overwritten default install prefix.
|
|
|
|
|
# cf https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#index-prefix
|
|
|
|
|
ifeq ($(SYSTEM),win)
|
2018-05-04 08:57:28 +02:00
|
|
|
prefix ?= C:\\Program Files\\or-tools
|
2018-04-25 16:52:01 +02:00
|
|
|
else
|
|
|
|
|
prefix ?= /usr/local
|
|
|
|
|
endif
|
|
|
|
|
|
2018-09-04 10:05:59 +02:00
|
|
|
# All libraries and dependecies
|
2022-02-18 19:04:21 +01:00
|
|
|
ifeq ($(PLATFORM),WIN64)
|
2018-09-04 10:05:59 +02:00
|
|
|
OR_TOOLS_LIBS = $(LIB_DIR)/$(LIB_PREFIX)ortools.$L
|
2022-02-18 19:04:21 +01:00
|
|
|
else
|
|
|
|
|
ifeq ($(PLATFORM),MACOSX)
|
2022-02-20 15:17:42 +01:00
|
|
|
OR_TOOLS_LIBS = $(LIB_DIR)/$(LIB_PREFIX)ortools.$(OR_TOOLS_MAJOR).$L
|
2022-02-28 18:29:51 +01:00
|
|
|
else # linux
|
2022-02-20 15:17:42 +01:00
|
|
|
OR_TOOLS_LIBS = $(LIB_DIR)/$(LIB_PREFIX)ortools.$L.$(OR_TOOLS_MAJOR)
|
2022-02-18 19:04:21 +01:00
|
|
|
endif
|
|
|
|
|
endif
|
2018-09-04 10:05:59 +02:00
|
|
|
|
2022-02-23 10:29:21 +01:00
|
|
|
JOBS ?= 4
|
|
|
|
|
|
2012-01-20 16:39:15 +00:00
|
|
|
# Main target
|
2018-09-27 10:38:29 +02:00
|
|
|
.PHONY: cc # Build C++ OR-Tools library.
|
2018-11-09 09:21:33 +01:00
|
|
|
.PHONY: test_cc # Run all C++ OR-Tools test targets.
|
2022-02-25 11:12:20 +01:00
|
|
|
.PHONY: fz # Build Flatzinc.
|
|
|
|
|
.PHONY: test_fz # Run all Flatzinc test targets.
|
2022-02-18 19:04:21 +01:00
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
ortools_libs: cc
|
|
|
|
|
ortools-libs: cc
|
|
|
|
|
or_tools_libs: cc
|
|
|
|
|
or-tools-libs: cc
|
2022-02-18 19:04:21 +01:00
|
|
|
|
|
|
|
|
# OR Tools unique library.
|
2022-03-01 16:14:13 +01:00
|
|
|
$(LIB_DIR)/build_timestamp: $(THIRD_PARTY_TARGET)
|
2022-03-01 16:28:18 +01:00
|
|
|
cmake --build dependencies --target install --config $(BUILD_TYPE) -j $(JOBS) -v
|
2022-03-01 16:14:13 +01:00
|
|
|
$(TOUCH) $(LIB_DIR)$Sbuild_timestamp
|
2022-02-18 19:04:21 +01:00
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
compile_libraries: $(LIB_DIR)/build_timestamp
|
|
|
|
|
cc: $(LIB_DIR)/build_timestamp
|
2022-02-18 19:04:21 +01:00
|
|
|
|
|
|
|
|
test_cc: \
|
2022-03-01 16:14:13 +01:00
|
|
|
cc \
|
2022-02-18 19:04:21 +01:00
|
|
|
test_cc_tests \
|
|
|
|
|
test_cc_contrib \
|
2022-02-18 23:08:40 +01:00
|
|
|
test_cc_cpp
|
2022-02-18 19:04:21 +01:00
|
|
|
|
2022-02-25 11:12:20 +01:00
|
|
|
# Now flatzinc is build with cc
|
|
|
|
|
fz: cc
|
|
|
|
|
|
2022-02-18 19:13:01 +01:00
|
|
|
test_fz: \
|
2022-02-18 23:08:40 +01:00
|
|
|
cc \
|
2022-02-18 19:04:21 +01:00
|
|
|
rfz_golomb \
|
2022-02-18 23:08:40 +01:00
|
|
|
rfz_alpha
|
2022-02-18 19:04:21 +01:00
|
|
|
|
|
|
|
|
|
2018-08-31 18:14:17 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR):
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(GEN_PATH)
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools: | $(GEN_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(GEN_PATH)$Sortools
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/algorithms: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Salgorithms
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/bop: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sbop
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/constraint_solver: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sconstraint_solver
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/flatzinc: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sflatzinc
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/glop: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sglop
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/graph: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sgraph
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2020-10-18 17:02:16 +02:00
|
|
|
$(GEN_DIR)/ortools/gscip: | $(GEN_DIR)/ortools
|
|
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sgscip
|
|
|
|
|
|
2021-09-28 15:58:37 +02:00
|
|
|
$(GEN_DIR)/ortools/init: | $(GEN_DIR)/ortools
|
|
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sinit
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/linear_solver: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Slinear_solver
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2021-09-28 15:58:37 +02:00
|
|
|
$(GEN_DIR)/ortools/packing: | $(GEN_DIR)/ortools
|
|
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Spacking
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/sat: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Ssat
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2021-09-28 15:58:37 +02:00
|
|
|
$(GEN_DIR)/ortools/scheduling: | $(GEN_DIR)/ortools
|
|
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sscheduling
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(GEN_DIR)/ortools/util: | $(GEN_DIR)/ortools
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(GEN_PATH)$Sortools$Sutil
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2021-01-05 23:05:46 +01:00
|
|
|
$(GEN_DIR)/examples: | $(GEN_DIR)
|
|
|
|
|
-$(MKDIR) $(GEN_PATH)$Sexamples
|
|
|
|
|
|
|
|
|
|
$(GEN_DIR)/examples/cpp: | $(GEN_DIR)/examples
|
|
|
|
|
-$(MKDIR) $(GEN_PATH)$Sexamples$Scpp
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(BIN_DIR):
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(BIN_DIR)
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(LIB_DIR):
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(LIB_DIR)
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR):
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR) $(OBJ_DIR)
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/algorithms: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Salgorithms
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/base: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sbase
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/bop: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sbop
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/constraint_solver: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sconstraint_solver
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/flatzinc: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sflatzinc
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/glop: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sglop
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/graph: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sgraph
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2020-10-18 17:02:16 +02:00
|
|
|
$(OBJ_DIR)/gscip: | $(OBJ_DIR)
|
|
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sgscip
|
|
|
|
|
|
2021-03-17 14:02:24 +01:00
|
|
|
$(OBJ_DIR)/gurobi: | $(OBJ_DIR)
|
|
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sgurobi
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/linear_solver: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Slinear_solver
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/lp_data: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Slp_data
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2021-09-28 15:58:37 +02:00
|
|
|
$(OBJ_DIR)/packing: | $(OBJ_DIR)
|
|
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Spacking
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/port: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sport
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/sat: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Ssat
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2021-09-28 15:58:37 +02:00
|
|
|
$(OBJ_DIR)/scheduling: | $(OBJ_DIR)
|
|
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sscheduling
|
|
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/util: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sutil
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-06-29 18:00:32 +02:00
|
|
|
$(OBJ_DIR)/swig: | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
-$(MKDIR_P) $(OBJ_DIR)$Sswig
|
2018-04-17 16:41:08 +02:00
|
|
|
|
2018-07-10 17:34:35 +02:00
|
|
|
include $(OR_ROOT)makefiles/Makefile.gen.mk
|
|
|
|
|
|
|
|
|
|
##################
|
|
|
|
|
## Sat solver ##
|
|
|
|
|
##################
|
|
|
|
|
sat: $(BIN_DIR)/sat_runner$E
|
|
|
|
|
|
|
|
|
|
$(OBJ_DIR)/sat_runner.$O: \
|
2018-09-18 10:10:25 +02:00
|
|
|
$(CC_EX_DIR)/sat_runner.cc \
|
|
|
|
|
$(CC_EX_DIR)/opb_reader.h \
|
|
|
|
|
$(CC_EX_DIR)/sat_cnf_reader.h \
|
2018-07-10 17:34:35 +02:00
|
|
|
$(SAT_DEPS) | $(OBJ_DIR)
|
2022-02-18 15:35:32 +01:00
|
|
|
$(CCC) $(CFLAGS) -I$(SRC_DIR) -c $(CC_EX_PATH)$Ssat_runner.cc $(OBJ_OUT)$(OBJ_DIR)$Ssat_runner.$O
|
2016-06-27 15:30:24 +02:00
|
|
|
|
2018-10-29 14:17:53 +01:00
|
|
|
##################
|
|
|
|
|
## C++ SOURCE ##
|
|
|
|
|
##################
|
|
|
|
|
ifeq ($(SOURCE_SUFFIX),.cc) # Those rules will be used if SOURCE contain a .cc file
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/$(SOURCE_NAME).$O: $(SOURCE) cc | $(OBJ_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
$(CCC) $(CFLAGS) \
|
|
|
|
|
-c $(SOURCE_PATH) \
|
|
|
|
|
$(OBJ_OUT)$(OBJ_DIR)$S$(SOURCE_NAME).$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(BIN_DIR)/$(SOURCE_NAME)$E: $(OBJ_DIR)/$(SOURCE_NAME).$O cc | $(BIN_DIR)
|
2018-10-29 14:17:53 +01:00
|
|
|
$(CCC) $(CFLAGS) \
|
|
|
|
|
$(OBJ_DIR)$S$(SOURCE_NAME).$O \
|
|
|
|
|
$(OR_TOOLS_LNK) $(OR_TOOLS_LDFLAGS) \
|
|
|
|
|
$(EXE_OUT)$(BIN_DIR)$S$(SOURCE_NAME)$E
|
|
|
|
|
|
|
|
|
|
.PHONY: build # Build a C++ program.
|
|
|
|
|
build: $(BIN_DIR)/$(SOURCE_NAME)$E
|
|
|
|
|
|
|
|
|
|
.PHONY: run # Run a C++ program.
|
|
|
|
|
run: build
|
|
|
|
|
$(BIN_DIR)$S$(SOURCE_NAME)$E $(ARGS)
|
|
|
|
|
endif
|
2018-10-12 11:48:03 +02:00
|
|
|
|
2018-10-29 14:17:53 +01:00
|
|
|
##################################
|
|
|
|
|
## CPP Tests/Examples/Samples ##
|
|
|
|
|
##################################
|
2018-10-29 17:46:20 +01:00
|
|
|
# Generic Command
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: $(TEST_DIR)/%.cc cc | $(OBJ_DIR)
|
2018-10-29 17:46:20 +01:00
|
|
|
$(CCC) $(CFLAGS) -c $(TEST_PATH)$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: $(CC_EX_DIR)/%.cc cc | $(OBJ_DIR)
|
2018-10-29 17:46:20 +01:00
|
|
|
$(CCC) $(CFLAGS) -c $(CC_EX_PATH)$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: $(CONTRIB_EX_DIR)/%.cc cc | $(OBJ_DIR)
|
2018-11-07 21:31:58 +01:00
|
|
|
$(CCC) $(CFLAGS) -c $(CONTRIB_EX_PATH)$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: ortools/algorithms/samples/%.cc cc | $(OBJ_DIR)
|
2018-11-16 15:10:15 +01:00
|
|
|
$(CCC) $(CFLAGS) -c ortools$Salgorithms$Ssamples$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: ortools/graph/samples/%.cc cc | $(OBJ_DIR)
|
2018-11-16 15:10:15 +01:00
|
|
|
$(CCC) $(CFLAGS) -c ortools$Sgraph$Ssamples$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: ortools/linear_solver/samples/%.cc cc | $(OBJ_DIR)
|
2018-11-09 09:21:33 +01:00
|
|
|
$(CCC) $(CFLAGS) -c ortools$Slinear_solver$Ssamples$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: ortools/constraint_solver/samples/%.cc cc | $(OBJ_DIR)
|
2018-11-23 10:49:46 +01:00
|
|
|
$(CCC) $(CFLAGS) -c ortools$Sconstraint_solver$Ssamples$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: ortools/sat/samples/%.cc cc | $(OBJ_DIR)
|
2018-10-29 17:46:20 +01:00
|
|
|
$(CCC) $(CFLAGS) -c ortools$Ssat$Ssamples$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/%.$O: ortools/routing/samples/%.cc cc | $(OBJ_DIR)
|
2018-11-23 10:49:46 +01:00
|
|
|
$(CCC) $(CFLAGS) -c ortools$Srouting$Ssamples$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$S$*.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(BIN_DIR)/%$E: $(OBJ_DIR)/%.$O cc | $(BIN_DIR)
|
2018-10-29 17:46:20 +01:00
|
|
|
$(CCC) $(CFLAGS) $(OBJ_DIR)$S$*.$O $(OR_TOOLS_LNK) $(OR_TOOLS_LDFLAGS) $(EXE_OUT)$(BIN_DIR)$S$*$E
|
|
|
|
|
|
2018-10-29 14:17:53 +01:00
|
|
|
rcc_%: $(BIN_DIR)/%$E FORCE
|
2018-08-31 18:14:17 +02:00
|
|
|
$(BIN_DIR)$S$*$E $(ARGS)
|
|
|
|
|
|
2021-01-05 23:05:46 +01:00
|
|
|
##################################
|
|
|
|
|
## Course scheduling example ##
|
|
|
|
|
##################################
|
|
|
|
|
|
|
|
|
|
examples/cpp/course_scheduling.proto: ;
|
|
|
|
|
|
|
|
|
|
$(CC_GEN_DIR)/course_scheduling.pb.cc: \
|
|
|
|
|
$(SRC_DIR)/examples/cpp/course_scheduling.proto | $(GEN_DIR)/examples/cpp
|
|
|
|
|
$(PROTOC) --proto_path=$(INC_DIR) $(PROTOBUF_PROTOC_INC) --cpp_out=$(GEN_PATH) $(SRC_DIR)/examples/cpp/course_scheduling.proto
|
|
|
|
|
|
|
|
|
|
$(CC_GEN_DIR)/course_scheduling.pb.h: \
|
|
|
|
|
$(CC_GEN_DIR)/course_scheduling.pb.cc
|
|
|
|
|
$(TOUCH) $(GEN_PATH)$Scourse_scheduling.pb.h
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/course_scheduling.$O: $(CC_EX_DIR)/course_scheduling.cc $(CC_EX_DIR)/course_scheduling.h $(CC_GEN_DIR)/course_scheduling.pb.h cc | $(OBJ_DIR)
|
2021-01-05 23:05:46 +01:00
|
|
|
$(CCC) $(CFLAGS) -c $(CC_EX_PATH)$Scourse_scheduling.cc $(OBJ_OUT)$(OBJ_DIR)$Scourse_scheduling.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/course_scheduling_run.$O: $(CC_EX_DIR)/course_scheduling_run.cc $(CC_EX_DIR)/course_scheduling.h $(CC_GEN_DIR)/course_scheduling.pb.h cc | $(OBJ_DIR)
|
2021-01-05 23:05:46 +01:00
|
|
|
$(CCC) $(CFLAGS) -c $(CC_EX_PATH)$Scourse_scheduling_run.cc $(OBJ_OUT)$(OBJ_DIR)$Scourse_scheduling_run.$O
|
|
|
|
|
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(OBJ_DIR)/course_scheduling.pb.$O: $(CC_GEN_DIR)/course_scheduling.pb.cc $(CC_GEN_DIR)/course_scheduling.pb.h cc | $(OBJ_DIR)
|
2021-01-05 23:05:46 +01:00
|
|
|
$(CCC) $(CFLAGS) -c $(CC_GEN_PATH)$Scourse_scheduling.pb.cc $(OBJ_OUT)$(OBJ_DIR)$Scourse_scheduling.pb.$O
|
|
|
|
|
|
2022-03-01 16:14:13 +01:00
|
|
|
$(BIN_DIR)/course_scheduling$E: $(OBJ_DIR)/course_scheduling.$O $(OBJ_DIR)/course_scheduling_run.$O $(OBJ_DIR)/course_scheduling.pb.$O cc | $(BIN_DIR)
|
2021-01-05 23:05:46 +01:00
|
|
|
$(CCC) $(CFLAGS) $(OBJ_DIR)$Scourse_scheduling.$O $(OBJ_DIR)$Scourse_scheduling_run.$O $(OBJ_DIR)$Scourse_scheduling.pb.$O $(OR_TOOLS_LNK) $(OR_TOOLS_LDFLAGS) $(EXE_OUT)$(BIN_DIR)$Scourse_scheduling$E
|
|
|
|
|
|
|
|
|
|
rcc_course_scheduling: $(BIN_DIR)/course_scheduling$E FORCE
|
|
|
|
|
$(BIN_DIR)$S$*$E $(ARGS)
|
|
|
|
|
|
2022-02-18 19:04:21 +01:00
|
|
|
##################################
|
|
|
|
|
## Test targets ##
|
|
|
|
|
##################################
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_algorithms_samples # Build and Run all C++ Algorithms Samples (located in ortools/algorithms/samples)
|
|
|
|
|
test_cc_algorithms_samples: \
|
|
|
|
|
rcc_knapsack \
|
|
|
|
|
rcc_simple_knapsack_program
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_graph_samples # Build and Run all C++ Graph Samples (located in ortools/graph/samples)
|
|
|
|
|
test_cc_graph_samples: \
|
|
|
|
|
rcc_simple_max_flow_program \
|
|
|
|
|
rcc_simple_min_cost_flow_program
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_linear_solver_samples # Build and Run all C++ LP Samples (located in ortools/linear_solver/samples)
|
|
|
|
|
test_cc_linear_solver_samples: \
|
|
|
|
|
rcc_assignment_mip \
|
|
|
|
|
rcc_basic_example \
|
|
|
|
|
rcc_bin_packing_mip \
|
|
|
|
|
rcc_integer_programming_example \
|
|
|
|
|
rcc_linear_programming_example \
|
|
|
|
|
rcc_mip_var_array \
|
|
|
|
|
rcc_multiple_knapsack_mip \
|
|
|
|
|
rcc_simple_lp_program \
|
|
|
|
|
rcc_simple_mip_program \
|
|
|
|
|
rcc_stigler_diet
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_constraint_solver_samples # Build and Run all C++ CP Samples (located in ortools/constraint_solver/samples)
|
|
|
|
|
test_cc_constraint_solver_samples: \
|
|
|
|
|
rcc_minimal_jobshop_cp \
|
|
|
|
|
rcc_nurses_cp \
|
|
|
|
|
rcc_rabbits_and_pheasants_cp \
|
|
|
|
|
rcc_simple_ls_program \
|
|
|
|
|
rcc_simple_cp_program \
|
|
|
|
|
rcc_simple_routing_program \
|
|
|
|
|
rcc_tsp \
|
|
|
|
|
rcc_tsp_cities \
|
|
|
|
|
rcc_tsp_circuit_board \
|
|
|
|
|
rcc_tsp_distance_matrix \
|
|
|
|
|
rcc_vrp \
|
|
|
|
|
rcc_vrp_breaks \
|
|
|
|
|
rcc_vrp_capacity \
|
|
|
|
|
rcc_vrp_drop_nodes \
|
|
|
|
|
rcc_vrp_global_span \
|
|
|
|
|
rcc_vrp_initial_routes \
|
|
|
|
|
rcc_vrp_pickup_delivery \
|
|
|
|
|
rcc_vrp_pickup_delivery_fifo \
|
|
|
|
|
rcc_vrp_pickup_delivery_lifo \
|
|
|
|
|
rcc_vrp_resources \
|
|
|
|
|
rcc_vrp_starts_ends \
|
|
|
|
|
rcc_vrp_time_windows \
|
|
|
|
|
rcc_vrp_with_time_limit
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_sat_samples # Build and Run all C++ Sat Samples (located in ortools/sat/samples)
|
|
|
|
|
test_cc_sat_samples: \
|
|
|
|
|
rcc_assignment_sat \
|
|
|
|
|
rcc_assumptions_sample_sat \
|
|
|
|
|
rcc_binpacking_problem_sat \
|
|
|
|
|
rcc_bool_or_sample_sat \
|
|
|
|
|
rcc_channeling_sample_sat \
|
|
|
|
|
rcc_cp_is_fun_sat \
|
|
|
|
|
rcc_earliness_tardiness_cost_sample_sat \
|
|
|
|
|
rcc_interval_sample_sat \
|
|
|
|
|
rcc_literal_sample_sat \
|
|
|
|
|
rcc_no_overlap_sample_sat \
|
|
|
|
|
rcc_optional_interval_sample_sat \
|
|
|
|
|
rcc_rabbits_and_pheasants_sat \
|
|
|
|
|
rcc_ranking_sample_sat \
|
|
|
|
|
rcc_reified_sample_sat \
|
|
|
|
|
rcc_search_for_all_solutions_sample_sat \
|
|
|
|
|
rcc_simple_sat_program \
|
|
|
|
|
rcc_solution_hinting_sample_sat \
|
|
|
|
|
rcc_solve_and_print_intermediate_solutions_sample_sat \
|
|
|
|
|
rcc_solve_with_time_limit_sample_sat \
|
|
|
|
|
rcc_step_function_sample_sat \
|
|
|
|
|
rcc_stop_after_n_solutions_sample_sat
|
|
|
|
|
|
|
|
|
|
.PHONY: check_cc_pimpl
|
|
|
|
|
check_cc_pimpl: \
|
|
|
|
|
test_cc_algorithms_samples \
|
|
|
|
|
test_cc_constraint_solver_samples \
|
|
|
|
|
test_cc_graph_samples \
|
|
|
|
|
test_cc_linear_solver_samples \
|
|
|
|
|
test_cc_sat_samples \
|
|
|
|
|
\
|
|
|
|
|
rcc_linear_programming \
|
|
|
|
|
rcc_constraint_programming_cp \
|
|
|
|
|
rcc_integer_programming \
|
|
|
|
|
rcc_knapsack \
|
|
|
|
|
rcc_max_flow \
|
|
|
|
|
rcc_min_cost_flow ;
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_tests # Build and Run all C++ Tests (located in ortools/examples/tests)
|
|
|
|
|
test_cc_tests: \
|
|
|
|
|
rcc_lp_test \
|
|
|
|
|
rcc_bug_fz1 \
|
|
|
|
|
rcc_cpp11_test \
|
|
|
|
|
rcc_forbidden_intervals_test \
|
|
|
|
|
rcc_issue57 \
|
|
|
|
|
rcc_min_max_test
|
|
|
|
|
# $(MAKE) rcc_issue173 # error: too long
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_contrib # Build and Run all C++ Contrib (located in ortools/examples/contrib)
|
|
|
|
|
test_cc_contrib: ;
|
|
|
|
|
|
|
|
|
|
.PHONY: test_cc_cpp # Build and Run all C++ Examples (located in ortools/examples/cpp)
|
|
|
|
|
test_cc_cpp: \
|
|
|
|
|
rcc_costas_array_sat \
|
|
|
|
|
rcc_cryptarithm_sat \
|
|
|
|
|
rcc_cvrp_disjoint_tw \
|
|
|
|
|
rcc_cvrptw \
|
|
|
|
|
rcc_cvrptw_with_breaks \
|
|
|
|
|
rcc_cvrptw_with_refueling \
|
|
|
|
|
rcc_cvrptw_with_resources \
|
|
|
|
|
rcc_cvrptw_with_stop_times_and_resources \
|
|
|
|
|
rcc_flow_api \
|
|
|
|
|
rcc_linear_assignment_api \
|
|
|
|
|
rcc_linear_solver_protocol_buffers \
|
|
|
|
|
rcc_magic_sequence_sat \
|
|
|
|
|
rcc_magic_square_sat \
|
|
|
|
|
rcc_nqueens \
|
|
|
|
|
rcc_random_tsp \
|
|
|
|
|
rcc_slitherlink_sat \
|
|
|
|
|
rcc_strawberry_fields_with_column_generation \
|
|
|
|
|
rcc_uncapacitated_facility_location \
|
|
|
|
|
rcc_weighted_tardiness_sat
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/dimacs_assignment.cc \
|
|
|
|
|
ARGS=examples/data/dimacs/assignment/small.asn
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/dobble_ls.cc \
|
|
|
|
|
ARGS="--time_limit_in_ms=10000"
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/golomb_sat.cc \
|
|
|
|
|
ARGS="--size=5"
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/jobshop_sat.cc \
|
|
|
|
|
ARGS="--input=examples/data/jobshop/ft06"
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/mps_driver.cc \
|
|
|
|
|
ARGS="--input examples/data/tests/test.mps"
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/network_routing_sat.cc \
|
|
|
|
|
ARGS="--clients=10 --backbones=5 --demands=10 --traffic_min=5 --traffic_max=10 --min_client_degree=2 --max_client_degree=5 --min_backbone_degree=3 --max_backbone_degree=5 --max_capacity=20 --fixed_charge_cost=10"
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/sports_scheduling_sat.cc \
|
|
|
|
|
ARGS="--params max_time_in_seconds:10.0"
|
|
|
|
|
# $(MAKE) run SOURCE=examples/cpp/frequency_assignment_problem.cc # Need data file
|
|
|
|
|
# $(MAKE) run SOURCE=examples/cpp/pdptw.cc ARGS="--pdp_file examples/data/pdptw/LC1_2_1.txt" # Fails on windows...
|
|
|
|
|
$(MAKE) run SOURCE=examples/cpp/shift_minimization_sat.cc ARGS="--input examples/data/shift_scheduling/minimization/data_1_23_40_66.dat"
|
|
|
|
|
$(MAKE) run \
|
|
|
|
|
SOURCE=examples/cpp/solve.cc \
|
|
|
|
|
ARGS="--input examples/data/tests/test2.mps"
|
|
|
|
|
|
2022-02-18 19:13:01 +01:00
|
|
|
rfz_%: $(BIN_DIR)/fz
|
2022-02-18 19:04:21 +01:00
|
|
|
$(BIN_DIR)$Sfz$E $(FZ_EX_PATH)$S$*.fzn
|
|
|
|
|
|
2020-04-07 18:59:25 +02:00
|
|
|
#################
|
|
|
|
|
## Packaging ##
|
|
|
|
|
#################
|
|
|
|
|
TEMP_PACKAGE_CC_DIR = temp_package_cc
|
|
|
|
|
|
|
|
|
|
$(TEMP_PACKAGE_CC_DIR):
|
|
|
|
|
-$(MKDIR_P) $(TEMP_PACKAGE_CC_DIR)
|
|
|
|
|
|
2022-02-25 11:44:01 +01:00
|
|
|
$(TEMP_PACKAGE_CC_DIR)/$(INSTALL_DIR): | $(TEMP_PACKAGE_CC_DIR)
|
|
|
|
|
$(MKDIR) $(TEMP_PACKAGE_CC_DIR)$S$(INSTALL_DIR)
|
|
|
|
|
|
|
|
|
|
package_cc: cc | $(TEMP_PACKAGE_CC_DIR)/$(INSTALL_DIR)
|
|
|
|
|
ifeq ($(SYSTEM),win)
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR)\$(INSTALL_DIR) && \
|
|
|
|
|
..\..\$(TAR) -C ..\.. -c -v include | ..\..\$(TAR) xvm
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR)\$(INSTALL_DIR) && \
|
|
|
|
|
..\..\$(TAR) -C ..\.. -c -v lib | ..\..\$(TAR) xvm
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR)\$(INSTALL_DIR) && \
|
|
|
|
|
..\..\$(TAR) -C ..\.. -c -v share | ..\..\$(TAR) xvm
|
|
|
|
|
else
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR)/$(INSTALL_DIR) && \
|
|
|
|
|
tar -C ../.. -c -v include | tar xvm
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR)/$(INSTALL_DIR) && \
|
|
|
|
|
tar -C ../.. -c -v lib | tar xvm
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR)/$(INSTALL_DIR) && \
|
|
|
|
|
tar -C ../.. -c -v share | tar xvm
|
|
|
|
|
endif
|
2020-04-07 18:59:25 +02:00
|
|
|
ifeq ($(SYSTEM),win)
|
|
|
|
|
cd $(TEMP_PACKAGE_CC_DIR) && ..$S$(ZIP) -r ..$S$(INSTALL_DIR)$(ARCHIVE_EXT) $(INSTALL_DIR)
|
|
|
|
|
else
|
|
|
|
|
$(TAR) -C $(TEMP_PACKAGE_CC_DIR) --no-same-owner -czvf $(INSTALL_DIR)$(ARCHIVE_EXT) $(INSTALL_DIR)
|
|
|
|
|
endif
|
|
|
|
|
|
2018-04-25 16:52:01 +02:00
|
|
|
###############
|
|
|
|
|
## INSTALL ##
|
|
|
|
|
###############
|
2018-05-14 17:30:40 +02:00
|
|
|
# ref: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#index-prefix
|
|
|
|
|
# ref: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
|
2022-03-01 17:03:16 +00:00
|
|
|
.PHONY: install_dirs
|
2018-04-25 16:52:01 +02:00
|
|
|
install_dirs:
|
2018-07-06 17:24:09 +02:00
|
|
|
-$(MKDIR_P) "$(DESTDIR)$(prefix)"
|
2022-03-01 17:03:16 +00:00
|
|
|
-$(MKDIR) "$(DESTDIR)$(prefix)$Sinclude"
|
2018-05-31 11:49:48 +02:00
|
|
|
-$(MKDIR) "$(DESTDIR)$(prefix)$Slib"
|
|
|
|
|
-$(MKDIR) "$(DESTDIR)$(prefix)$Sbin"
|
2022-02-20 16:27:59 +01:00
|
|
|
-$(MKDIR) "$(DESTDIR)$(prefix)$Sshare"
|
2022-03-01 17:03:16 +00:00
|
|
|
-$(MKDIR_P) "$(DESTDIR)$(prefix)$Sshare$Sdocs$Sortools$Ssat"
|
2022-02-20 09:05:57 +01:00
|
|
|
|
|
|
|
|
# Install C++ OR-Tools to $(DESTDIR)$(prefix)
|
|
|
|
|
.PHONY: install_cc
|
|
|
|
|
install_cc: | install_dirs
|
2018-05-14 17:30:40 +02:00
|
|
|
$(COPY) LICENSE-2.0.txt "$(DESTDIR)$(prefix)"
|
2022-03-01 17:03:16 +00:00
|
|
|
ifeq ($(SYSTEM),win)
|
|
|
|
|
$(COPYREC) /E /Y include "$(DESTDIR)$(prefix)"
|
|
|
|
|
$(COPY) "$(LIB_DIR)$S$(LIB_PREFIX)ortools.$L*" "$(DESTDIR)$(prefix)$Slib"
|
|
|
|
|
$(COPYREC) /E /Y share "$(DESTDIR)$(prefix)"
|
|
|
|
|
else
|
|
|
|
|
$(COPYREC) include "$(DESTDIR)$(prefix)$S"
|
|
|
|
|
$(COPY) $(LIB_DIR)*$S$(LIB_PREFIX)ortools.$L* "$(DESTDIR)$(prefix)$Slib$S"
|
|
|
|
|
$(COPYREC) share "$(DESTDIR)$(prefix)$S"
|
|
|
|
|
endif
|
2022-02-20 09:05:57 +01:00
|
|
|
$(COPY) bin$Sprotoc* "$(DESTDIR)$(prefix)$Sbin"
|
2022-03-01 17:03:16 +00:00
|
|
|
$(COPY) ortools$Ssat$Sdocs$S*.md "$(DESTDIR)$(prefix)$Sshare$Sdocs$Sortools$Ssat"
|
2018-05-31 11:49:48 +02:00
|
|
|
|
2020-09-25 17:45:25 +02:00
|
|
|
#######################
|
|
|
|
|
## EXAMPLE ARCHIVE ##
|
|
|
|
|
#######################
|
|
|
|
|
TEMP_CC_DIR=temp_cpp
|
|
|
|
|
|
|
|
|
|
$(TEMP_CC_DIR):
|
|
|
|
|
$(MKDIR) $(TEMP_CC_DIR)
|
|
|
|
|
|
|
|
|
|
$(TEMP_CC_DIR)/ortools_examples: | $(TEMP_CC_DIR)
|
|
|
|
|
$(MKDIR) $(TEMP_CC_DIR)$Sortools_examples
|
|
|
|
|
|
|
|
|
|
$(TEMP_CC_DIR)/ortools_examples/examples: | $(TEMP_CC_DIR)/ortools_examples
|
|
|
|
|
$(MKDIR) $(TEMP_CC_DIR)$Sortools_examples$Sexamples
|
|
|
|
|
|
|
|
|
|
$(TEMP_CC_DIR)/ortools_examples/examples/cpp: | $(TEMP_CC_DIR)/ortools_examples/examples
|
|
|
|
|
$(MKDIR) $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
|
|
|
|
|
$(TEMP_CC_DIR)/ortools_examples/examples/data: | $(TEMP_CC_DIR)/ortools_examples/examples
|
|
|
|
|
$(MKDIR) $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Sdata
|
|
|
|
|
|
|
|
|
|
.PHONY: cc_examples_archive # Build stand-alone C++ examples archive file for redistribution.
|
|
|
|
|
cc_examples_archive: | \
|
|
|
|
|
$(TEMP_CC_DIR)/ortools_examples/examples/cpp \
|
|
|
|
|
$(TEMP_CC_DIR)/ortools_examples/examples/data
|
2020-09-28 14:09:54 +02:00
|
|
|
$(COPY) $(CC_EX_PATH)$S*.h $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
$(COPY) $(CC_EX_PATH)$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
2020-09-25 17:45:25 +02:00
|
|
|
# $(COPY) $(CONTRIB_EX_PATH)$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
$(COPY) ortools$Salgorithms$Ssamples$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
$(COPY) ortools$Sgraph$Ssamples$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
$(COPY) ortools$Slinear_solver$Ssamples$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
$(COPY) ortools$Sconstraint_solver$Ssamples$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
|
|
|
|
$(COPY) ortools$Ssat$Ssamples$S*.cc $(TEMP_CC_DIR)$Sortools_examples$Sexamples$Scpp
|
2020-10-02 17:47:54 +02:00
|
|
|
$(COPY) tools$SREADME.cpp.md $(TEMP_CC_DIR)$Sortools_examples$SREADME.md
|
2020-09-25 17:45:25 +02:00
|
|
|
$(COPY) LICENSE-2.0.txt $(TEMP_CC_DIR)$Sortools_examples
|
|
|
|
|
ifeq ($(SYSTEM),win)
|
|
|
|
|
cd $(TEMP_CC_DIR)\ortools_examples \
|
|
|
|
|
&& ..\..\$(TAR) -C ..\.. -c -v \
|
|
|
|
|
--exclude *svn* --exclude *roadef* --exclude *vector_packing* \
|
|
|
|
|
examples\data | ..\..\$(TAR) xvm
|
|
|
|
|
cd $(TEMP_CC_DIR) \
|
|
|
|
|
&& ..\$(ZIP) \
|
|
|
|
|
-r ..\or-tools_cpp_examples_v$(OR_TOOLS_VERSION).zip \
|
|
|
|
|
ortools_examples
|
|
|
|
|
else
|
|
|
|
|
cd $(TEMP_CC_DIR)/ortools_examples \
|
|
|
|
|
&& tar -C ../.. -c -v \
|
|
|
|
|
--exclude *svn* --exclude *roadef* --exclude *vector_packing* \
|
|
|
|
|
examples/data | tar xvm
|
|
|
|
|
cd $(TEMP_CC_DIR) \
|
|
|
|
|
&& tar -c -v -z --no-same-owner \
|
|
|
|
|
-f ../or-tools_cpp_examples$(PYPI_OS)_v$(OR_TOOLS_VERSION).tar.gz \
|
|
|
|
|
ortools_examples
|
|
|
|
|
endif
|
|
|
|
|
-$(DELREC) $(TEMP_CC_DIR)$Sortools_examples
|
|
|
|
|
|
|
|
|
|
################
|
|
|
|
|
## Cleaning ##
|
|
|
|
|
################
|
|
|
|
|
CC_SAMPLES := $(wildcard ortools/*/samples/*.cc)
|
|
|
|
|
CC_SAMPLES := $(notdir $(CC_SAMPLES))
|
|
|
|
|
CC_SAMPLES := $(addsuffix $E, $(addprefix $(BIN_DIR)$S, $(basename $(CC_SAMPLES))))
|
|
|
|
|
|
|
|
|
|
CC_EXAMPLES := $(wildcard $(CC_EX_DIR)/*.cc)
|
|
|
|
|
CC_EXAMPLES := $(notdir $(CC_EXAMPLES))
|
|
|
|
|
CC_EXAMPLES := $(addsuffix $E, $(addprefix $(BIN_DIR)$S, $(basename $(CC_EXAMPLES))))
|
|
|
|
|
|
|
|
|
|
CC_TESTS := $(wildcard $(TEST_DIR)/*.cc)
|
|
|
|
|
CC_TESTS := $(notdir $(CC_TESTS))
|
|
|
|
|
CC_TESTS := $(addsuffix $E, $(addprefix $(BIN_DIR)$S, $(basename $(CC_TESTS))))
|
|
|
|
|
|
|
|
|
|
.PHONY: clean_cc # Clean C++ output from previous build.
|
|
|
|
|
clean_cc:
|
2022-03-01 16:14:13 +01:00
|
|
|
-$(DEL) $(LIB_DIR)$Sbuild_timestamp
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)cvrptw_lib.$L
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)dimacs.$L
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)fap.$L
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)fz.$L
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)ortools*.$L*
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)flatzinc*.$L*
|
|
|
|
|
-$(DEL) $(LIB_DIR)*$S$(LIB_PREFIX)*.a
|
2020-09-25 17:45:25 +02:00
|
|
|
-$(DEL) $(OBJ_DIR)$S*.$O
|
2022-02-20 15:17:42 +01:00
|
|
|
-$(DELREC) $(OBJ_DIR)
|
2020-11-30 14:00:12 +01:00
|
|
|
-$(DEL) $(BIN_DIR)$Sortools.msc
|
2020-09-25 17:45:25 +02:00
|
|
|
-$(DEL) $(BIN_DIR)$Sfz$E
|
|
|
|
|
-$(DEL) $(BIN_DIR)$Sparser_main$E
|
|
|
|
|
-$(DEL) $(BIN_DIR)$Ssat_runner$E
|
|
|
|
|
-$(DEL) $(CC_SAMPLES)
|
|
|
|
|
-$(DEL) $(CC_EXAMPLES)
|
|
|
|
|
-$(DEL) $(CC_TESTS)
|
|
|
|
|
-$(DEL) $(BIN_DIR)$S*.exp
|
|
|
|
|
-$(DEL) $(BIN_DIR)$S*.lib
|
|
|
|
|
-$(DELREC) $(TEMP_PACKAGE_CC_DIR)
|
|
|
|
|
-$(DELREC) $(TEMP_CC_DIR)
|
|
|
|
|
|
2018-08-31 18:14:17 +02:00
|
|
|
#############
|
|
|
|
|
## DEBUG ##
|
|
|
|
|
#############
|
2018-03-02 09:56:34 +01:00
|
|
|
.PHONY: detect_cc # Show variables used to build C++ OR-Tools.
|
|
|
|
|
detect_cc:
|
2018-03-06 14:34:17 +01:00
|
|
|
@echo Relevant info for the C++ build:
|
2018-05-14 17:30:40 +02:00
|
|
|
@echo PROTOC = $(PROTOC)
|
2018-03-02 09:56:34 +01:00
|
|
|
@echo CCC = $(CCC)
|
|
|
|
|
@echo CFLAGS = $(CFLAGS)
|
2018-05-14 17:30:40 +02:00
|
|
|
@echo LDFLAGS = $(LDFLAGS)
|
2018-05-16 13:28:12 +02:00
|
|
|
@echo LINK_CMD = $(LINK_CMD)
|
2020-07-06 17:25:30 +02:00
|
|
|
@echo DEPENDENCIES_INC = $(DEPENDENCIES_INC)
|
2018-03-02 15:58:25 +01:00
|
|
|
@echo DEPENDENCIES_LNK = $(DEPENDENCIES_LNK)
|
2018-05-14 17:30:40 +02:00
|
|
|
@echo SRC_DIR = $(SRC_DIR)
|
2018-06-29 18:00:32 +02:00
|
|
|
@echo GEN_DIR = $(GEN_DIR)
|
2018-09-18 10:10:25 +02:00
|
|
|
@echo CC_EX_DIR = $(CC_EX_DIR)
|
2018-05-14 17:30:40 +02:00
|
|
|
@echo OBJ_DIR = $(OBJ_DIR)
|
2014-05-23 16:52:10 +00:00
|
|
|
@echo LIB_DIR = $(LIB_DIR)
|
|
|
|
|
@echo BIN_DIR = $(BIN_DIR)
|
2018-05-14 17:30:40 +02:00
|
|
|
@echo prefix = $(prefix)
|
|
|
|
|
@echo OR_TOOLS_LNK = $(OR_TOOLS_LNK)
|
|
|
|
|
@echo OR_TOOLS_LDFLAGS = $(OR_TOOLS_LDFLAGS)
|
|
|
|
|
@echo OR_TOOLS_LIBS = $(OR_TOOLS_LIBS)
|
2018-04-25 16:32:46 +02:00
|
|
|
ifeq ($(SYSTEM),win)
|
|
|
|
|
@echo off & echo(
|
|
|
|
|
else
|
|
|
|
|
@echo
|
|
|
|
|
endif
|