Compatibility fixes for macOS 12.x

This commit is contained in:
PikalaxALT 2021-12-17 12:33:51 -05:00
parent c8164510b3
commit ec3b2ac581
8 changed files with 43 additions and 43 deletions

View File

@ -103,9 +103,9 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te
CFLAGS = -O4,p -gccext,on -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
LDFLAGS = -map -nodead -w off -proc v5te -interworking -map -symtab -m _start
MWASFLAGS = -proc arm5te
MWCFLAGS = -O4,p -gccext,on -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
MWLDFLAGS = -map -nodead -w off -proc v5te -interworking -map -symtab -m _start
####################### Other Tools #########################
@ -205,10 +205,10 @@ $(BUILD_DIR)/%.o: dep :=
endif
$(BUILD_DIR)/%.o: %.c $$(dep)
$(CC) -c $(CFLAGS) -o $@ $<
$(CC) -c $(MWCFLAGS) -o $@ $<
$(BUILD_DIR)/%.o: %.s $$(dep)
$(AS) $(ASFLAGS) $< -o $@
$(AS) $(MWASFLAGS) $< -o $@
arm9: filesystem
$(MAKE) -C arm9 $(MAKE_VARS)

View File

@ -96,9 +96,9 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm7_thumb.s -o arm7.o
ASFLAGS = -proc arm4t -i ..
CFLAGS = -O4,s -proc arm7tdmi -fp soft -lang c99 -Cpp_exceptions off -i ../include -ir ../include-mw -ir lib/include -interworking -DFS_IMPLEMENT -enum int -W all
LDFLAGS = -map -nodead -w off -proc v4t -interworking -map -symtab -m _start
MWASFLAGS = -proc arm4t -i ..
MWCFLAGS = -O4,s -proc arm7tdmi -fp soft -lang c99 -Cpp_exceptions off -i ../include -ir ../include-mw -ir lib/include -interworking -DFS_IMPLEMENT -enum int -W all
MWLDFLAGS = -map -nodead -w off -proc v4t -interworking -map -symtab -m _start
####################### Other Tools #########################
@ -183,17 +183,17 @@ $(BUILD_DIR)/%.o: dep :=
endif
$(C_OBJS): $(BUILD_DIR)/%.o: %.c $$(dep)
$(CC) -c $(CFLAGS) -o $@ $<
$(CC) -c $(MWCFLAGS) -o $@ $<
$(S_OBJS): $(BUILD_DIR)/%.o: %.s $$(dep)
$(AS) $(ASFLAGS) -o $@ $<
$(AS) $(MWASFLAGS) -o $@ $<
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SPEC) $(LD_TEMPLATE)
$(MAKELSF) $< $(LD_TEMPLATE) $@
$(ROM): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BIN_FILES)
echo "$(O_FILES) $(BIN_FILES)" > $(ELF).objlist
$(LD) $(LDFLAGS) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) @$(ELF).objlist
$(LD) $(MWLDFLAGS) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) @$(ELF).objlist
$(OBJCOPY) --update-section arm7=$@ -j arm7 $(foreach ov,$(OVERLAYS),--update-section $(ov)=$(BUILD_DIR)/$(ov).sbin -j $(ov)) $(ELF) 2>/dev/null
# Make sure build directory exists before compiling anything

View File

