From 2949b2468fc5e0682095ec2878fec017efdd78e8 Mon Sep 17 00:00:00 2001 From: Radu Iliescu Date: Mon, 3 Dec 2018 09:24:50 -0500 Subject: [PATCH] Makefile: build libp2p as shared library --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f44fb2a..2d7f3aa 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ COMPONENTS = conn crypto db thirdparty hashmap identify net os peer record routing secio swarm utils yamux export DEBUG = true +export SHARED = true ROOT= $(shell pwd) export INCLUDE = -I$(ROOT)/include -I$(ROOT)/c-protobuf -I$(ROOT)/c-multihash/include -I$(ROOT)/c-multiaddr/include -export CFLAGS = $(INCLUDE) -Wall -O0 +export CFLAGS = $(INCLUDE) -Wall -O0 -fPIC ifdef DEBUG CFLAGS += -g3 @@ -17,6 +18,9 @@ all: test link: compile $(AR) rcs libp2p.a $(OBJS) $(LINKER_FLAGS) +#ifdef SHARED + gcc -shared -o libp2p.so $(OBJS) $(LINKER_FLAGS) +#endif compile: $(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) all ;)