From d95ddde6a3e1552443a8bda0f394c9f9d68c1b6d Mon Sep 17 00:00:00 2001 From: David Date: Mon, 8 Nov 2021 15:40:13 +0000 Subject: [PATCH] added example makefile --- controllers/examplecpp/Makefile | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 controllers/examplecpp/Makefile diff --git a/controllers/examplecpp/Makefile b/controllers/examplecpp/Makefile new file mode 100644 index 0000000..adcba83 --- /dev/null +++ b/controllers/examplecpp/Makefile @@ -0,0 +1,63 @@ +# Copyright 1996-2020 Cyberbotics Ltd. +# +# 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. + +# Webots Makefile system +# +# You may add some variable definitions hereafter to customize the build process +# See documentation in $(WEBOTS_HOME_PATH)/resources/Makefile.include + +null := +space := $(null) $(null) +WEBOTS_HOME_PATH=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME)))) + +include $(WEBOTS_HOME_PATH)/resources/Makefile.os.include + +LIBRARIES = -ldriver -lcar -lCppDriver + +ifeq ($(OSTYPE),linux) +CFLAGS = -fPIC +LIBRARIES += -Wl,-rpath,$(WEBOTS_LIB_PATH) +endif + +CXX_SOURCES = $(wildcard *.cpp) + +# Do not modify the following: this includes Webots global Makefile.include +include $(WEBOTS_HOME_PATH)/resources/Makefile.include + +# Qt linking + +CFLAGS += -std=c++11 + +ifeq ($(OSTYPE),windows) + CFLAGS += -D_USE_MATH_DEFINES + QT_INCLUDE_DIR = $(WEBOTS_HOME)/include/qt + DYNAMIC_LIBRARIES += -lQt5Core + INCLUDE += -isystem "$(QT_INCLUDE_DIR)/QtCore" +endif + +ifeq ($(OSTYPE),linux) + QT_INCLUDE_DIR = $(WEBOTS_HOME)/include/qt + QT_LIB_DIR = $(WEBOTS_HOME)/lib/webots + DYNAMIC_LIBRARIES += -L"$(QT_LIB_DIR)" -lQt5Core + INCLUDE += -isystem "$(QT_INCLUDE_DIR)/QtCore" +endif + +ifeq ($(OSTYPE),darwin) + WBCFLAGS += -Wno-unknown-pragmas + FRAMEWORKS_DIR = $(WEBOTS_HOME)/Contents/Frameworks + INCLUDE += -F"$(FRAMEWORKS_DIR)" + FRAMEWORKS += -F"$(FRAMEWORKS_DIR)" + DYNAMIC_LIBRARIES += -bind_at_load $(FRAMEWORKS) + FRAMEWORKS += -framework QtCore +endif