From 32d48c6b69b27bdf0624cb4545499223c8c630a2 Mon Sep 17 00:00:00 2001 From: itycodes Date: Wed, 4 Feb 2026 04:20:24 +0100 Subject: [PATCH] Make the install target a bit more robust PREFIX should be the containing dir for program files, /bin/ should be appended by the target itself. Additionally, the install target now creates the target directory if it doesn't exist. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 74cd789..6d53d06 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CC ?= gcc CLIBS = -lwayland-client CFLAGS = $(CLIBS) -PREFIX ?= /usr/local/bin/ +PREFIX ?= /usr/local/ SRC = main.c OUT = wl-globals @@ -15,7 +15,8 @@ clean: rm -f $(OUT) install: - cp $(OUT) $(PREFIX) + mkdir -p "$(PREFIX)/bin/" + cp $(OUT) "$(PREFIX)/bin/" $(OUT): $(SRC) $(CC) $(SRC) $(CFLAGS) -o $(OUT)