Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
510bbf17
Commit
510bbf17
authored
Sep 21, 2010
by
Pieter Noordhuis
Browse files
Make target for building static library
parent
af8ba74c
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
510bbf17
...
@@ -3,3 +3,4 @@
...
@@ -3,3 +3,4 @@
/*.o
/*.o
/*.so
/*.so
/*.dylib
/*.dylib
/*.a
Makefile
View file @
510bbf17
...
@@ -12,16 +12,22 @@ ifeq ($(uname_S),SunOS)
...
@@ -12,16 +12,22 @@ ifeq ($(uname_S),SunOS)
CCLINK
?=
-ldl
-lnsl
-lsocket
-lm
-lpthread
CCLINK
?=
-ldl
-lnsl
-lsocket
-lm
-lpthread
DYLIBNAME
?=
libhiredis.so
DYLIBNAME
?=
libhiredis.so
DYLIB_MAKE_CMD
?=
gcc
-shared
-Wl
,-soname,
${DYLIBNAME}
-o
${DYLIBNAME}
${OBJ}
DYLIB_MAKE_CMD
?=
gcc
-shared
-Wl
,-soname,
${DYLIBNAME}
-o
${DYLIBNAME}
${OBJ}
STLIBNAME
?=
libhiredis.a
STLIB_MAKE_CMD
?=
ar rcs
${STLIBNAME}
${OBJ}
else
ifeq
($(uname_S),Darwin)
else
ifeq
($(uname_S),Darwin)
CFLAGS
?=
-std
=
c99
-pedantic
$(OPTIMIZATION)
-fPIC
-Wall
-W
-Wwrite-strings
$(ARCH)
$(PROF)
CFLAGS
?=
-std
=
c99
-pedantic
$(OPTIMIZATION)
-fPIC
-Wall
-W
-Wwrite-strings
$(ARCH)
$(PROF)
CCLINK
?=
-lm
-pthread
CCLINK
?=
-lm
-pthread
DYLIBNAME
?=
libhiredis.dylib
DYLIBNAME
?=
libhiredis.dylib
DYLIB_MAKE_CMD
?=
libtool
-dynamic
-o
${DYLIBNAME}
-lm
${DEBUG}
-
${OBJ}
DYLIB_MAKE_CMD
?=
libtool
-dynamic
-o
${DYLIBNAME}
-lm
${DEBUG}
-
${OBJ}
STLIBNAME
?=
libhiredis.a
STLIB_MAKE_CMD
?=
libtool
-static
-o
${STLIBNAME}
-
${OBJ}
else
else
CFLAGS
?=
-std
=
c99
-pedantic
$(OPTIMIZATION)
-fPIC
-Wall
-W
-Wwrite-strings
$(ARCH)
$(PROF)
CFLAGS
?=
-std
=
c99
-pedantic
$(OPTIMIZATION)
-fPIC
-Wall
-W
-Wwrite-strings
$(ARCH)
$(PROF)
CCLINK
?=
-lm
-pthread
CCLINK
?=
-lm
-pthread
DYLIBNAME
?=
libhiredis.so
DYLIBNAME
?=
libhiredis.so
DYLIB_MAKE_CMD
?=
gcc
-shared
-Wl
,-soname,
${DYLIBNAME}
-o
${DYLIBNAME}
${OBJ}
DYLIB_MAKE_CMD
?=
gcc
-shared
-Wl
,-soname,
${DYLIBNAME}
-o
${DYLIBNAME}
${OBJ}
STLIBNAME
?=
libhiredis.a
STLIB_MAKE_CMD
?=
ar rcs
${STLIBNAME}
${OBJ}
endif
endif
CCOPT
=
$(CFLAGS)
$(CCLINK)
$(ARCH)
$(PROF)
CCOPT
=
$(CFLAGS)
$(CCLINK)
$(ARCH)
$(PROF)
DEBUG
?=
-g
-ggdb
DEBUG
?=
-g
-ggdb
...
@@ -39,6 +45,12 @@ hiredis.o: hiredis.c hiredis.h sds.h anet.h
...
@@ -39,6 +45,12 @@ hiredis.o: hiredis.c hiredis.h sds.h anet.h
${DYLIBNAME}
:
${OBJ}
${DYLIBNAME}
:
${OBJ}
${DYLIB_MAKE_CMD}
${DYLIB_MAKE_CMD}
${STLIBNAME}
:
${OBJ}
${STLIB_MAKE_CMD}
dynamic
:
${DYLIBNAME}
static
:
${STLIBNAME}
# Binaries:
# Binaries:
hiredis-%
:
%.o ${DYLIBNAME}
hiredis-%
:
%.o ${DYLIBNAME}
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-L
.
-l
hiredis
-Wl
,-rpath,.
$<
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-L
.
-l
hiredis
-Wl
,-rpath,.
$<
...
@@ -50,7 +62,7 @@ test: hiredis-test
...
@@ -50,7 +62,7 @@ test: hiredis-test
$(CC)
-c
$(CFLAGS)
$(DEBUG)
$(COMPILE_TIME)
$<
$(CC)
-c
$(CFLAGS)
$(DEBUG)
$(COMPILE_TIME)
$<
clean
:
clean
:
rm
-rf
${DYLIBNAME}
$(BINS)
*
.o
*
.gcda
*
.gcno
*
.gcov
rm
-rf
${DYLIBNAME}
${STLIBNAME}
$(BINS)
*
.o
*
.gcda
*
.gcno
*
.gcov
dep
:
dep
:
$(CC)
-MM
*
.c
$(CC)
-MM
*
.c
...
...
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