summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-06-18 16:28:33 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-06-18 16:28:57 +0200
commit461110e809f4d313832a9420db06d92b1f559372 (patch)
treee88dfc8f7ec366cd5b5b7d7fee3ef647bfbddc6f /Makefile
parentb2bf7ba8c0dbe9761910107ad9dedf77d150d4e8 (diff)
Move path variables closer to install target
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files 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"