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:
Radu Iliescu 2018-11-29 07:15:27 -05:00
parent ccabb8c0ac
commit d3858ffc26
18 changed files with 23 additions and 31 deletions

View file

@ -2,7 +2,8 @@
DEBUG = true
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 = \
conn/*.o \

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
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)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
clean:

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -g3
export CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
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)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
cd encoding; make all;

View file

@ -1,5 +1,4 @@
CC = gcc
CFLAGS = -O0 -I../../include -g3 -std=c99
LFLAGS =
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 \
@ -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
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c99
all: $(OBJS)
clean:

View file

@ -1,5 +1,5 @@
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 =
DEPS =
OBJS = datastore.o filestore.o
@ -7,7 +7,6 @@ OBJS = datastore.o filestore.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
clean:

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -g3
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = hashmap.o
@ -7,7 +7,6 @@ OBJS = hashmap.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
clean:

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -Werror -I../include -I../../c-protobuf -std=c11
CFLAGS = $(INCLUDE) -O0 -Wall -Werror -std=c11
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf -I../../c-multiaddr/include
CFLAGS = $(INCLUDE) -O0 -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf
CFLAGS = $(INCLUDE) -O0 -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = utils.o memstream.o
@ -7,7 +7,6 @@ OBJS = utils.o memstream.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
clean:

View file

@ -1,5 +1,5 @@
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 =
DEPS =
OBJS = peer.o peerstore.o providerstore.o
@ -7,7 +7,6 @@ OBJS = peer.o peerstore.o providerstore.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
clean:

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-protobuf -I../../c-multihash/include -I../../c-multiaddr/include -g3
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = record.o message.o message_handler.o
@ -7,7 +7,6 @@ OBJS = record.o message.o message_handler.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(OBJS)
clean:

View file

@ -1,6 +1,6 @@
DHT_DIR = dht
CC = gcc
CFLAGS = -O0 -I../include -I../../c-multiaddr/include -I$(DHT_DIR) -g3
CFLAGS = $(INCLUDE) -I$(DHT_DIR) -O0 -g3
LFLAGS =
DEPS = # $(DHT_DIR)/dht.h
OBJS = kademlia.o dht.o dht_protocol.o
@ -21,5 +21,5 @@ kademlia_test: $(OBJS)
clean:
rm -f kademlia_test $(OBJS)
#dht.c
#rm -rf $(DHT_DIR)
#dht.c
#rm -rf $(DHT_DIR)

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf -I../../c-multiaddr/include -std=c99
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -I../include -I../../c-protobuf -I../../c-multiaddr/include -std=c99
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I. -I../../c-multihash/include -I../../c-multiaddr/include -std=c11
CFLAGS = $(INCLUDE) -O0 -std=c11
ifdef DEBUG
CFLAGS += -g3
@ -14,7 +14,7 @@ OBJS = testit.o ../../c-protobuf/protobuf.o ../../c-protobuf/varint.o ../libp2p.
testit_libp2p: $(OBJS) $(DEPS)
$(CC) -o $@ $(OBJS) $(LFLAGS) -lp2p -lm -lmultihash -lmultiaddr -lpthread
all_others:
cd ../crypto; make all;
cd ../thirdparty; make all;

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -I../include -I../../c-multiaddr/include -std=c99
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -Wall -Werror -I../include -I../../c-protobuf -std=c11
CFLAGS = $(INCLUDE) -O0 -Wall -Werror -std=c11
ifdef DEBUG
CFLAGS += -g3
@ -19,4 +19,4 @@ clean:
rm -f test
test: all test.o
$(CC) -o test test.o $(OBJS) $(CFLAGS)
$(CC) -o test test.o $(OBJS) $(CFLAGS)