forked from squishyhuman/c-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (27 loc) · 912 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
ifdef DEBUG
CFLAGS += -g3
endif
OBJS = $(shell (find $(COMPONENTS) -name *.o))
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,$(SUBMODULES), $(MAKE) -C $(dir) all ;)
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) all ;)
test: link
make -C test all;
rebuild: clean all
clean:
$(foreach dir,$(SUBMODULES), $(MAKE) -C $(dir) clean ;)
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) clean ;)
make -C test clean