Skip to content

Commit

Permalink
Add versioned symlinks for install target
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Apr 22, 2011
1 parent dd9f081 commit 81c00aa
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ OBJ=net.o hiredis.o sds.o async.o
BINS=hiredis-example hiredis-test
LIBNAME=libhiredis

HIREDIS_MAJOR=0
HIREDIS_MINOR=10

uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
OPTIMIZATION?=-O3
ifeq ($(uname_S),SunOS)
Expand All @@ -14,8 +17,10 @@ ifeq ($(uname_S),SunOS)
LDFLAGS?=-L.
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) -G -o $(DYLIBNAME)
DYLIB_MAKE_CMD?=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME)
STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD?=ar rcs $(STLIBNAME)
else
Expand All @@ -26,8 +31,10 @@ ifeq ($(uname_S),Darwin)
OBJARCH?=-arch i386 -arch x86_64
DYLIBSUFFIX=dylib
STLIBSUFFIX=a
DYLIB_MINOR_NAME?=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX)
DYLIB_MAJOR_NAME?=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX)
DYLIBNAME?=$(LIBNAME).$(DYLIBSUFFIX)
DYLIB_MAKE_CMD?=libtool -dynamic -o $(DYLIBNAME) -lm $(DEBUG) -
DYLIB_MAKE_CMD?=libtool -dynamic -o $(DYLIBNAME) -install_name $(DYLIB_MINOR_NAME) -lm $(DEBUG) -
STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD?=libtool -static -o $(STLIBNAME) -
else
Expand All @@ -36,8 +43,10 @@ else
LDFLAGS?=-L.
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?=gcc -shared -Wl,-soname,$(DYLIBNAME) -o $(DYLIBNAME)
DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME)
STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD?=ar rcs $(STLIBNAME)
endif
Expand Down Expand Up @@ -106,7 +115,11 @@ dep:
install: $(DYLIBNAME) $(STLIBNAME)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
$(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH)
$(INSTALL) $(DYLIBNAME) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME)
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)


32bit:
@echo ""
Expand Down

0 comments on commit 81c00aa

Please sign in to comment.