From 5da441b6fc88d682f31e979a0756d819ed9410fd Mon Sep 17 00:00:00 2001 From: Raheman Vaiya Date: Tue, 20 Sep 2022 02:39:54 -0400 Subject: [PATCH] Makefile: Fix PREFIX --- Makefile | 5 ++--- src/config.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index dc374f9..828338d 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,8 @@ .PHONY: all clean install uninstall debug man compose test-harness -DESTDIR= -PREFIX=/usr - VERSION=2.4.2 COMMIT=$(shell git describe --no-match --always --abbrev=7 --dirty) VKBD=uinput +PREFIX=/usr CONFIG_DIR=/etc/keyd SOCKET_PATH=/var/run/keyd.socket @@ -18,6 +16,7 @@ CFLAGS:=-DVERSION=\"v$(VERSION)\ \($(COMMIT)\)\" \ -std=c11 \ -DSOCKET_PATH=\"$(SOCKET_PATH)\" \ -DCONFIG_DIR=\"$(CONFIG_DIR)\" \ + -DDATA_DIR=\"$(PREFIX)/share/keyd\" \ -D_DEFAULT_SOURCE \ $(CFLAGS) diff --git a/src/config.c b/src/config.c index bcfe505..5c7d55e 100644 --- a/src/config.c +++ b/src/config.c @@ -92,7 +92,7 @@ static const char *resolve_include_path(const char *path, const char *include_pa if (!access(resolved_path, F_OK)) return resolved_path; - snprintf(resolved_path, sizeof resolved_path, "/usr/share/keyd/%s", include_path); + snprintf(resolved_path, sizeof resolved_path, DATA_DIR"/%s", include_path); if (!access(resolved_path, F_OK)) return resolved_path;