src makefile: Abort compilation when pkg-config is not in PATH

Fixes #1792
This commit is contained in:
Frank LENORMAND 2018-01-11 10:40:38 +03:00
parent c308cddcd8
commit 202c977b3d

View File

@ -24,7 +24,7 @@ sources := $(sort $(wildcard *.cc))
objects := $(addprefix ., $(sources:.cc=$(suffix).o)) objects := $(addprefix ., $(sources:.cc=$(suffix).o))
deps := $(addprefix ., $(sources:.cc=$(suffix).d)) deps := $(addprefix ., $(sources:.cc=$(suffix).d))
PKG_CONFIG ?= pkg-config PKG_CONFIG ?= $(shell command -v pkg-config 2>/dev/null)
PREFIX ?= /usr/local PREFIX ?= /usr/local
DESTDIR ?= # root dir DESTDIR ?= # root dir
@ -66,7 +66,12 @@ endif
CXXFLAGS += -pedantic -std=gnu++14 -g -Wall -Wextra -Wno-unused-parameter -Wno-reorder -Wno-sign-compare -Wno-address -Wno-noexcept-type -Wno-unknown-attributes -Wno-unknown-warning-option CXXFLAGS += -pedantic -std=gnu++14 -g -Wall -Wextra -Wno-unused-parameter -Wno-reorder -Wno-sign-compare -Wno-address -Wno-noexcept-type -Wno-unknown-attributes -Wno-unknown-warning-option
all : kak all : check_pkg_config kak
check_pkg_config:
ifeq ($(PKG_CONFIG),)
$(error "pkg-config not found in PATH")
endif
kak : kak$(suffix) kak : kak$(suffix)
ln -sf $< $@ ln -sf $< $@