From 8be26b605e52bc4f924efedb47dc13b951a608db Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Thu, 12 Nov 2026 14:13:47 -0300 Subject: [PATCH] Makefile: fix the systemdsystemunitdir lookup Commit aa43445 ("install systemd services based on pkg-config system variables") assigns systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd); but in Make '$(' starts a variable reference, not a shell command, so pkg-config never runs. The value ends up as ';', the emptiness check passes, and the units are installed as "$(DESTDIR);/easysplash-*.service". Run pkg-config through $(shell ...), and use ?= so a packager can still set the directory explicitly. Also fix the abort path: a tab-indented $(error ...) outside a rule is parsed as a recipe line ("recipe commences before first target"), and the call had an extra ')'. Tested with make -n install-service: - SYSTEMD=1 with pkg-config: units go to systemd.pc's systemdsystemunitdir - SYSTEMD=1 systemdsystemunitdir=...: the given directory is used - SYSTEMD=1 without systemd.pc: "Could not find systemd.pc file. Aborting." - SYSTEMD=0: unchanged Signed-off-by: Luciano Dittgen --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0c8c136..70fb9db 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,10 @@ DEFAULT_ANIMATION ?= ossystems-demo SYSTEMD ?= 0 ifeq ($(SYSTEMD),1) PKG_CONFIG ?= pkg-config - systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd); + systemdsystemunitdir ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd) ARGS += --features systemd ifeq ($(strip $(systemdsystemunitdir)),) - $(error Could not find systemd.pc file. Aborting)) + $(error Could not find systemd.pc file. Aborting) endif endif