Commit 1cee5a37 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Introduce PKG_CONFIG and AR (fixes #470)

Thanks to Thomas Witt for the initial patch.
Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 99d8d483
......@@ -48,7 +48,7 @@ all: ${PROJECTNV} ${BUILDDIR}/${PROJECT}.pc po
# pkg-config based version checks
.version-checks/%: config.mk
$(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \
pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
${PKG_CONFIG} --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
echo "The minimum required version of $(*) is $($(*)_MIN_VERSION)" && \
false \
)
......@@ -140,7 +140,7 @@ ${BUILDDIR_DEBUG}/%.o: %.c
${BUILDDIR_DEBUG}/${BINDIR}/lib${PROJECT}.a: ${OBJECTS_DEBUG}
$(call colorecho,AR,$@)
@mkdir -p ${BUILDDIR_DEBUG}/${BINDIR}
$(QUIET)ar rcs $@ ${OBJECTS_DEBUG}
$(QUIET)${AR} rcs $@ ${OBJECTS_DEBUG}
${BUILDDIR_DEBUG}/${BINDIR}/lib${PROJECT}.so.${SOVERSION}: ${OBJECTS_DEBUG}
$(call colorecho,LD,$@)
......@@ -169,7 +169,7 @@ ${BUILDDIR_GCOV}/%.o: %.c
${BUILDDIR_GCOV}/${BINDIR}/lib${PROJECT}.a: ${OBJECTS_GCOV}
$(call colorecho,AR,$@)
@mkdir -p ${BUILDDIR_GCOV}/${BINDIR}
$(QUIET)ar rcs $@ ${OBJECTS_GCOV}
$(QUIET)${AR} rcs $@ ${OBJECTS_GCOV}
${BUILDDIR_GCOV}/${BINDIR}/lib${PROJECT}.so.${SOVERSION}: ${OBJECTS_GCOV}
$(call colorecho,LD,$@)
......
......@@ -16,11 +16,14 @@ SOMAJOR = 2
SOMINOR = 0
SOVERSION = ${SOMAJOR}.${SOMINOR}
# pkg-config binary
PKG_CONFIG ?= pkg-config
# libnotify
WITH_LIBNOTIFY ?= $(shell (pkg-config libnotify --atleast-version=0.7.0 && echo 1) || echo 0)
WITH_LIBNOTIFY ?= $(shell (${PKG_CONFIG} libnotify --atleast-version=0.7.0 && echo 1) || echo 0)
# libjson-c
WITH_JSON ?= $(shell (pkg-config json-c --exists && echo 1) || echo 0)
WITH_JSON ?= $(shell (${PKG_CONFIG} json-c --exists && echo 1) || echo 0)
# paths
PREFIX ?= /usr
......@@ -51,17 +54,17 @@ GLIB_MIN_VERSION = 2.28
GLIB_PKG_CONFIG_NAME = glib-2.0
# libs
GTK_INC ?= $(shell pkg-config --cflags gtk+-3.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-3.0)
GTK_INC ?= $(shell ${PKG_CONFIG} --cflags gtk+-3.0)
GTK_LIB ?= $(shell ${PKG_CONFIG} --libs gtk+-3.0)
ifneq (${WITH_LIBNOTIFY},0)
LIBNOTIFY_INC ?= $(shell pkg-config --cflags libnotify)
LIBNOTIFY_LIB ?= $(shell pkg-config --libs libnotify)
LIBNOTIFY_INC ?= $(shell ${PKG_CONFIG} --cflags libnotify)
LIBNOTIFY_LIB ?= $(shell ${PKG_CONFIG} --libs libnotify)
endif
ifneq (${WITH_JSON},0)
JSON_INC ?= $(shell pkg-config --cflags json-c)
JSON_LIB ?= $(shell pkg-config --libs json-c)
JSON_INC ?= $(shell ${PKG_CONFIG} --cflags json-c)
JSON_LIB ?= $(shell ${PKG_CONFIG} --libs json-c)
endif
INCS = ${GTK_INC} ${LIBNOTIFY_INC} ${JSON_INC}
......@@ -79,6 +82,9 @@ DFLAGS = -O0 -g
# compiler
CC ?= gcc
# archiver
AR ?= ar
# strip
SFLAGS ?= -s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment