aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-16 00:13:24 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-16 00:38:06 +0200
commitef14ee964ac098888a662b0a98fd88869d255d86 (patch)
tree0080fe7b5549180ecb5b229d2015fe25c401a7ae /Makefile
parentd0d843b7046ced76336604450f8eb78b4decfa09 (diff)
downloaddynstr-ef14ee964ac098888a662b0a98fd88869d255d86.tar.gz
Install .pc file
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 784e171..f032535 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,8 @@
.POSIX:
PREFIX = /usr/local
+DST = $(PREFIX)/lib
+PC_DST = $(DST)/pkgconfig
PROJECT = libdynstr.a
CFLAGS = -Iinclude
DEPS = \
@@ -22,7 +24,7 @@ DEPS = \
all: $(PROJECT)
-install: $(PROJECT)
+install: $(PROJECT) $(PC_DST)/dynstr.pc
mkdir -p $(PREFIX)/include
cp include/dynstr.h $(PREFIX)/include
chmod 0644 $(PREFIX)/include/dynstr.h
@@ -35,3 +37,8 @@ clean:
$(PROJECT): $(DEPS)
$(AR) $(ARFLAGS) $@ $(DEPS)
+
+$(PC_DST)/dynstr.pc: dynstr.pc
+ mkdir -p $(PC_DST)
+ sed -e 's,/usr/local,$(PREFIX),' $< > $@
+ chmod 0644 $@