diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -36,6 +36,10 @@ endif prefix=/usr/local libdir=$(prefix)/lib includedir=$(prefix)/include +pkgconfigdir=$(libdir)/pkgconfig + +pkglibdir=$(libdir:$(prefix)/%=%) +pkgincludedir=$(includedir:$(prefix)/%=%) # meta targets @@ -45,6 +49,7 @@ all: libutf8proc.a libutf8proc.$(SHLIB_EXT) clean: rm -f utf8proc.o libutf8proc.a libutf8proc.$(SHLIB_VERS_EXT) libutf8proc.$(SHLIB_EXT) + rm -f libutf8proc.pc ifneq ($(OS),Darwin) rm -f libutf8proc.so.$(MAJOR) endif @@ -86,12 +91,22 @@ libutf8proc.$(MAJOR).dylib: utf8proc.o libutf8proc.dylib: libutf8proc.$(MAJOR).dylib ln -f -s libutf8proc.$(MAJOR).dylib $@ -install: libutf8proc.a libutf8proc.$(SHLIB_EXT) libutf8proc.$(SHLIB_VERS_EXT) +libutf8proc.pc: libutf8proc.pc.in + sed \ + -e 's#PREFIX#$(prefix)#' \ + -e 's#LIBDIR#$(pkglibdir)#' \ + -e 's#INCLUDEDIR#$(pkgincludedir)#' \ + -e 's#VERSION#$(MAJOR).$(MINOR).$(PATCH)#' \ + libutf8proc.pc.in > libutf8proc.pc + +install: libutf8proc.a libutf8proc.$(SHLIB_EXT) libutf8proc.$(SHLIB_VERS_EXT) libutf8proc.pc mkdir -m 755 -p $(DESTDIR)$(includedir) $(INSTALL) -m 644 utf8proc.h $(DESTDIR)$(includedir) mkdir -m 755 -p $(DESTDIR)$(libdir) $(INSTALL) -m 644 libutf8proc.a $(DESTDIR)$(libdir) $(INSTALL) -m 755 libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir) + mkdir -m 755 -p $(DESTDIR)$(pkgconfigdir) + $(INSTALL) -m 644 libutf8proc.pc $(DESTDIR)$(pkgconfigdir)/libutf8proc.pc ln -f -s libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.$(SHLIB_EXT) ifneq ($(OS),Darwin) ln -f -s libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR) |