aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndreas Zwinkau <qznc@web.de>2017-03-16 20:20:16 +0100
committerRichard van der Hoff <richard@matrix.org>2017-03-24 10:20:49 +0000
commitb0a010b1539fe6409f398bb209b156187c959c41 (patch)
tree371c10b82b150295762688aeffdb592bd439c743 /Makefile
parent793cec02682ae2e483b97c68797bb549e9b9320f (diff)
Support building as a static library
Signed-off-by: Andreas Zwinkau <qznc@web.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f53be1f..b4ce87a 100644
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,10 @@ CC = gcc
EMCC = emcc
AFL_CC = afl-gcc
AFL_CXX = afl-g++
+AR = ar
RELEASE_TARGET := $(BUILD_DIR)/libolm.so.$(VERSION)
+STATIC_RELEASE_TARGET := $(BUILD_DIR)/libolm.a
DEBUG_TARGET := $(BUILD_DIR)/libolm_debug.so.$(VERSION)
JS_TARGET := javascript/olm.js
@@ -120,6 +122,12 @@ $(DEBUG_TARGET): $(DEBUG_OBJECTS)
$(OUTPUT_OPTION) $(DEBUG_OBJECTS)
ln -sf libolm_debug.so.$(VERSION) $(BUILD_DIR)/libolm_debug.so.$(MAJOR)
+static: $(STATIC_RELEASE_TARGET)
+.PHONY: static
+
+$(STATIC_RELEASE_TARGET): $(RELEASE_OBJECTS)
+ $(AR) rcs $@ $^
+
js: $(JS_TARGET)
.PHONY: js