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 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 \

View file

@ -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:

View file

@ -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;

View file

@ -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,8 +6,7 @@ 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)

View file

@ -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:

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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