From 0171dfeb0d029dfa1669959212531bdf7c6f4e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B7=E3=83=BC=E3=81=AF=E3=83=87=E3=82=A3=E3=83=BC?= =?UTF-8?q?=E5=9B=9B=E3=82=92=E5=8F=96=E3=82=8B?= <1396303+cxd4@users.noreply.github.com> Date: Mon, 26 May 2025 17:42:16 -0400 Subject: [PATCH] Implement non-Windows codepaths in GNU Makefile --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index f4f18ba..6414aaa 100644 --- a/Makefile +++ b/Makefile @@ -34,14 +34,29 @@ BASICOPTS = -g -D_DEBUG BUILD_TYPE = Debug endif +# Establish MinGW port prefix for Microsoft Windows 2000, XP, Vista, 7, 10 and still running... +ifeq ($(OS),Windows_NT) BUILD_PREFIX = i686-w64-mingw32- +endif + CC = $(BUILD_PREFIX)gcc CXX = $(BUILD_PREFIX)g++ WINDRES = $(BUILD_PREFIX)windres + COMMON_FLAGS = -msse2 -DSSE2_SUPPORT -mstackrealign -I"3rd Party/directx/include" -I"3rd Party" -Wall -Wno-attributes -Wno-unknown-pragmas # -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 +ifeq ($(BUILD_ARCH),x86_64) +ifneq ($(OS),Windows_NT) +COMMON_FLAGS := -fPIC # position-independent code needed for 64-bit POSIX executables but not Windows builds +endif +endif + CFLAGS = $(BASICOPTS) $(COMMON_FLAGS) CXXFLAGS = $(BASICOPTS) $(COMMON_FLAGS) $(CPPFLAGS) +ifeq ($(OS),Windows_NT) LDFLAGS = -static-libstdc++ -static-libgcc -static -lole32 -lcomctl32 -lwinmm -ldsound -lksuser +else +LDFLAGS = -static-libstdc++ -static-libgcc -static # -lSDL[2]? -lopenal? -lpipewire? +endif # Define the target directories. BINDIR=bin