From ce74872c452ce27f1eccb8f297999f7eb252a32d Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Tue, 11 May 2021 09:44:09 -0400 Subject: [PATCH] Generate acheam.pc from DESTDIR in Makefile --- .gitignore | 1 + Makefile | 5 ++++- acheam.pc.in | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 acheam.pc.in diff --git a/.gitignore b/.gitignore index ee15c0d..fddbcfb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.a *.so +acheam.pc man/* !man/*.scd diff --git a/Makefile b/Makefile index a301e4a..3d0bd0d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ DESTDIR ?= /usr/local CFLAGS := -Wall -Wextra -pedantic -std=c99 -fPIC ${CFLAGS} -all: shared static man +all: shared static man pkgconfig shared: ${CC} -shared ${LDFLAGS} -o libacheam.so src/libacheam/*.c ${CFLAGS} @@ -10,6 +10,9 @@ static: ${CC} ${LDFLAGS} src/libacheam/*.c ${CFLAGS} -c ar rcs libacheam.a *.o +pkgconfig: + sed "s|PREFIX_HERE|${DESTDIR}|g" acheam.pc.in > acheam.pc + man: for i in man/*.scd; do \ outp=$$(echo "$$i" | rev | cut -f 2- -d '.' | rev); \ diff --git a/acheam.pc.in b/acheam.pc.in new file mode 100644 index 0000000..6878d5a --- /dev/null +++ b/acheam.pc.in @@ -0,0 +1,11 @@ +prefix=PREFIX_HERE +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: libacheam +Version: 0.0.0 +Description: Armaan's personal C library +Requires: +Cflags: -I${includedir}/ +Libs: -L${libdir} -lacheam -- 2.39.2