From a5950b94d56f6e35c3dca2e1ad2ff334aacaa070 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Wed, 12 Jun 2024 22:50:15 +0100 Subject: [PATCH 1/3] Don't include -Werror in CFLAGS Distributions don't like -Werror because it prevents end users from building the software using newer compilers that may raise warnings you don't know about yet. This is particularly bad for source-based distributions like Gentoo. --- Makefile | 2 +- Makefile.w32 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 686e636..808b36b 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ ifndef bindir endif -CFLAGS+=-Wall -Werror $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\" +CFLAGS+=-Wall $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\" SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \ level.c intro.c text.c status.c transition.c hiscore.c dialog.c \ diff --git a/Makefile.w32 b/Makefile.w32 index 92f60c5..17dd71a 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -12,7 +12,7 @@ ifndef OPTIMIZE OPTIMIZE=-O2 endif -CFLAGS=-Wall -Werror -Wno-error=pointer-sign $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\".\" -DHISCOREPREFIX=\".\" -DWIN32 -fstack-protector +CFLAGS+=-Wall -Wno-error=pointer-sign $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\".\" -DHISCOREPREFIX=\".\" -DWIN32 -fstack-protector SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \ level.c intro.c text.c status.c transition.c hiscore.c dialog.c \ -- 2.45.1 From 6ee6046bf1f9893a3c4bfd239871b3296c90b047 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Wed, 12 Jun 2024 22:54:52 +0100 Subject: [PATCH 2/3] Include LDFLAGS earlier in the linking command Some flags need to come before the inputs in order to be effective. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 808b36b..45a7035 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,7 @@ icebreaker.exe: $(DISTFILES) [ -d win32.build ] && rm -rf win32.build || true icebreaker: $(SRC:.c=.o) - $(CC) $(CFLAGS) $^ -o icebreaker $(SDL_LIB) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o icebreaker $(SDL_LIB) man: icebreaker.6 -- 2.45.1 From 40b865e7776962d45e082fed4904b4c2690b753f Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sat, 15 Jun 2024 11:09:45 +0100 Subject: [PATCH 3/3] Silence error when rpm command doesn't exist and add fallback The error can trigger QA warnings in non-RPM distros. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 45a7035..5a497ce 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ MAKENSIS=makensis WINDLLS=SDL.dll SDL_mixer.dll libgcc_s_dw2-1.dll libvorbisfile-3.dll libvorbis-0.dll libogg-0.dll libssp-0.dll libwinpthread-1.dll export WINARCH -RPMARCH := $(shell rpm --eval %{_arch} ) +RPMARCH := $(shell rpm --eval %{_arch} 2>/dev/null || echo none) RPMOPTS= RPMCRAZYDEFINES := --define "_topdir %(pwd)/rpmbuild" --define "_sourcedir %(pwd)" --define "_specdir %(pwd)" --define "_tmppath %(pwd)/rpmbuild/tmp/" --define "_builddir %(pwd)/rpmbuild/build/" --define "_rpmdir %(pwd)" --define "_srcrpmdir %(pwd)" --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" -- 2.45.1