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