handle special systems putting x86_64 libs into lib64/ in make.sh, not in Makefile

_v3_old
Nguyen Anh Quynh 11 years ago
parent 217684f197
commit 897e10ff4b
  1. 16
      Makefile
  2. 24
      make.sh

@ -30,17 +30,13 @@ PREFIX ?= /usr
DESTDIR ?=
INCDIR = $(DESTDIR)$(PREFIX)/include
LIBDIR = $(DESTDIR)$(PREFIX)/lib
# on x86_64, we might have /usr/lib64 directory instead of /usr/lib
UNAME_M := $(shell uname -m)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_M), x86_64)
ifeq (,$(wildcard $(LIBDIR)))
ifneq ($(UNAME_S), Darwin)
LIBDIR = $(DESTDIR)$(PREFIX)/lib64
endif
endif
endif
LIBDIRARCH ?= lib
# Uncomment the below line to installs x86_64 libs to lib64/ directory.
# Or better, pass 'LIBDIRARCH=lib64' to 'make install/uninstall' via 'make.sh'.
#LIBDIRARCH ?= lib64
LIBDIR = $(DESTDIR)$(PREFIX)/$(LIBDIRARCH)
ifneq ($(UNAME_S),Darwin)
LDFLAGS += -shared

@ -49,11 +49,19 @@ function install {
${MAKE} install
fi
fi
else
if [ ${CC}x != x ]; then
${MAKE} CC=$CC install
else # not OSX
if test -d /usr/lib64; then
if [ ${CC}x != x ]; then
${MAKE} LIBDIRARCH=lib64 CC=$CC install
else
${MAKE} LIBDIRARCH=lib64 install
fi
else
${MAKE} install
if [ ${CC}x != x ]; then
${MAKE} CC=$CC install
else
${MAKE} install
fi
fi
fi
}
@ -68,8 +76,12 @@ function uninstall {
else
${MAKE} uninstall
fi
else
${MAKE} uninstall
else # not OSX
if test -d /usr/lib64; then
${MAKE} LIBDIRARCH=lib64 uninstall
else
${MAKE} uninstall
fi
fi
}

Loading…
Cancel
Save