c-libp2p/Makefile

39 lines
912 B
Makefile
Raw Normal View History

SUBMODULES = c-multiaddr c-multihash c-protobuf
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 -fPIC
2017-10-25 17:28:53 +00:00
ifdef DEBUG
CFLAGS += -g3
endif
2016-11-07 21:34:08 +00:00
2017-10-25 17:28:53 +00:00
OBJS = $(shell (find $(COMPONENTS) -name *.o))
2016-11-07 21:34:08 +00:00
all: test
link: compile
$(AR) rcs libp2p.a $(OBJS) $(LINKER_FLAGS)
#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:
$(foreach dir,$(SUBMODULES), $(MAKE) -C $(dir) all ;)
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) all ;)
test: link
make -C test all;
rebuild: clean all
2016-11-07 21:34:08 +00:00
clean:
$(foreach dir,$(SUBMODULES), $(MAKE) -C $(dir) clean ;)
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) clean ;)
make -C test clean