From fdac637c6ec0d893f8ae8d71d98eb0371a864547 Mon Sep 17 00:00:00 2001 From: Dvir Volk Date: Sun, 22 Jan 2017 18:08:49 +0200 Subject: [PATCH] fixed makefile flags --- src/Makefile | 9 ++++++--- src/rmutil/Makefile | 3 ++- src/trie/Makefile | 3 ++- src/util/Makefile | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4cb8580682..2d6be375f3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,16 +2,19 @@ # find the OS uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') - +CFLAGS= -Wall -Wno-unused-function -Wno-unused-variable -Wno-pointer-sign -fPIC -lc -lm -std=gnu99 -I./ # Compile flags for linux / osx ifeq ($(uname_S),Linux) - SHOBJ_CFLAGS ?= -fno-common -g -ggdb + SHOBJ_CFLAGS ?= -fno-common -g -ggdb SHOBJ_LDFLAGS ?= -shared -Bsymbolic -Bsymbolic-functions + # We add -Werror to CFLAGS only on Linux since on OSX there are still tons of warnings + CFLAGS +=-Werror else SHOBJ_CFLAGS ?= -dynamic -fno-common -g -ggdb SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup endif -CFLAGS= -Wall -Werror -Wno-unused-function -Wno-unused-variable -Wno-pointer-sign -fPIC -lc -lm -std=gnu99 -I./ +export CFLAGS + RELEASEFLAGS=-O3 -g DEBUGFLAGS=-O0 -g VARINT=varint.o buffer.o diff --git a/src/rmutil/Makefile b/src/rmutil/Makefile index 8d4e9658da..08cb793c0b 100644 --- a/src/rmutil/Makefile +++ b/src/rmutil/Makefile @@ -3,7 +3,8 @@ ifndef RM_INCLUDE_DIR RM_INCLUDE_DIR=../ endif -CFLAGS = -g -fPIC -lc -lm -O3 -std=gnu99 -I$(RM_INCLUDE_DIR) -Wall -Wno-unused-function +CFLAGS ?= -g -fPIC -lc -lm -O3 -std=gnu99 -Wall -Wno-unused-function +CFLAGS += -I$(RM_INCLUDE_DIR) CC=gcc OBJS=util.o strings.o sds.o vector.o alloc.o diff --git a/src/trie/Makefile b/src/trie/Makefile index 98d797a736..61d02621cf 100644 --- a/src/trie/Makefile +++ b/src/trie/Makefile @@ -3,7 +3,8 @@ ifndef RM_INCLUDE_DIR RM_INCLUDE_DIR=../ endif -CFLAGS = -g -fPIC -lc -lm -O3 -std=gnu99 -I$(RM_INCLUDE_DIR) -Wall -Werror -Wno-unused-function -Wno-unused-variable +CFLAGS ?= -g -fPIC -lc -lm -O3 -std=gnu99 -Wall -Wno-unused-function -Wno-unused-variable +CFLAGS += -I$(RM_INCLUDE_DIR) CC=gcc OBJS=levenshtein.o rune_util.o sparse_vector.o trie.o trie_type.o diff --git a/src/util/Makefile b/src/util/Makefile index f24c14bcb5..79dec9db7a 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -g -fPIC -lc -lm -O3 -std=gnu99 +CFLAGS ?= -g -fPIC -lc -lm -O2 -std=gnu99 CC=gcc .SUFFIXES: .c .so .xo .o