From 793d46f7a6e53e6ca66ccd1372867d438f155aff Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 10 May 2023 15:27:02 +0200 Subject: Add PC_FILE var --- Makefile | 8 ++++---- config.mk | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 49dcb99..1ff93e4 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ include config.mk dist: static shared - ./build-pc.sh -p ${PREFIX} -n ${NAME} -ln ${LIBNAME} -d "${LIBDSCR}" -v ${LIBVER} ${NAME}.pc + ./build-pc.sh -p ${PREFIX} -n ${NAME} -ln ${LIBNAME} -d "${LIBDSCR}" -v ${LIBVER} ${PC_FILE} static: @make OPT='-O2 -pipe -Werror' ${LIBNAME:=.a} @@ -26,7 +26,7 @@ ${LIBNAME:=.a}: ${OBJ} ${CC} ${CFLAGS} -c $< -o $@ clean: - rm -f ${OBJ} ${LIBNAME}.* *.core + rm -f ${OBJ} ${LIBNAME}.* *.core ${PC_FILE} cd test && make clean tests: dist @@ -38,10 +38,10 @@ install: dist cp src/utils.h ${PREFIX}/include/utils.h cp ${LIBNAME:=.so} ${PREFIX}/lib/${LIBNAME:=.so} cp ${LIBNAME:=.a} ${PREFIX}/lib/${LIBNAME:=.a} - cp utils.pc ${PKG_CONFIG_PATH}/utils.pc + cp ${PC_FILE} ${PKG_CONFIG_PATH}/${PC_FILE} uninstall: rm -f ${PREFIX}/include/utils.h rm -f ${PREFIX}/lib/${LIBNAME:=.so} rm -f ${PREFIX}/lib/${LIBNAME:=.a} - rm -f ${PKG_CONFIG_PATH}/utils.pc + rm -f ${PKG_CONFIG_PATH}/${PC_FILE} diff --git a/config.mk b/config.mk index 3388b9f..2b56135 100644 --- a/config.mk +++ b/config.mk @@ -11,6 +11,8 @@ LIBNAME = lib${NAME} LIBDSCR = A utility library LIBVER = 0.0.1 +PC_FILE = ${NAME}.pc + CFLAGS = -Wall --std=c99 -pedantic ${OPT} -DLIBVER=\"${LIBVER}\" PKG_CONFIG_PATH != pkg-config --variable pc_path pkg-config | sed -E "s|.*(${PREFIX}[^:]*)[:].*|\1|g" -- cgit v1.2.3