2016-02-24 18:38:48 +01:00
|
|
|
From 02ad67e60ef698ee47f6ee53b36e5b89c2fd71e7 Mon Sep 17 00:00:00 2001
|
2015-11-23 23:23:21 +01:00
|
|
|
From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
|
2016-02-24 18:38:48 +01:00
|
|
|
Date: Wed, 24 Feb 2016 10:07:11 -0300
|
|
|
|
Subject: [PATCH 1/2] Allow building shared or static library only
|
2015-11-23 23:23:21 +01:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
2016-02-24 18:38:48 +01:00
|
|
|
[Gustavo: update for 4.1.2]
|
|
|
|
|
2015-11-23 23:23:21 +01:00
|
|
|
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
|
2016-02-24 18:38:48 +01:00
|
|
|
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
2015-11-23 23:23:21 +01:00
|
|
|
---
|
2016-02-24 18:38:48 +01:00
|
|
|
Makefile | 19 +++++++++++++++----
|
|
|
|
1 file changed, 15 insertions(+), 4 deletions(-)
|
2015-11-23 23:23:21 +01:00
|
|
|
|
|
|
|
diff --git a/Makefile b/Makefile
|
2016-02-24 18:38:48 +01:00
|
|
|
index 9df5996..86c8fac 100644
|
2015-11-23 23:23:21 +01:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
2016-02-24 18:38:48 +01:00
|
|
|
@@ -79,6 +79,8 @@ ifeq ($(UNAME_S),Darwin)
|
|
|
|
endif
|
|
|
|
|
2015-11-23 23:23:21 +01:00
|
|
|
|
|
|
|
+BUILD_SHARED ?= yes
|
|
|
|
+
|
|
|
|
CONFIG_FLAGS =
|
|
|
|
ifeq ($(CONFIG),debug)
|
|
|
|
CONFIG_FLAGS = -g -fno-inline -ftemplate-depth-1000
|
2016-02-24 18:38:48 +01:00
|
|
|
@@ -93,13 +95,22 @@ ifneq (,$(findstring $(CONFIG),release loadtest))
|
2015-11-23 23:23:21 +01:00
|
|
|
CONFIG_FLAGS = -O3 -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNO_DEBUG_LOG -DNO_TRACE_LOG -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
2016-02-24 18:38:48 +01:00
|
|
|
-COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall -fPIC \
|
|
|
|
+COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall \
|
2015-11-23 23:23:21 +01:00
|
|
|
-DBUILD_ENV=$(CONFIG) \
|
2016-02-24 18:38:48 +01:00
|
|
|
-DBUILD_DATESTAMP='$(APP_DATESTAMP)' \
|
|
|
|
-DBUILD_LIBRARY_NAME='"$(LIBRARY_NAME)"' \
|
2015-11-23 23:23:21 +01:00
|
|
|
-DBUILD_CLIENT_NAME='"$(CLIENT_TARGET)"' \
|
2016-02-24 18:38:48 +01:00
|
|
|
-I$(SRC_PATH) $(CUSTOM_INCLUDE_PATH)
|
2015-11-23 23:23:21 +01:00
|
|
|
|
|
|
|
+ifeq ($(BUILD_SHARED),yes)
|
|
|
|
+COMMON_FLAGS += -fPIC
|
|
|
|
+LIBRARY_TARGETS += $(LIBRARY_SHARED)
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+ifeq ($(BUILD_STATIC),yes)
|
|
|
|
+LIBRARY_TARGETS += $(LIBRARY_ARCHIVE)
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
COMMON_LIBS = -lzmq
|
|
|
|
|
2016-02-24 18:38:48 +01:00
|
|
|
LIBRARY_LIBS =
|
|
|
|
@@ -147,10 +158,11 @@ install:
|
|
|
|
mkdir -p $(INCLUDEDIR)/$(LIBRARY_DIR)
|
|
|
|
mkdir -p $(LIBDIR)
|
2015-11-23 23:23:21 +01:00
|
|
|
install -m 644 $(ALL_LIBRARY_INCLUDES) $(INCLUDEDIR)/$(LIBRARY_DIR)
|
|
|
|
+ifeq ($(BUILD_SHARED),yes)
|
2016-02-24 18:38:48 +01:00
|
|
|
install -m 755 $(BUILD_PATH)/$(LIBRARY_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_FULL_VERSION_SHARED)
|
|
|
|
- install -m 755 $(BUILD_PATH)/$(LIBRARY_ARCHIVE) $(LIBDIR)/$(LIBRARY_ARCHIVE)
|
|
|
|
ln -sf $(LIBRARY_FULL_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_VERSION_SHARED)
|
|
|
|
ln -sf $(LIBRARY_FULL_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_SHARED)
|
2015-11-23 23:23:21 +01:00
|
|
|
+endif
|
|
|
|
if [ -f $(BUILD_PATH)/$(CLIENT_TARGET) ]; then install -m 755 $(BUILD_PATH)/$(CLIENT_TARGET) $(BINDIR); fi
|
|
|
|
$(LDCONFIG)
|
|
|
|
@echo "use make installcheck to test the install"
|
2016-02-24 18:38:48 +01:00
|
|
|
@@ -172,7 +184,7 @@ clean:
|
2015-11-23 23:23:21 +01:00
|
|
|
|
|
|
|
client: $(CLIENT_TARGET)
|
|
|
|
|
|
|
|
-library: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE)
|
|
|
|
+library: $(LIBRARY_TARGETS)
|
|
|
|
|
|
|
|
#
|
|
|
|
# BUILD Targets
|
2016-02-24 18:38:48 +01:00
|
|
|
@@ -211,4 +223,3 @@ test: $(TESTS_TARGET)
|
2015-11-23 23:23:21 +01:00
|
|
|
$(OBJECT_PATH)/%.o: $(SRC_PATH)/%.cpp
|
|
|
|
-mkdir -p $(dir $@)
|
|
|
|
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COMMON_FLAGS) $(CONFIG_FLAGS) -c -o $@ $<
|
|
|
|
-
|
|
|
|
--
|
2016-02-24 18:38:48 +01:00
|
|
|
2.4.10
|
2015-11-23 23:23:21 +01:00
|
|
|
|