2018-11-29 15:17:20 +00:00
|
|
|
COMPONENTS = conn crypto db thirdparty hashmap identify net os peer record routing secio swarm utils yamux
|
2016-11-10 13:08:22 +00:00
|
|
|
|
2018-12-03 12:22:33 +00:00
|
|
|
export DEBUG = true
|
2018-12-03 14:24:50 +00:00
|
|
|
export SHARED = true
|
2016-11-10 13:08:22 +00:00
|
|
|
|
2018-11-29 12:15:27 +00:00
|
|
|
ROOT= $(shell pwd)
|
2018-11-29 13:12:39 +00:00
|
|
|
export INCLUDE = -I$(ROOT)/include -I$(ROOT)/c-protobuf -I$(ROOT)/c-multihash/include -I$(ROOT)/c-multiaddr/include
|
2018-12-03 14:24:50 +00:00
|
|
|
export CFLAGS = $(INCLUDE) -Wall -O0 -fPIC
|
2018-12-03 12:22:33 +00:00
|
|
|
|
|
|
|
ifdef DEBUG
|
|
|
|
CFLAGS += -g3
|
|
|
|
endif
|
|
|
|
|
2017-10-25 17:28:53 +00:00
|
|
|
|
2018-11-29 16:03:48 +00:00
|
|
|
OBJS = $(shell (find $(COMPONENTS) -name *.o))
|
2016-11-07 21:34:08 +00:00
|
|
|
|
2018-12-03 12:24:15 +00:00
|
|
|
all: test
|
|
|
|
|
2018-11-28 15:43:33 +00:00
|
|
|
link: compile
|
2018-11-29 16:03:48 +00:00
|
|
|
$(AR) rcs libp2p.a $(OBJS) $(LINKER_FLAGS)
|
2018-12-03 14:24:50 +00:00
|
|
|
#ifdef SHARED
|
|
|
|
gcc -shared -o libp2p.so $(OBJS) $(LINKER_FLAGS)
|
|
|
|
#endif
|
2016-11-07 21:34:08 +00:00
|
|
|
|
2017-02-13 18:26:41 +00:00
|
|
|
compile:
|
2018-11-29 15:17:20 +00:00
|
|
|
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) all ;)
|
2018-11-28 15:43:33 +00:00
|
|
|
|
2018-12-03 12:31:01 +00:00
|
|
|
test: link
|
|
|
|
make -C test all;
|
2018-11-28 15:43:33 +00:00
|
|
|
|
2017-01-23 17:07:48 +00:00
|
|
|
rebuild: clean all
|
2018-11-28 15:43:33 +00:00
|
|
|
|
2016-11-07 21:34:08 +00:00
|
|
|
clean:
|
2018-11-29 15:17:20 +00:00
|
|
|
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) clean ;)
|
2018-12-03 12:22:33 +00:00
|
|
|
make -C test clean
|