Closer align Makefiles & Dockerfiles (#748)

This commit is contained in:
David Chavez 2022-08-02 16:22:20 +02:00 committed by GitHub
commit 61c68666d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 116 additions and 175 deletions

View file

@ -16,26 +16,35 @@ DEBUG ?= 1
OPTFLAGS ?= -O0
LTO ?= 0
# flag to save whether the compiler being used is clang or gcc by checking CXX --version
CXX_IS_CLANG ?= $(shell $(CXX) --version | grep -c clang)
WARN := \
-Wno-return-type \
-Wno-unused-command-line-argument \
-Wno-implicit-function-declaration \
-Wno-c++11-narrowing \
-funsigned-char \
-fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -ffreestanding -fwrapv \
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -fpermissive -no-pie -nostdlib
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -no-pie -nostdlib
LDFLAGS :=
ifeq ($(UNAME), Linux) #LINUX
CXXFLAGS += -mhard-float -msse2 -mfpmath=sse
CFLAGS += -mhard-float -msse2 -mfpmath=sse
ifeq ($(CXX_IS_CLANG),1)
WARN += -Wno-c++11-narrowing
endif
ifeq ($(UNAME), Darwin) #APPLE
CXXFLAGS += $(shell pkg-config --cflags sdl2) $(shell sdl2-config --cflags) $(shell pkg-config --cflags glew) -framework OpenGL
CFLAGS += $(shell pkg-config --cflags sdl2) $(shell sdl2-config --cflags) $(shell pkg-config --cflags glew) -framework OpenGL
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -fpermissive -nostdlib $(shell pkg-config --cflags glew) $(shell sdl2-config --cflags)
CFLAGS := $(WARN) -std=c99 -Wno-implicit-function-declaration -D_GNU_SOURCE -nostdlib $(shell pkg-config --cflags glew) $(shell sdl2-config --cflags)
LDFLAGS :=
ifneq ($(CXX_IS_CLANG),1)
CXXFLAGS += -no-pie
CFLAGS += -no-pie
endif
ifeq ($(UNAME), Linux)
ifeq ($(UNAMEM), x86_64)
CXXFLAGS += -msse2 -mfpmath=sse -mhard-float
CFLAGS += -msse2 -mfpmath=sse -mhard-float
endif
CXXFLAGS += $(shell pkg-config --cflags libpulse)
CFLAGS += $(shell pkg-config --cflags libpulse)
endif
CPPFLAGS := -MMD
@ -57,11 +66,11 @@ ifneq ($(LTO),0)
LDFLAGS += -flto
endif
ifeq ($(UNAME), Linux) #LINUX
ifeq ($(UNAME), Linux)
TARGET := soh.elf
endif
ifeq ($(UNAME), Darwin) #APPLE
ifeq ($(UNAME), Darwin)
TARGET := soh-$(UNAMEM)
endif
@ -78,25 +87,15 @@ INC_DIRS := $(addprefix -I, \
../libultraship/libultraship/Lib/Fast3D/U64/PR \
)
ifeq ($(UNAME), Linux) #LINUX
INC_DIRS += $(addprefix -I, \
/opt/X11/include \
)
endif
LDDIRS := $(addprefix -L, \
../libultraship/ \
)
ifeq ($(UNAME), Linux) #LINUX
LDDIRS += $(addprefix -L, \
/opt/X11/lib \
)
endif
LDLIBS := \
$(ZAPDUTILS) \
$(LIBSTORM) \
$(shell sdl2-config --libs) \
$(shell pkg-config --libs glew) \
$(addprefix -l, \
dl \
bz2 \
@ -105,24 +104,16 @@ LDLIBS := \
ultraship \
)
ifeq ($(UNAME), Linux) #LINUX
LDLIBS += \
$(addprefix -l, \
X11 \
SDL2 \
GL \
GLEW \
pulse \
)
ifeq ($(UNAME), Linux)
LDLIBS += $(shell pkg-config --libs x11 libpulse)
endif
ifeq ($(UNAME), Darwin) #APPLE
ifeq ($(UNAME), Darwin)
LDLIBS += \
$(addprefix -framework , \
OpenGL \
Foundation \
) \
$(shell sdl2-config --libs) $(shell pkg-config --libs glew)
)
endif
ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*")

View file

@ -30,7 +30,7 @@
#include "ichain.h"
#include "regs.h"
#if defined(_WIN64) || defined(__x86_64__) || defined(__arm64__)
#if defined(__LP64__)
#define _SOH64
#endif

View file

@ -1001,7 +1001,7 @@ void DrawFlagsTab() {
// Draws a combo that lets you choose and upgrade value from a drop-down of text values
void DrawUpgrade(const std::string& categoryName, int32_t categoryId, const std::vector<std::string>& names) {
ImGui::Text(categoryName.c_str());
ImGui::Text("%s", categoryName.c_str());
ImGui::SameLine();
ImGui::PushID(categoryName.c_str());
if (ImGui::BeginCombo("##upgrade", names[CUR_UPG_VALUE(categoryId)].c_str())) {