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
hiredis
Commits
2afcc9c7
Commit
2afcc9c7
authored
Jun 08, 2012
by
Pieter Noordhuis
Browse files
Move common Makefile variables to separate file
parent
3a91923d
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Makefile
View file @
2afcc9c7
...
@@ -3,44 +3,7 @@
...
@@ -3,44 +3,7 @@
# Copyright (C) 2010-2011 Pieter Noordhuis <pcnoordhuis at gmail dot com>
# Copyright (C) 2010-2011 Pieter Noordhuis <pcnoordhuis at gmail dot com>
# This file is released under the BSD license, see the COPYING file
# This file is released under the BSD license, see the COPYING file
LIBNAME
=
libhiredis
include
./Makefile.common
HIREDIS_MAJOR
=
0
HIREDIS_MINOR
=
11
DYLIBSUFFIX
=
so
STLIBSUFFIX
=
a
DYLIB_MINOR_NAME
=
$(LIBNAME)
.
$(DYLIBSUFFIX)
.
$(HIREDIS_MAJOR)
.
$(HIREDIS_MINOR)
DYLIB_MAJOR_NAME
=
$(LIBNAME)
.
$(DYLIBSUFFIX)
.
$(HIREDIS_MAJOR)
DYLIBNAME
=
$(LIBNAME)
.
$(DYLIBSUFFIX)
DYLIB_MAKE_CMD
=
$(CC)
-shared
-Wl
,-soname,
$(DYLIB_MINOR_NAME)
-o
$(DYLIBNAME)
$(FINAL_LDFLAGS)
STLIBNAME
=
$(LIBNAME)
.
$(STLIBSUFFIX)
STLIB_MAKE_CMD
=
ar rcs
$(STLIBNAME)
# Default settings
STD
=
-std
=
c99
-pedantic
WARN
=
-Wall
-W
-Wstrict-prototypes
-Wwrite-strings
-Wno-unused-label
OPT
=
-O3
FINAL_CFLAGS
=
$(STD)
$(WARN)
$(OPT)
$(DEBUG)
-fPIC
$(CFLAGS)
$(HIREDIS_CFLAGS)
FINAL_LDFLAGS
=
$(DEBUG)
$(LDFLAGS)
$(HIREDIS_LDFLAGS)
DEBUG
=
-g
-ggdb
uname_S
:=
$(
shell
sh
-c
'uname -s 2>/dev/null || echo not'
)
# SunOS overrides
ifeq
($(uname_S),SunOS)
HIREDIS_CFLAGS
=
-D__EXTENSIONS__
-D_XPG6
HIREDIS_LDFLAGS
=
-ldl
-lnsl
-lsocket
DYLIB_MAKE_CMD
=
$(CC)
-G
-o
$(DYLIBNAME)
-h
$(DYLIB_MINOR_NAME)
$(LDFLAGS)
INSTALL
=
cp
-r
endif
# Darwin overrides
ifeq
($(uname_S),Darwin)
DYLIBSUFFIX
=
dylib
DYLIB_MINOR_NAME
=
$(LIBNAME)
.
$(HIREDIS_MAJOR)
.
$(HIREDIS_MINOR)
.
$(DYLIBSUFFIX)
DYLIB_MAJOR_NAME
=
$(LIBNAME)
.
$(HIREDIS_MAJOR)
.
$(DYLIBSUFFIX)
DYLIB_MAKE_CMD
=
$(CC)
-shared
-Wl
,-install_name,
$(DYLIB_MINOR_NAME)
-o
$(DYLIBNAME)
$(FINAL_LDFLAGS)
endif
OBJ
=
\
OBJ
=
\
address.o
\
address.o
\
...
...
src/Makefile.common
0 → 100644
View file @
2afcc9c7
LIBNAME
=
libhiredis
HIREDIS_MAJOR
=
0
HIREDIS_MINOR
=
11
DYLIBSUFFIX
=
so
STLIBSUFFIX
=
a
DYLIB_MINOR_NAME
=
$(LIBNAME)
.
$(DYLIBSUFFIX)
.
$(HIREDIS_MAJOR)
.
$(HIREDIS_MINOR)
DYLIB_MAJOR_NAME
=
$(LIBNAME)
.
$(DYLIBSUFFIX)
.
$(HIREDIS_MAJOR)
DYLIBNAME
=
$(LIBNAME)
.
$(DYLIBSUFFIX)
DYLIB_MAKE_CMD
=
$(CC)
-shared
-Wl
,-soname,
$(DYLIB_MINOR_NAME)
-o
$(DYLIBNAME)
$(FINAL_LDFLAGS)
STLIBNAME
=
$(LIBNAME)
.
$(STLIBSUFFIX)
STLIB_MAKE_CMD
=
ar rcs
$(STLIBNAME)
# Default settings
STD
=
-std
=
c99
-pedantic
WARN
=
-Wall
-W
-Wstrict-prototypes
-Wwrite-strings
-Wno-unused-label
OPT
=
-O3
FINAL_CFLAGS
=
$(STD)
$(WARN)
$(OPT)
$(DEBUG)
-fPIC
$(CFLAGS)
$(HIREDIS_CFLAGS)
FINAL_LDFLAGS
=
$(DEBUG)
$(LDFLAGS)
$(HIREDIS_LDFLAGS)
DEBUG
=
-g
-ggdb
uname_S
:=
$(
shell
sh
-c
'uname -s 2>/dev/null || echo not'
)
# SunOS overrides
ifeq
($(uname_S),SunOS)
HIREDIS_CFLAGS
=
-D__EXTENSIONS__
-D_XPG6
HIREDIS_LDFLAGS
=
-ldl
-lnsl
-lsocket
DYLIB_MAKE_CMD
=
$(CC)
-G
-o
$(DYLIBNAME)
-h
$(DYLIB_MINOR_NAME)
$(LDFLAGS)
INSTALL
=
cp
-r
endif
# Darwin overrides
ifeq
($(uname_S),Darwin)
DYLIBSUFFIX
=
dylib
DYLIB_MINOR_NAME
=
$(LIBNAME)
.
$(HIREDIS_MAJOR)
.
$(HIREDIS_MINOR)
.
$(DYLIBSUFFIX)
DYLIB_MAJOR_NAME
=
$(LIBNAME)
.
$(HIREDIS_MAJOR)
.
$(DYLIBSUFFIX)
DYLIB_MAKE_CMD
=
$(CC)
-shared
-Wl
,-install_name,
$(DYLIB_MINOR_NAME)
-o
$(DYLIBNAME)
$(FINAL_LDFLAGS)
endif
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