From 7ef3d16b5349c35b0f0e1168456bb8bf1bec0ee9 Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 22 Jan 2026 12:52:47 +0100 Subject: [PATCH] Use `NAME` instead of hard-coding the name. Windows NT systems use the `.exe` extension, and thus binary name cannot be hard-coded. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6ff5c47..3a34d01 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ SHELL = /bin/sh .SUFFIXES: VERSION = 0.0 +NAME = mcaselector-lite CMAKE ?= cmake -G 'Unix Makefiles' XXD ?= xxd @@ -57,7 +58,7 @@ endif # Default target; compiles everything. .PHONY: -all: bin/mcaselector-lite bin/mcaselector-lite.stripped +all: bin/$(NAME) bin/stripped_$(NAME) # TODO: Compile libraries with `all` # TODO: Write install recipe to install into DESTDIR, for UNIX® type systems, and Windows NT alongside uninstall recipes. @@ -78,10 +79,10 @@ clean: -$(Q)$(RM) -r bin/ # Links together the object files into the final binary. -bin/mcaselector-lite: $(OBJ) | bin/ +bin/$(NAME): $(OBJ) | bin/ $(Q)$(call msg-ld,$@) $(Q)$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^ -bin/mcaselector-lite.stripped: $(OBJ) | bin/ +bin/stripped_$(NAME): $(OBJ) | bin/ $(Q)$(call msg-ld,$@) $(Q)$(CC) -s $(LDFLAGS) $(LDLIBS) -o $@ $^