From ed6cbc2d40bfc1ad2453cf81aecf703a9e24f3a4 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 21 Mar 2022 22:42:25 -0700 Subject: [PATCH 1/5] Prevent tools from building during coop-compiler --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7bfa4e02..970fdf54 100644 --- a/Makefile +++ b/Makefile @@ -389,12 +389,15 @@ ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),) endif # Make tools if out of date - $(info Building tools...) - #DUMMY != $(MAKE) -s -C $(TOOLS_DIR) $(if $(filter-out ido0,$(COMPILER)$(USE_QEMU_IRIX)),all-except-recomp,) >&2 || echo FAIL - DUMMY != $(MAKE) -C $(TOOLS_DIR) >&2 || echo FAIL - ifeq ($(DUMMY),FAIL) - $(error Failed to build tools) - endif + ifeq ($(WINDOWS_AUTO_BUILDER),0) + $(info Building tools...) + #DUMMY != $(MAKE) -s -C $(TOOLS_DIR) $(if $(filter-out ido0,$(COMPILER)$(USE_QEMU_IRIX)),all-except-recomp,) >&2 || echo FAIL + DUMMY != $(MAKE) -C $(TOOLS_DIR) >&2 || echo FAIL + ifeq ($(DUMMY),FAIL) + $(error Failed to build tools) + endif + endif + $(info Building Game...) endif From e371ff272b73026c7e026206d31347116df0e7e7 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 21 Mar 2022 22:43:58 -0700 Subject: [PATCH 2/5] Revert "Fix smlua_field_valid for Lua" This reverts commit 5b69173d0a8318acec9216cfc86fe9fe0879e762. --- src/pc/lua/smlua_cobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pc/lua/smlua_cobject.c b/src/pc/lua/smlua_cobject.c index 2cd16adc..c3e87ae2 100644 --- a/src/pc/lua/smlua_cobject.c +++ b/src/pc/lua/smlua_cobject.c @@ -337,8 +337,8 @@ static bool smlua_field_valid(struct LuaObjectField* data, enum LuaObjectType lo size_t length = maximum - minimum; size_t maxlength = sizeof(void*) + sizeof(u32); - if (length < maxlength) { - return (data->lot == lot) && (data->valueOffset == offset) && (lot != LOT_NONE); + if (length >= maxlength) { + return (data->lot == lot) && (lot != LOT_NONE); } return (length >= maxlength); From 1910177b1db994fcb2b0fed86d895351d4ed1662 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 21 Mar 2022 16:46:31 -0700 Subject: [PATCH 3/5] Fix up Makefile for coop-compiler --- Makefile | 8 ++++---- Makefile.split | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 970fdf54..6c9a06cc 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,6 @@ include util.mk -# Dynos -include dynos.mk - # Default target default: all @@ -96,7 +93,7 @@ $(eval $(call validate-option,COMPILER,ido gcc)) ifeq ($(WINDOWS_AUTO_BUILDER),1) export SHELL=sh.exe - EXTRA_INCLUDES := ../include/1 ../include/2 ../include/3 ../include/4 + EXTRA_INCLUDES := -I ../include/1 -I ../include/2 -I ../include/3 -I ../include/4 EXTRA_CFLAGS := -Wno-expansion-to-defined EXTRA_CPP_INCLUDES := ../include/cpp @@ -476,6 +473,9 @@ GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists # File dependencies and variables for specific files include Makefile.split +# Dynos +include dynos.mk + # Source code files LEVEL_C_FILES := $(wildcard levels/*/leveldata.c) $(wildcard levels/*/script.c) $(wildcard levels/*/geo.c) C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES) diff --git a/Makefile.split b/Makefile.split index 6d69a252..346d3d12 100644 --- a/Makefile.split +++ b/Makefile.split @@ -188,12 +188,16 @@ endef ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) +ifeq ($(WINDOWS_AUTO_BUILDER),1) +include $(BUILD_DIR)/level_rules.mk +else $(BUILD_DIR)/level_rules.mk: levels/level_rules.mk levels/level_defines.h @$(PRINT) "$(GREEN)Preprocessing level make rules: $(BLUE)$@ $(NO_COL)\n" - @$(CPP) $(VERSION_CFLAGS) -I . $(EXTRA_INCLUDES) -o $@ $< + $(V)$(CPP) $(VERSION_CFLAGS) -I . $(EXTRA_INCLUDES) -o $@ $< include $(BUILD_DIR)/level_rules.mk endif endif +endif # -------------------------------------- # Extra Level Rules From ab2ead5cbe935f0ab0ec7b9e6ea32835d7e002bc Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 21 Mar 2022 17:02:24 -0700 Subject: [PATCH 4/5] More makefile fixes for coop-compiler --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6c9a06cc..48607d2a 100644 --- a/Makefile +++ b/Makefile @@ -594,7 +594,10 @@ ifeq ($(OSX_BUILD),1) AS := i686-w64-mingw32-as endif -ifeq ($(COMPILER),gcc) +ifeq ($(WINDOWS_AUTO_BUILDER),1) + CC := cc + CXX := g++ +else ifeq ($(COMPILER),gcc) CC := $(CROSS)gcc CXX := $(CROSS)g++ else ifeq ($(TARGET_WEB),1) # As in, web PC port From 1e43d206dd0ffc5162fe1f652746322677013650 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 21 Mar 2022 17:21:23 -0700 Subject: [PATCH 5/5] Even more makefile fixes for coop-compiler --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 48607d2a..55a25fd5 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ ifeq ($(WINDOWS_AUTO_BUILDER),1) EXTRA_INCLUDES := -I ../include/1 -I ../include/2 -I ../include/3 -I ../include/4 EXTRA_CFLAGS := -Wno-expansion-to-defined - EXTRA_CPP_INCLUDES := ../include/cpp + EXTRA_CPP_INCLUDES := -I ../include/cpp EXTRA_CPP_FLAGS := -Wno-class-conversion -Wno-packed-not-aligned else EXTRA_INCLUDES ?=