From 0d1a24023802fbdb19a60bf478b952a81bf1a51d Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 3 Dec 2021 10:32:31 -0500 Subject: [PATCH] changes based on Tharo's suggestion --- Makefile | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 5787d404ba..e138cdb6b0 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,6 @@ NON_MATCHING ?= 0 ORIG_COMPILER ?= 0 # If COMPILER is GCC, compile with GCC instead of IDO. COMPILER ?= ido -# Convert text in source files (.c) to EUC-JP before compilation, but only on GCC. -# This is required in order to preserve debug print functionality on GCC since it -# doesn't seem to recognize EUC-JP marked files without doing this beforehand. -CONV_SOURCE_TEXT ?= 1 # If gcc is used, define the NON_MATCHING flag respectively so the files that # are safe to be used can avoid using GLOBAL_ASM which doesn't work with gcc. @@ -57,11 +53,7 @@ endif # Detect compiler and set variables appropriately. ifeq ($(COMPILER),gcc) - ifeq ($(CONV_SOURCE_TEXT),1) - CC = iconv -f UTF-8 -t EUC-JP $< | mips-linux-gnu-gcc -x c - - else - CC = mips-linux-gnu-gcc $< - endif + CC := $(MIPS_BINUTILS_PREFIX)gcc CC_OLD := $(CC) else ifeq ($(COMPILER),ido) @@ -107,14 +99,12 @@ OPTFLAGS := -O2 ASFLAGS := -march=vr4300 -32 -Iinclude ifeq ($(COMPILER),gcc) - CFLAGS += -c -G 0 -nostdinc $(INC) -DNON_MATCHING=1 -DAVOID_UB=1 -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -mno-abicalls -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv $(CHECK_WARNINGS) -g -mno-explicit-relocs -mno-split-addresses -funsigned-char + CFLAGS += -G 0 -nostdinc $(INC) -DNON_MATCHING=1 -DAVOID_UB=1 -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -mno-abicalls -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv $(CHECK_WARNINGS) -g -mno-explicit-relocs -mno-split-addresses -funsigned-char MIPS_VERSION := -mips3 - PIPEIN = else # we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff. CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm $(INC) -Wab,-r4300_mul -woff 649,838,712 MIPS_VERSION := -mips2 - PIPEIN = $< endif ifeq ($(shell getconf LONG_BIT), 32) @@ -198,6 +188,8 @@ build/src/code/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $( build/src/overlays/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- build/assets/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- +else +build/src/%.o: CC := $(CC) -fexec-charset=euc-jp endif #### Main Targets ### @@ -268,7 +260,7 @@ build/assets/text/nes_message_data_static.o: build/assets/text/message_data.enc. build/assets/text/staff_message_data_static.o: build/assets/text/message_data_staff.enc.h build/assets/%.o: assets/%.c - $(CC) -c $(CFLAGS) -I $( $(@:.o=.s) build/src/%.o: src/%.c - $(CC) -c $(CFLAGS) -I $( $(@:.o=.s) build/src/libultra/libc/ll.o: src/libultra/libc/ll.c - $(CC) -c $(CFLAGS) -I $( $(@:.o=.s) build/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c - $(CC) -c $(CFLAGS) -I $( $(@:.o=.s)