Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
caba5851
Commit
caba5851
authored
Apr 13, 2012
by
Pieter Noordhuis
Browse files
First set defaults, then do composition
parent
c04278ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Makefile
View file @
caba5851
...
@@ -17,25 +17,11 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
...
@@ -17,25 +17,11 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
OPTIMIZATION
?=
-O2
OPTIMIZATION
?=
-O2
DEPENDENCY_TARGETS
=
hiredis linenoise lua
DEPENDENCY_TARGETS
=
hiredis linenoise lua
# Default settings
STD
=
-std
=
c99
-pedantic
STD
=
-std
=
c99
-pedantic
WARN
=
-Wall
WARN
=
-Wall
OPT
=
$(OPTIMIZATION)
OPT
=
$(OPTIMIZATION)
ifeq
($(uname_S),SunOS)
FINAL_CFLAGS
=
$(STD)
$(WARN)
$(OPT)
$(DEBUG)
$(CFLAGS)
$(REDIS_CFLAGS)
-D__EXTENSIONS__
-D_XPG6
FINAL_LDFLAGS
=
$(LDFLAGS)
$(REDIS_LDFLAGS)
FINAL_LIBS
=
$(LIBS)
-ldl
-lnsl
-lsocket
-lm
-lpthread
DEBUG
=
-g
-ggdb
else
FINAL_CFLAGS
=
$(STD)
$(WARN)
$(OPT)
$(DEBUG)
$(CFLAGS)
$(REDIS_CFLAGS)
FINAL_LDFLAGS
=
$(LDFLAGS)
$(REDIS_LDFLAGS)
FINAL_LIBS
=
$(LIBS)
-lm
-pthread
DEBUG
=
-g
-rdynamic
-ggdb
endif
# Include paths to dependencies
FINAL_CFLAGS
+=
-I
../deps/hiredis
-I
../deps/linenoise
-I
../deps/lua/src
# Default allocator
# Default allocator
ifeq
($(uname_S),Linux)
ifeq
($(uname_S),Linux)
MALLOC
=
jemalloc
MALLOC
=
jemalloc
...
@@ -56,6 +42,21 @@ ifeq ($(USE_JEMALLOC),yes)
...
@@ -56,6 +42,21 @@ ifeq ($(USE_JEMALLOC),yes)
MALLOC
=
jemalloc
MALLOC
=
jemalloc
endif
endif
ifeq
($(uname_S),SunOS)
FINAL_CFLAGS
=
$(STD)
$(WARN)
$(OPT)
$(DEBUG)
$(CFLAGS)
$(REDIS_CFLAGS)
-D__EXTENSIONS__
-D_XPG6
FINAL_LDFLAGS
=
$(LDFLAGS)
$(REDIS_LDFLAGS)
FINAL_LIBS
=
$(LIBS)
-ldl
-lnsl
-lsocket
-lm
-lpthread
DEBUG
=
-g
-ggdb
else
FINAL_CFLAGS
=
$(STD)
$(WARN)
$(OPT)
$(DEBUG)
$(CFLAGS)
$(REDIS_CFLAGS)
FINAL_LDFLAGS
=
$(LDFLAGS)
$(REDIS_LDFLAGS)
FINAL_LIBS
=
$(LIBS)
-lm
-pthread
DEBUG
=
-g
-rdynamic
-ggdb
endif
# Include paths to dependencies
FINAL_CFLAGS
+=
-I
../deps/hiredis
-I
../deps/linenoise
-I
../deps/lua/src
ifeq
($(MALLOC),tcmalloc)
ifeq
($(MALLOC),tcmalloc)
FINAL_CFLAGS
+=
-DUSE_TCMALLOC
FINAL_CFLAGS
+=
-DUSE_TCMALLOC
FINAL_LIBS
+=
-ltcmalloc
FINAL_LIBS
+=
-ltcmalloc
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment