forked from HarbourMasters/Shipwright
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux/GCC Support (HarbourMasters#28)
* Initial Linux/GCC support commit * Add instructins for linux in the README * apply suggestions by @Erotemic and @Emill * Fix python 3.10 symlink line * Fix func_80041E80 type mismatch (HarbourMasters#3) Type mismatch functions.h:664 * Makefile: clean OTRExporter/libultraship/ZAPDTR with distclean and fix CXX_FILES * Makefile: find C/CXX_FILES automatically * Makefile: remove ugly conditions in find commands * cleanup _MSC_VER usage * fix Windows build * cleanup extraction scripts * fix Windows build * Fix Windows path separator issue * fix rumble support for linux * use glew-cmake in dockerfile * add pulseaudio backend * fix ZAPDTR linkage * Check for "soh.elf" in directory (HarbourMasters#6) hide second button if `soh.exe` or `soh.elf` is present * Fix hardcoded segment addresses (HarbourMasters#5) * fix condition * hack lus -> soh dep for ZAPDTR Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>
- Loading branch information
Showing
44 changed files
with
585 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,96 @@ | ||
# Only used for standalone compilation, usually inherits these from the main makefile | ||
CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17 | ||
|
||
CXX := g++ | ||
CC := gcc | ||
AR := ar | ||
FORMAT := clang-format-11 | ||
|
||
ASAN ?= 0 | ||
DEBUG ?= 1 | ||
OPTFLAGS ?= -O0 | ||
LTO ?= 0 | ||
|
||
WARN := -Wall -Wextra -Werror \ | ||
-Wno-unused-variable \ | ||
-Wno-unused-parameter \ | ||
-Wno-unused-function \ | ||
-Wno-parentheses \ | ||
-Wno-narrowing \ | ||
-Wno-missing-field-initializers | ||
|
||
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 -m32 | ||
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 -m32 | ||
CPPFLAGS := -MMD | ||
|
||
ifneq ($(DEBUG),0) | ||
CXXFLAGS += -g -D_DEBUG | ||
CFLAGS += -g -D_DEBUG | ||
endif | ||
|
||
ifneq ($(ASAN),0) | ||
CXXFLAGS += -fsanitize=address | ||
CFLAGS += -fsanitize=address | ||
endif | ||
|
||
ifneq ($(LTO),0) | ||
CXXFLAGS += -flto | ||
CFLAGS += -flto | ||
endif | ||
|
||
SRC_DIRS := $(shell find -type d -not -path "*build*") | ||
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp)) | ||
H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h)) | ||
|
||
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f) | ||
LIB := otrlib.a | ||
CXX_FILES := \ | ||
$(shell find libultraship/Factories -name *.cpp) \ | ||
$(shell find libultraship/Lib/Fast3D -name *.cpp) \ | ||
$(shell find libultraship -maxdepth 1 -name *.cpp) \ | ||
$(shell find libultraship/Lib/ImGui -maxdepth 1 -name *.cpp) \ | ||
libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp \ | ||
libultraship/Lib/ImGui/backends/imgui_impl_sdl.cpp \ | ||
libultraship/Lib/StrHash64.cpp \ | ||
libultraship/Lib/tinyxml2/tinyxml2.cpp | ||
|
||
C_FILES := \ | ||
libultraship/mixer.c \ | ||
libultraship/Lib/stb/stb_impl.c | ||
|
||
FMT_FILES := $(shell find libultraship/ -type f \( -name *.cpp -o -name *.h \) -a -not -path "libultraship/Lib/*") | ||
|
||
O_FILES := \ | ||
$(CXX_FILES:%.cpp=build/%.o) \ | ||
$(C_FILES:%.c=build/%.o) | ||
|
||
D_FILES := $(O_FILES:%.o=%.d) | ||
|
||
LIB := libultraship.a | ||
|
||
INC_DIRS := $(addprefix -I, \ | ||
../ZAPDTR/ZAPDUtils \ | ||
libultraship/Lib/Fast3D/U64 \ | ||
libultraship/Lib/spdlog \ | ||
libultraship/Lib/spdlog/include \ | ||
libultraship \ | ||
) | ||
|
||
# create build directories | ||
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir))) | ||
$(shell mkdir -p $(SRC_DIRS:%=build/%)) | ||
|
||
all: $(LIB) | ||
|
||
clean: | ||
rm -rf build $(LIB) | ||
|
||
format: | ||
clang-format-11 -i $(CPP_FILES) $(H_FILES) | ||
$(FORMAT) -i $(FMT_FILES) | ||
|
||
.PHONY: all clean format | ||
|
||
build/%.o: %.cpp | ||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD/ZAPD -I ../ZAPD/ZAPDUtils -I ../../ZAPD/lib/tinyxml2 -I otrlib/Lib/spdlog/include -c $(OUTPUT_OPTION) $< | ||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@ | ||
|
||
build/%.o: %.c | ||
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@ | ||
|
||
$(LIB): $(O_FILES) | ||
$(AR) rcs $@ $^ | ||
|
||
-include $(D_FILES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "cvar.h" | ||
#include "Cvar.h" | ||
#include <map> | ||
#include <string> | ||
#include <PR/ultra64/gbi.h> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.