Makefile: install package config .pc file.

This commit is contained in:
Philippe PITTOLI 2024-05-31 19:29:55 +02:00
parent 3190dae731
commit c5aad3535a
2 changed files with 18 additions and 6 deletions

8
ipc.pc Normal file
View File

@ -0,0 +1,8 @@
includedir=/usr/local/include
libdir=/usr/local/lib
Name: LibIPC
Description: The simplest Inter Process Communication library
Version: 0.1.0
Libs: -L${libdir} -lipc
Cflags: -I${includedir}

View File

@ -14,13 +14,17 @@ build:
PREFIX ?= /usr/local PREFIX ?= /usr/local
LIBDIR ?= $(PREFIX)/lib LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include INCLUDEDIR ?= $(PREFIX)/include
PKGCONFIGDIR ?= /usr/share/pkgconfig
install-pkgconfig:
[ -d $(PKGCONFIGDIR) ] || install -m 0755 -d $(PKGCONFIGDIR)
install -m 0644 ipc.pc $(PKGCONFIGDIR)
install-library: install-library:
[ -d $(LIBDIR) ] || install -m 0755 -d $(LIBDIR) [ -d $(LIBDIR) ] || install -m 0755 -d $(LIBDIR)
install zig-out/lib/libipc* $(LIBDIR) install -m 0644 zig-out/lib/libipc.so $(LIBDIR)
install-header: install-header:
[ -d $(INCLUDEDIR) ] || install -m 0755 -d $(INCLUDEDIR) [ -d $(INCLUDEDIR) ] || install -m 0755 -d $(INCLUDEDIR)
install libipc.h $(INCLUDEDIR) install -m 0644 libipc.h $(INCLUDEDIR)
install: install-library install-header install: install-pkgconfig install-library install-header
uninstall-library: uninstall-library:
rm $(LIBDIR)/libipc.a \ rm $(LIBDIR)/libipc.a \