From 32f5c8c52a2b4cbe4c0108deb4625b920c82ecbe Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 28 Feb 2018 10:02:06 +0100 Subject: [PATCH] Add help_cc target --- Makefile | 2 +- makefiles/Makefile.cpp.mk | 17 +++++++++++++---- makefiles/Makefile.test.mk | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 55d8583a9b..1728d2b1fc 100755 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ help: @echo Please define target: @echo " - Prerequisite: third_party third_party_check clean_third_party" - @echo " - C++: cc test_cc clean_cc" + @echo " - C++: cc help_cc test_cc clean_cc" @echo " - Python: python help_python test_python clean_python" @echo " - Java: java help_java test_java clean_java" @echo " - .NET (CSharp): csharp help_csharp test_csharp clean_csharp" diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index 1bee4efe47..e2f3b403cb 100755 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -1,14 +1,23 @@ -# Makefile targets. +# ---------- C++ support ---------- +.PHONY: help_cc # Generate list of targets with descriptions. +help_cc: + @echo Use one of the following targets: +ifeq ($(SYSTEM),win) + @tools\grep.exe "^.PHONY: .* #" $(CURDIR)/makefiles/Makefile.cpp.mk | tools\sed.exe "s/\.PHONY: \(.*\) # \(.*\)/\1\t\2/" +else + @grep "^.PHONY: .* #" $(CURDIR)/makefiles/Makefile.cpp.mk | sed "s/\.PHONY: \(.*\) # \(.*\)/\1\t\2/" | expand -t20 +endif .PHONY: ccc rcc clean_cc clean_compat ccexe # Main target +.PHONY: cc # Build C++ OR-Tools. cc: ortoolslibs ccexe - +.PHONY: test_cc # Test C++ OR-Tools using various examples. +test_cc: test_cc_examples BUILT_LANGUAGES += C++ -# Clean target - +.PHONY: clean_cc # Clean C++ output from previous build. clean_cc: -$(DEL) $(LIB_DIR)$S$(LIB_PREFIX)cvrptw_lib.$(LIB_SUFFIX) -$(DEL) $(LIB_DIR)$S$(LIB_PREFIX)dimacs.$(LIB_SUFFIX) diff --git a/makefiles/Makefile.test.mk b/makefiles/Makefile.test.mk index f25e164524..e58773348f 100755 --- a/makefiles/Makefile.test.mk +++ b/makefiles/Makefile.test.mk @@ -2,7 +2,7 @@ test: test_cc test_python test_java test_csharp test_fsharp @echo Or-tools have been built and tested for $(BUILT_LANGUAGES) -test_cc: cc +test_cc_examples: cc $(BIN_DIR)$Sgolomb$E --size=5 $(BIN_DIR)$Scvrptw$E $(BIN_DIR)$Sflow_api$E