added pkg-config functionality

This commit is contained in:
Noah Swerhun 2022-02-11 15:10:09 -06:00
parent 25cb64d2f2
commit c8abf83960

View file

@ -14,6 +14,8 @@ SRCDIR="src"
OBJDIR="obj"
MAKEFILE=".makefile"
PKG_CONFIG_LIBS=""
HEADER_DIR="include"
# -------------------
@ -26,6 +28,9 @@ OBJ="$(find ${SRCDIR} -name '*\.c' 2> /dev/null |
srcnum="$(find ${SRCDIR} -name '*\.c' -exec printf %c {} + 2> /dev/null | wc -c)"
CFLAGS="${CFLAGS} $(pkg-config --cflags "${PKG_CONFIG_LIBS}")"
LDLIBS="${CFLAGS} $(pkg-config --libs "${PKG_CONFIG_LIBS}")"
clear_formatting="\033[0m"
bold="\033[1m"
info_color="\033[34m" # default: "\033[34m" - blue
@ -54,6 +59,9 @@ Customization:
(default: src)
OBJDIR the directory where compiled objects will be placed. (default: obj)
MAKEFILE the filename of the generated makefile (default: .makefile)
PKG_CONFIG_LIBS uses flags generated by pkg-config for the given library
name.
HEADER_DIR the directory in which header files will be placed by the 'new'
command. Note that this is relative to SRCDIR. Setting this to