From 461110e809f4d313832a9420db06d92b1f559372 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:28:33 +0200 Subject: Move path variables closer to install target --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9f7a715..ff827ca 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,6 @@ DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) STLIB_MAKE_CMD=ar rcs $(STLIBNAME) -INSTALL= cp -a uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') ifeq ($(uname_S),SunOS) @@ -46,12 +45,6 @@ ifeq ($(uname_S),Darwin) STLIB_MAKE_CMD=libtool -static -o $(STLIBNAME) - endif -PREFIX?=/usr/local -INCLUDE_PATH?=include/hiredis -LIBRARY_PATH?=lib -INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) -INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH) - all: $(DYLIBNAME) $(BINS) # Deps (use make dep to generate this) @@ -114,6 +107,19 @@ clean: dep: $(CC) -MM *.c +# Installation related variables and target +PREFIX?=/usr/local +INCLUDE_PATH?=include/hiredis +LIBRARY_PATH?=lib +INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) +INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH) + +ifeq ($(uname_S),SunOS) + INSTALL?= cp -r +endif + +INSTALL?= cp -a + install: $(DYLIBNAME) $(STLIBNAME) mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH) @@ -122,7 +128,6 @@ install: $(DYLIBNAME) $(STLIBNAME) cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME) $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH) - 32bit: @echo "" @echo "WARNING: if it fails under Linux you probably need to install libc6-dev-i386" -- cgit v1.2.3