support -extra level version for pkgconfig. this is useful when we release bugfix version

This commit is contained in:
Nguyen Anh Quynh 2014-03-07 17:11:18 +08:00
parent 714aa91ebb
commit 3ff259c0ec
3 changed files with 17 additions and 9 deletions

6
CONFIG
View File

@ -1,6 +0,0 @@
// Package version
#define PKG_MAJOR 2
#define PKG_MINOR 1

View File

@ -2,6 +2,7 @@
# By Nguyen Anh Quynh <aquynh@gmail.com>, 2013>
include config.mk
include pkgconfig.mk # package version
ifeq ($(CROSS),)
CC ?= cc
@ -188,8 +189,6 @@ LIBRARY = lib$(LIBNAME).$(EXT)
ARCHIVE = lib$(LIBNAME).$(AR_EXT)
PKGCFGF = $(LIBNAME).pc
VERSION=$(shell echo `grep -e PKG_MAJOR -e PKG_MINOR CONFIG | grep -v = | awk '{print $$3}'` | awk '{print $$1"."$$2}')
.PHONY: all clean install uninstall dist
all: $(LIBRARY) $(ARCHIVE) $(PKGCFGF)
@ -232,7 +231,11 @@ $(ARCHIVE): $(LIBOBJ)
$(PKGCFGF):
echo 'Name: capstone' > $(PKGCFGF)
echo 'Description: Capstone disassembly engine' >> $(PKGCFGF)
echo 'Version: $(VERSION)' >> $(PKGCFGF)
ifeq ($(PKG_EXTRA),)
echo 'Version: $(PKG_MAJOR).$(PKG_MINOR)' >> $(PKGCFGF)
else
echo 'Version: $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA)' >> $(PKGCFGF)
endif
echo 'libdir=$(LIBDIR)' >> $(PKGCFGF)
echo 'includedir=$(PREFIX)/include/capstone' >> $(PKGCFGF)
echo 'archive=$${libdir}/libcapstone.a' >> $(PKGCFGF)

11
pkgconfig.mk Normal file
View File

@ -0,0 +1,11 @@
# Package version of Capstone for Makefile.
# To be used to generate capstone.pc for pkg-config
# version major & minor
PKG_MAJOR = 2
PKG_MINOR = 1
# version bugfix level. Example: PKG_EXTRA = 1
PKG_EXTRA =