Makefile: refactor CFLAGS to come from main Makefile

Also remove CC and link flags since linking is done in main Makefile
master^2^2
Radu Iliescu 2018-12-03 07:22:33 -05:00
parent 209e7c432e
commit 8d3957f3b8
17 changed files with 16 additions and 91 deletions

View File

@ -1,10 +1,15 @@
COMPONENTS = conn crypto db thirdparty hashmap identify net os peer record routing secio swarm utils yamux
DEBUG = true
export DEBUG
export DEBUG = 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
ifdef DEBUG
CFLAGS += -g3
endif
OBJS = $(shell (find $(COMPONENTS) -name *.o))
@ -23,3 +28,4 @@ all: test
clean:
$(foreach dir,$(COMPONENTS), $(MAKE) -C $(dir) clean ;)
make -C test clean

View File

@ -1,6 +1,3 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = dialer.o transport_dialer.o connection.o tcp_transport_dialer.o session.o

View File

@ -1,6 +1,3 @@
CC = gcc
export CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = rsa.o sha256.o sha512.o sha1.o key.o peerutils.o ephemeral.o aes.o

View File

@ -1,4 +1,3 @@
CC = gcc
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 \

View File

@ -1,11 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -g3 -std=c99
LFLAGS =
DEPS =
OBJS = datastore.o filestore.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c99
all: $(OBJS)

View File

@ -1,6 +1,3 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = hashmap.o

View File

@ -1,16 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall -Werror -std=c11
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = identify.o
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c11
all: $(OBJS)

View File

@ -1,11 +1,3 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = sctp.o socket.o tcp.o udp.o multistream.o protocol.o connectionstream.o stream.o server.o

View File

@ -1,11 +1,3 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = nodeio.o

View File

@ -1,6 +1,3 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = utils.o memstream.o

View File

@ -1,11 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -g3 -std=c11
LFLAGS =
DEPS =
OBJS = peer.o peerstore.o providerstore.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c11
all: $(OBJS)

View File

@ -1,6 +1,3 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -g3
LFLAGS =
DEPS =
OBJS = record.o message.o message_handler.o

View File

@ -1,12 +1,9 @@
DHT_DIR = dht
CC = gcc
CFLAGS = $(INCLUDE) -I$(DHT_DIR) -O0 -g3
LFLAGS =
DEPS = # $(DHT_DIR)/dht.h
OBJS = kademlia.o dht.o dht_protocol.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -I$(DHT_DIR)
all: $(OBJS)

View File

@ -1,16 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = exchange.o propose.o secio.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c99
all: $(OBJS)

View File

@ -1,16 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = swarm.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c99
all: $(OBJS)

View File

@ -1,16 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall -std=c99
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = string_list.o vector.o linked_list.o logger.o urlencode.o thread_pool.o threadsafe_buffer.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c99
all: $(OBJS)

View File

@ -1,16 +1,8 @@
CC = gcc
CFLAGS = $(INCLUDE) -O0 -Wall -Werror -std=c11
ifdef DEBUG
CFLAGS += -g3
endif
LFLAGS =
DEPS =
OBJS = frame.o session.o stream.o yamux.o ../os/timespec.o
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) -std=c11
all: $(OBJS)