Skip to content

Commit

Permalink
build: improve build
Browse files Browse the repository at this point in the history
* on FreeBSD systems lib and libdata directory differs
* rename INSTALL_LIBRARY to INSTALL_LIB, see details in
  http://www.freebsd.org/doc/en/books/porters-handbook/install.html

Signed-off-by: Oliver Pinter <[email protected]>
  • Loading branch information
opntr committed Mar 23, 2014
1 parent 017df60 commit c5ecae5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ LIBDIR = $(DESTDIR)$(PREFIX)/lib
endif
endif

LIBDATADIR = $(LIBDIR)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), FreeBSD)
LIBDATADIR = $(DESTDIR)$(PREFIX)/libdata
else
LIBDATADIR = $(LIBDIR)
endif

INSTALL_BIN ?= install
INSTALL_DATA ?= $(INSTALL_BIN) -m0644
INSTALL_LIBRARY ?= $(INSTALL_BIN) -m0755
INSTALL_LIB ?= $(INSTALL_BIN) -m0755

LIBNAME = capstone

Expand Down Expand Up @@ -156,7 +164,7 @@ LIBOBJ += MCInst.o


UNAME_S := $(shell uname -s)
PKGCFCGDIR = $(LIBDIR)/pkgconfig
PKGCFCGDIR = $(LIBDATADIR)/pkgconfig
VERSION_EXT =

# OSX?
Expand Down Expand Up @@ -265,7 +273,7 @@ install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY)
mkdir -p $(LIBDIR)
# remove potential broken old libs
rm -f $(LIBDIR)/lib$(LIBNAME).*
$(INSTALL_LIBRARY) lib$(LIBNAME).$(EXT) $(LIBDIR)
$(INSTALL_LIB) lib$(LIBNAME).$(EXT) $(LIBDIR)
ifneq ($(VERSION_EXT),)
ln -s $(LIBDIR)/lib$(LIBNAME).$(EXT) $(LIBDIR)/lib$(LIBNAME).$(VERSION_EXT)
endif
Expand Down

0 comments on commit c5ecae5

Please sign in to comment.