@ -116,10 +116,10 @@ ASM_PROCESSOR_DIR := ../tools/asm_processor
ASM_PROCESSOR := $(ASM_PROCESSOR_DIR)/compile.sh
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te -i ../include -i .. -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
CFLAGS = -O4,p -gccext,on -proc arm946e -ipa file -fp soft -lang c99 -Cpp_exceptions off $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
CXXFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
LDFLAGS = -w off -proc v5te -interworking -map closure,unused -symtab sort -m _start
MWASFLAGS = -proc arm5te -i ../include -i .. -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
MWCFLAGS = -O4,p -gccext,on -proc arm946e -ipa file -fp soft -lang c99 -Cpp_exceptions off $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
MWCXXFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
MWLDFLAGS = -w off -proc v5te -interworking -map closure,unused -symtab sort -m _start
LIBS := -Llib -lsyscall
ARFLAGS = rcS
STATIC_LIBS := $(addprefix $(BUILD_DIR)/lib/,libsyscall.a)
@ -204,7 +204,7 @@ ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(LIB
# TODO: Move out to lib/Makefile
$(BUILD_DIR)/lib/%.o: MWCCVERSION = 1.2/sp2p3
$(BUILD_DIR)/lib/%.o: CFLAGS = -O4,p -gccext,on -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -interworking -DFS_IMPLEMENT -enum int -W all -i ../include -ir ../include-mw -ir lib/libc/include -ir lib/libnns/include -ir lib/NitroSDK/include
$(BUILD_DIR)/lib/%.o: MWCFLAGS = -O4,p -gccext,on -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -interworking -DFS_IMPLEMENT -enum int -W all -i ../include -ir ../include-mw -ir lib/libc/include -ir lib/libnns/include -ir lib/NitroSDK/include
$(BUILD_DIR)/lib/libnns/%.o: MWCCVERSION = 1.2/sp3
@ -217,17 +217,17 @@ $(BUILD_DIR)/%.o: dep :=
endif
# Cpp asm processor is not supported at this time.
$(GLOBAL_ASM_O_FILES): BUILD_C := $(ASM_PROCESSOR) "$(CC) $(CFLAGS)" "$(AS) $(ASFLAGS)"
BUILD_C ?= $(CC) -c $(CFLAGS) -o
$(GLOBAL_ASM_O_FILES): BUILD_C := $(ASM_PROCESSOR) "$(CC) $(MWCFLAGS)" "$(AS) $(MWASFLAGS)"
BUILD_C ?= $(CC) -c $(MWCFLAGS) -o
$(C_OBJS): $(BUILD_DIR)/%.o: %.c $$(dep)
$(BUILD_C) $@ $<
$(CXX_OBJS): $(BUILD_DIR)/%.o: %.cpp $$(dep)
$(CXX) -c $(CXXFLAGS) -o $@ $<
$(CXX) -c $(MWCXXFLAGS) -o $@ $<
$(S_OBJS) $(LIBS_OBJS): $(BUILD_DIR)/%.o: %.s $$(dep)
$(AS) $(ASFLAGS) -o $@ $<
$(AS) $(MWASFLAGS) -o $@ $<
$(BUILD_DIR)/$(LD_TEMPLATE): $(BUILD_DIR)/%: %
(echo "KEEP_SECTION\n{\n\t.exceptix\n}\n"; cat $<) > $@
@ -237,7 +237,7 @@ $(BUILD_DIR)/$(LD_SCRIPT): $(LD_SPEC) $(BUILD_DIR)/$(LD_TEMPLATE)
$(ROM): $(BUILD_DIR)/$(LD_SCRIPT) $(O_FILES) $(STATIC_LIBS)
echo "$(O_FILES:$(BUILD_DIR)/%=%)" > $(ELF).objlist
cd $(BUILD_DIR) && LM_LICENSE_FILE=../../$(LM_LICENSE_FILE) $(WINE) ../../$(MWLDARM) $(LDFLAGS) $(LIBS) -o ../../$(ELF) $(LD_SCRIPT) @../../$(ELF).objlist
cd $(BUILD_DIR) && LM_LICENSE_FILE=../../$(LM_LICENSE_FILE) $(WINE) ../../$(MWLDARM) $(MWLDFLAGS) $(LIBS) -o ../../$(ELF) $(LD_SCRIPT) @../../$(ELF).objlist
$(OBJCOPY) $(foreach ov,arm9 $(OVERLAYS),--update-section $(ov)=$(BUILD_DIR)/$(ov).sbin -j $(ov)) $(ELF) 2>/dev/null
ifeq ($(SHIFTED),0)

View File

@ -53,9 +53,9 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te -ir ../..
CFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
LDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
MWASFLAGS = -proc arm5te -ir ../..
MWCFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
MWLDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
ARFLAGS = rcS
export MWCIncludes := libc/include libnns/include NitroSDK/include
@ -85,7 +85,7 @@ libsyscall.a: syscall/_svc_mw.o
$(AR) $(ARFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -o $@ $<
$(CC) $(MWCFLAGS) -o $@ $<
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(AS) $(MWASFLAGS) -o $@ $<

View File

@ -53,9 +53,9 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te -ir ../../..
CFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
LDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
MWASFLAGS = -proc arm5te -ir ../../..
MWCFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
MWLDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
ARFLAGS = rcS
export MWCIncludes := include
@ -74,7 +74,7 @@ clean:
$(AR) $(ARFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -o $@ $<
$(CC) $(MWCFLAGS) -o $@ $<
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(AS) $(MWASFLAGS) -o $@ $<

View File

@ -53,9 +53,9 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te -ir ../../..
CFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
LDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
MWASFLAGS = -proc arm5te -ir ../../..
MWCFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
MWLDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
ARFLAGS = rcS
export MWCIncludes := include
@ -74,7 +74,7 @@ clean:
$(AR) $(ARFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -o $@ $<
$(CC) $(MWCFLAGS) -o $@ $<
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(AS) $(MWASFLAGS) -o $@ $<

View File

@ -54,9 +54,9 @@ OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te -ir ../../..
CFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
LDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
MWASFLAGS = -proc arm5te -ir ../../..
MWCFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -W all
MWLDFLAGS = -library -nodead -w off -proc v5te -interworking -pic
ARFLAGS = rcS
export MWCIncludes := include
@ -75,7 +75,7 @@ clean:
$(AR) $(ARFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -o $@ $<
$(CC) $(MWCFLAGS) -o $@ $<
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(AS) $(MWASFLAGS) -o $@ $<

View File

@ -311,13 +311,13 @@ endif
## This specific target shares its source JSON with trdata.narc
files/poketool/trainer/trpoke.narc: %/trpoke.narc: %/trdata.json %/trpoke.json.txt $$(dep)
$(JSONPROC) $< $(word 2,$^) $*/trpoke.c
$(CC) $(CFLAGS) -c -o $*/trpoke.o $*/trpoke.c
$(CC) $(MWCFLAGS) -c -o $*/trpoke.o $*/trpoke.c
$(O2NARC) $(O2NARCFLAGS) $*/trpoke.o $@
@$(RM) $*/trpoke.o $*/trpoke.c
$(O2NARC_TARGETS): %.narc: %.json %.json.txt $$(dep)
$(JSONPROC) $*.json $*.json.txt $*.c
$(CC) $(CFLAGS) -c -o $*.o $*.c
$(CC) $(MWCFLAGS) -c -o $*.o $*.c
$(O2NARC) $(O2NARCFLAGS) $*.o $@
@$(RM) $*.o $*.c