fix: makefile .PHONY directives were non-functional

It appears that .PHONY, and all other special built-in target names
should only be defined once, and should not be used as a "tag", as I
have done here.
This commit is contained in:
2026-02-05 15:46:03 +01:00
parent 8a01cd3a47
commit d4e281a477

View File

@@ -52,32 +52,32 @@ LDLIBS += -lopengl32 -lgdi32 $(warning Detected Windows_NT, please refer to the
endif endif
# Default target; compiles everything. # Default target; compiles everything.
.PHONY: PHONY = all
all: bin/$(NAME) bin/stripped_$(NAME) all: bin/$(NAME) bin/stripped_$(NAME)
# Install a binary on a POSIX-compliant system. # Install a binary on a POSIX-compliant system.
.PHONY: PHONY += install
install: bin/$(NAME) install: bin/$(NAME)
install -m0755 bin/$(NAME) $(DESTDIR)/bin/$(NAME) install -m0755 bin/$(NAME) $(DESTDIR)/bin/$(NAME)
# Install a stripped binary on a POSIX-compliant system # Install a stripped binary on a POSIX-compliant system
.PHONY: PHONY += install-strip
install-strip: bin/$(NAME).stripped install-strip: bin/$(NAME).stripped
install -m0755 bin/stripped_$(NAME) $(DESTDIR)/bin/$(NAME) install -m0755 bin/stripped_$(NAME) $(DESTDIR)/bin/$(NAME)
.PHONY: PHONY += uninstall
uninstall: uninstall:
$(RM) $(DESTDIR)/bin/$(NAME) $(RM) $(DESTDIR)/bin/$(NAME)
.PHONY: PHONY += check-sparse
check-sparse: $(SRC) check-sparse: $(SRC)
-$(Q)$(SPARSE) $(CFLAGS) $(CPPFLAGS) $(SRC) -$(Q)$(SPARSE) $(CFLAGS) $(CPPFLAGS) $(SRC)
.PHONY: PHONY += check-gcc
check-gcc: $(SRC) check-gcc: $(SRC)
-$(Q)$(CC) -fanalyzer $(CFLAGS) $(CPPFLAGS) $(SRC) -$(Q)$(CC) -fanalyzer $(CFLAGS) $(CPPFLAGS) $(SRC)
.PHONY: PHONY += clean
clean: clean:
-$(Q)$(RM) $(OBJ) $(DEP) -$(Q)$(RM) $(OBJ) $(DEP)
-$(Q)$(RM) -r bin/ -$(Q)$(RM) -r bin/
@@ -105,3 +105,5 @@ bin/stripped_$(NAME): $(OBJ) | bin/
ifeq (0, $(words $(findstring $(MAKECMDGOALS), clean))) ifeq (0, $(words $(findstring $(MAKECMDGOALS), clean)))
-include $(DEP) -include $(DEP)
endif endif
.PHONY: $(PHONY)