diff options
author | Jannis Teunissen <jannis@teunissen.net> | 2019-05-01 22:20:19 +0200 |
---|---|---|
committer | Jannis Teunissen <jannis@teunissen.net> | 2019-05-01 22:20:19 +0200 |
commit | c0be644d82e659f11b7bd7679342cd14bacddbb5 (patch) | |
tree | 512b0a4a92a4c16926032e7921764f4520f630ef | |
parent | 33802dc273fa976a07b9b3bff4fc68ac40a018a9 (diff) | |
download | purple-matrix-c0be644d82e659f11b7bd7679342cd14bacddbb5.tar.gz |
Abort if pkg-config returns an error
Before, if one of the packages was not found, CFLAGS was not updated, which led
to unexpected error messages.
-rw-r--r-- | Makefile | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -4,9 +4,21 @@ CC=gcc LIBS=purple json-glib-1.0 glib-2.0 sqlite3 PKG_CONFIG=pkg-config -CFLAGS+=$(shell $(PKG_CONFIG) --cflags $(LIBS)) + +PKG_CFLAGS=$(shell $(PKG_CONFIG) --cflags $(LIBS) || echo "FAILED") +ifeq ($(PKG_CFLAGS),FAILED) +$(error "$(PKG_CONFIG) failed") +else +CFLAGS+=$(PKG_CFLAGS) +endif CFLAGS+=-fPIC -DPIC -LDLIBS+=$(shell $(PKG_CONFIG) --libs $(LIBS)) + +PKG_LDLIBS=$(shell $(PKG_CONFIG) --libs $(LIBS) || echo "FAILED") +ifeq ($(PKG_LDLIBS),FAILED) +$(error "$(PKG_CONFIG) failed") +else +LDLIBS+=$(PKG_LDLIBS) +endif LDLIBS+=-lhttp_parser ifndef MATRIX_NO_E2E |