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

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