mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 05:29:53 +00:00
link version lib to .so file for Linux
This commit is contained in:
parent
6d5381e0b5
commit
c0c0d529cf
9
Makefile
9
Makefile
@ -157,6 +157,7 @@ LIBOBJ += MCInst.o
|
||||
|
||||
UNAME_S := $(shell uname -s)
|
||||
PKGCFCGDIR = $(LIBDIR)/pkgconfig
|
||||
VERSION_EXT =
|
||||
|
||||
# OSX?
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
@ -194,9 +195,10 @@ CFLAGS := $(CFLAGS:-fPIC=)
|
||||
else
|
||||
# Linux, *BSD
|
||||
API_MAJOR=$(shell echo `grep -e CS_API_MAJOR include/capstone.h | grep -v = | awk '{print $$3}'` | awk '{print $$1}')
|
||||
EXT = so.$(API_MAJOR)
|
||||
EXT = so
|
||||
VERSION_EXT = $(EXT).$(API_MAJOR)
|
||||
AR_EXT = a
|
||||
LDFLAGS += -Wl,-soname,lib$(LIBNAME).$(EXT)
|
||||
LDFLAGS += -Wl,-soname,lib$(LIBNAME).$(VERSION_EXT)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@ -262,6 +264,9 @@ endif
|
||||
install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY)
|
||||
mkdir -p $(LIBDIR)
|
||||
$(INSTALL_LIBRARY) lib$(LIBNAME).$(EXT) $(LIBDIR)
|
||||
ifneq ($(VERSION_EXT),)
|
||||
ln -s $(LIBDIR)/lib$(LIBNAME).$(EXT) $(LIBDIR)/lib$(LIBNAME).$(VERSION_EXT)
|
||||
endif
|
||||
$(INSTALL_DATA) lib$(LIBNAME).$(AR_EXT) $(LIBDIR)
|
||||
mkdir -p $(INCDIR)/$(LIBNAME)
|
||||
$(INSTALL_DATA) include/*.h $(INCDIR)/$(LIBNAME)
|
||||
|
Loading…
Reference in New Issue
Block a user