Makefile: refactor include files
Now major include files are comming from main Makefile, module need to add just their specific include path. To work make the include path absolute.
This commit is contained in:
parent
ccabb8c0ac
commit
d3858ffc26
18 changed files with 23 additions and 31 deletions
3
Makefile
3
Makefile
|
@ -2,7 +2,8 @@
|
||||||
DEBUG = true
|
DEBUG = true
|
||||||
export DEBUG
|
export DEBUG
|
||||||
|
|
||||||
LINKER_FLAGS=
|
ROOT= $(shell pwd)
|
||||||
|
export INCLUDE = -I$(ROOT)/include -I$(ROOT)/../c-protobuf -I$(ROOT)/../c-multihash/include -I$(ROOT)/../c-multiaddr/include
|
||||||
|
|
||||||
OBJS = \
|
OBJS = \
|
||||||
conn/*.o \
|
conn/*.o \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3
|
CFLAGS = $(INCLUDE) -O0 -g3
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = dialer.o transport_dialer.o connection.o tcp_transport_dialer.o session.o
|
OBJS = dialer.o transport_dialer.o connection.o tcp_transport_dialer.o session.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = dialer.o transport_dialer.o connection.o tcp_transport_dialer.o session.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -g3
|
export CFLAGS = $(INCLUDE) -O0 -g3
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = rsa.o sha256.o sha512.o sha1.o key.o peerutils.o ephemeral.o aes.o
|
OBJS = rsa.o sha256.o sha512.o sha1.o key.o peerutils.o ephemeral.o aes.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = rsa.o sha256.o sha512.o sha1.o key.o peerutils.o ephemeral.o aes.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
cd encoding; make all;
|
cd encoding; make all;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../../include -g3 -std=c99
|
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS = ../../include/libp2p/crypto/encoding/base58.h ../../include/libp2p/crypto/encoding/base64.h \
|
DEPS = ../../include/libp2p/crypto/encoding/base58.h ../../include/libp2p/crypto/encoding/base64.h \
|
||||||
../../include/libp2p/crypto/encoding/x509.h ../../include/libp2p/crypto/encoding/base16.h \
|
../../include/libp2p/crypto/encoding/x509.h ../../include/libp2p/crypto/encoding/base16.h \
|
||||||
|
@ -7,9 +6,8 @@ DEPS = ../../include/libp2p/crypto/encoding/base58.h ../../include/libp2p/crypto
|
||||||
OBJS = base58.o base64.o x509.o base16.o base32.o
|
OBJS = base58.o base64.o x509.o base16.o base32.o
|
||||||
|
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS) -std=c99
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3 -std=c99
|
CFLAGS = $(INCLUDE) -O0 -g3 -std=c99
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = datastore.o filestore.o
|
OBJS = datastore.o filestore.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = datastore.o filestore.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -g3
|
CFLAGS = $(INCLUDE) -O0 -g3
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = hashmap.o
|
OBJS = hashmap.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = hashmap.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -Werror -I../include -I../../c-protobuf -std=c11
|
CFLAGS = $(INCLUDE) -O0 -Wall -Werror -std=c11
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf -I../../c-multiaddr/include
|
CFLAGS = $(INCLUDE) -O0 -Wall
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf
|
CFLAGS = $(INCLUDE) -O0 -Wall
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3
|
CFLAGS = $(INCLUDE) -O0 -g3
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = utils.o memstream.o
|
OBJS = utils.o memstream.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = utils.o memstream.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3 -std=c11
|
CFLAGS = $(INCLUDE) -O0 -g3 -std=c11
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = peer.o peerstore.o providerstore.o
|
OBJS = peer.o peerstore.o providerstore.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = peer.o peerstore.o providerstore.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3
|
CFLAGS = $(INCLUDE) -O0 -g3
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS =
|
DEPS =
|
||||||
OBJS = record.o message.o message_handler.o
|
OBJS = record.o message.o message_handler.o
|
||||||
|
@ -7,7 +7,6 @@ OBJS = record.o message.o message_handler.o
|
||||||
%.o: %.c $(DEPS)
|
%.o: %.c $(DEPS)
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
DHT_DIR = dht
|
DHT_DIR = dht
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I../../c-multiaddr/include -I$(DHT_DIR) -g3
|
CFLAGS = $(INCLUDE) -I$(DHT_DIR) -O0 -g3
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEPS = # $(DHT_DIR)/dht.h
|
DEPS = # $(DHT_DIR)/dht.h
|
||||||
OBJS = kademlia.o dht.o dht_protocol.o
|
OBJS = kademlia.o dht.o dht_protocol.o
|
||||||
|
@ -21,5 +21,5 @@ kademlia_test: $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f kademlia_test $(OBJS)
|
rm -f kademlia_test $(OBJS)
|
||||||
#dht.c
|
#dht.c
|
||||||
#rm -rf $(DHT_DIR)
|
#rm -rf $(DHT_DIR)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf -I../../c-multiaddr/include -std=c99
|
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf -I../../c-multiaddr/include -std=c99
|
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -I../include -I. -I../../c-multihash/include -I../../c-multiaddr/include -std=c11
|
CFLAGS = $(INCLUDE) -O0 -std=c11
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
@ -14,7 +14,7 @@ OBJS = testit.o ../../c-protobuf/protobuf.o ../../c-protobuf/varint.o ../libp2p.
|
||||||
|
|
||||||
testit_libp2p: $(OBJS) $(DEPS)
|
testit_libp2p: $(OBJS) $(DEPS)
|
||||||
$(CC) -o $@ $(OBJS) $(LFLAGS) -lp2p -lm -lmultihash -lmultiaddr -lpthread
|
$(CC) -o $@ $(OBJS) $(LFLAGS) -lp2p -lm -lmultihash -lmultiaddr -lpthread
|
||||||
|
|
||||||
all_others:
|
all_others:
|
||||||
cd ../crypto; make all;
|
cd ../crypto; make all;
|
||||||
cd ../thirdparty; make all;
|
cd ../thirdparty; make all;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -I../include -I../../c-multiaddr/include -std=c99
|
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -Wall -Werror -I../include -I../../c-protobuf -std=c11
|
CFLAGS = $(INCLUDE) -O0 -Wall -Werror -std=c11
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CFLAGS += -g3
|
CFLAGS += -g3
|
||||||
|
@ -19,4 +19,4 @@ clean:
|
||||||
rm -f test
|
rm -f test
|
||||||
|
|
||||||
test: all test.o
|
test: all test.o
|
||||||
$(CC) -o test test.o $(OBJS) $(CFLAGS)
|
$(CC) -o test test.o $(OBJS) $(CFLAGS)
|
||||||
|
|
Loading…
Reference in a new issue