Skip to content

Commit afa2135

Browse files
FORCED: Overwriting Tuna with local state
1 parent 0939066 commit afa2135

4 files changed

Lines changed: 209 additions & 1530 deletions

File tree

installer/Makefile

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,196 +1,138 @@
11
# Makefile for the FreeMcBoot Installer EE (Emotion Engine) application
22

3-
# Target ELF name parts
4-
# EE_BIN_DIR is the output directory for the ELFs.
5-
# It's defined as './' here for local builds.
6-
# The GitHub Actions workflow (compile-core.yml) overrides this to EE_BIN_DIR=../installer_res/
73
EE_BIN_DIR = ./
84
EE_BIN_BASE_NAME = UNC_FMCBInstaller
95
EE_BIN_PACKED_BASE_NAME = FMCBInstaller
106

11-
# exFAT support option (0 = no, 1 = yes) - Can be overridden from command line, e.g., make EXFAT=1
12-
EXFAT ?= 0 # Default to 0 (no exFAT support) if not set externally
13-
14-
# Determine suffix based on EXFAT option
7+
EXFAT ?= 0
158
HAS_EXFAT =
169
ifeq ($(EXFAT), 1)
1710
HAS_EXFAT = _EXFAT
1811
endif
1912

20-
# Final ELF names. These will be placed in EE_BIN_DIR.
2113
EE_BIN = $(EE_BIN_DIR)$(EE_BIN_BASE_NAME)$(HAS_EXFAT).elf
2214
EE_BIN_PACKED = $(EE_BIN_DIR)$(EE_BIN_PACKED_BASE_NAME)$(HAS_EXFAT).elf
2315

24-
# Directory for pre-compiled IOP modules (referenced by bin2c rules)
2516
IRX_DIR = irx/compiled
2617

27-
# IOP modules that are converted to C arrays and linked into the EE binary
2818
EE_IOP_OBJS = IOPRP_img.o IOMANX_irx.o FILEXIO_irx.o SIO2MAN_irx.o PADMAN_irx.o MCMAN_irx.o \
2919
MCSERV_irx.o SECRSIF_irx.o MCTOOLS_irx.o USBD_irx.o POWEROFF_irx.o DEV9_irx.o \
3020
ATAD_irx.o HDD_irx.o PFS_irx.o
3121

32-
# Resource files (images) converted to C arrays
3322
EE_RES_OBJS = background.o buttons.o
3423

35-
# EE Object files
36-
# Added menu_opentuna.o to this list
3724
EE_OBJS = main.o iop.o UI.o menu.o libsecr.o pad.o system.o graphics.o ReqSpaceCalc.o font.o \
3825
menu_opentuna.o \
3926
$(EE_RES_OBJS) $(EE_IOP_OBJS) mctools_rpc.o
4027

41-
# Include paths for EE compilation
4228
EE_INCS := -I. \
4329
-I$(PS2SDK)/ports/include \
4430
-I$(PS2SDK)/ee/include \
4531
-I$(PS2SDK)/common/include \
4632
-I./irx/source/secrsif/src \
4733
-I./irx/source/mctools/src/
4834

49-
# Linker flags for EE
5035
EE_LDFLAGS := -L$(PS2SDK)/ports/lib \
5136
-L$(PS2SDK)/ee/lib \
5237
-L$(PS2DEV)/ee/ee/lib \
5338
-Tlinkfile \
54-
-s # Strip symbols from final ELF
39+
-s
5540

56-
# Libraries to link against for EE
5741
EE_LIBS = -lgs -lpng -lz -lm -lfreetype -lpoweroff -lcdvd -lmc -lpadx -lhdd -lfileXio -lpatches -liopreboot -lc -lkernel
5842

59-
# GP value for MIPS architecture (optimizes access to global variables)
6043
EE_GPVAL = -G8192
6144

62-
# CFLAGS for EE compilation
63-
# -Os for size optimization, -mgpopt for GP optimization
64-
# Removed -Wno-string-plus-int as it's not recognized by the ps2dev ee-gcc
65-
EE_CFLAGS += -Os -mgpopt $(EE_GPVAL) -Wall
45+
EE_CFLAGS += -Os -mgpopt $(EE_GPVAL) -Wall -std=gnu99 # <<< ENSURE -std=gnu99 IS HERE
6646

67-
# Conditional compilation for exFAT support
6847
ifeq ($(EXFAT), 1)
6948
EE_CFLAGS += -DEXFAT
7049
EE_OBJS += usbmass_bd_irx.o bdm_irx.o bdmfs_fatfs_irx.o
7150
else
7251
EE_OBJS += USBHDFSD_irx.o
7352
endif
7453

75-
# Conditional compilation for Debug TTY feedback
7654
ifeq ($(DEBUG),1)
7755
EE_CFLAGS += -DDEBUG_TTY_FEEDBACK
7856
endif
7957

80-
# Conditional compilation for Installer Version
8158
ifdef FMCB_INSTALLER_VERSION
8259
EE_CFLAGS += -DFMCB_INSTALLER_VERSION=\"$(FMCB_INSTALLER_VERSION)\"
8360
endif
8461

85-
# Default rule to build all (now defaults to the packed version)
8662
all: $(EE_BIN_PACKED)
8763

88-
# Rule to compile .c files to .o
8964
%.o : %.c
9065
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
9166

92-
# Rule to compile .S (assembly with C preprocessor) files to .o
9367
%.o : %.S
9468
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
9569

96-
# Rule to compile .s (pure assembly) files to .o
9770
%.o : %.s
9871
$(EE_AS) $(EE_ASFLAGS) $< -o $@
9972

100-
# Rule to link EE objects into the final ELF
101-
# Standard order: crt0.o, then your objects, then libraries.
10273
$(EE_BIN) : $(PS2SDK)/ee/startup/crt0.o $(EE_OBJS)
10374
$(EE_CC) $(EE_CFLAGS) -nostartfiles $(EE_LDFLAGS) -o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(EE_OBJS) $(EE_LIBS)
10475

105-
# Rule to pack the ELF using ps2-packer
10676
$(EE_BIN_PACKED): $(EE_BIN)
10777
@echo " -- Compressing ELF $(EE_BIN) -> $(EE_BIN_PACKED) --"
10878
ps2-packer -v $< $@
10979

110-
# Rule to clean compiled files
11180
clean:
11281
@echo " -- Cleaning compiled files --"
11382
rm -f $(EE_BIN) $(EE_BIN_PACKED) $(EE_OBJS) \
11483
IOPRP_img.c IOMANX_irx.c FILEXIO_irx.c SIO2MAN_irx.c PADMAN_irx.c MCMAN_irx.c \
11584
MCSERV_irx.c SECRSIF_irx.c MCTOOLS_irx.c USBD_irx.c POWEROFF_irx.c DEV9_irx.c \
11685
ATAD_irx.c HDD_irx.c PFS_irx.c \
11786
background.c buttons.c \
118-
usbmass_bd_irx.c bdm_irx.c bdmfs_fatfs_irx.c USBHDFSD_irx.c # Clean all possible generated .c files
87+
usbmass_bd_irx.c bdm_irx.c bdmfs_fatfs_irx.c USBHDFSD_irx.c
11988

120-
# Rule to rebuild (clean then build all)
12189
rebuild: clean all
12290

123-
# Rules for converting binary resources/IRXs to C arrays using bin2c
124-
# These .c files will then be compiled into .o files and linked.
125-
91+
# bin2c rules... (rest of your Makefile)
12692
background.c: resources/background.png
12793
bin2c $< $@ background
128-
12994
buttons.c: resources/buttons.png
13095
bin2c $< $@ buttons
131-
132-
# Standard PS2SDK IRXs
13396
POWEROFF_irx.c: $(PS2SDK)/iop/irx/poweroff.irx
13497
bin2c $< $@ POWEROFF_irx
135-
13698
DEV9_irx.c: $(PS2SDK)/iop/irx/ps2dev9.irx
13799
bin2c $< $@ DEV9_irx
138-
139100
IOMANX_irx.c: $(PS2SDK)/iop/irx/iomanX.irx
140101
bin2c $< $@ IOMANX_irx
141-
142102
FILEXIO_irx.c: $(PS2SDK)/iop/irx/fileXio.irx
143103
bin2c $< $@ FILEXIO_irx
144-
145104
SIO2MAN_irx.c: $(PS2SDK)/iop/irx/freesio2.irx
146105
bin2c $< $@ SIO2MAN_irx
147-
148106
PADMAN_irx.c: $(PS2SDK)/iop/irx/freepad.irx
149107
bin2c $< $@ PADMAN_irx
150-
151108
MCMAN_irx.c: $(PS2SDK)/iop/irx/mcman.irx
152109
bin2c $< $@ MCMAN_irx
153-
154110
MCSERV_irx.c: $(PS2SDK)/iop/irx/mcserv.irx
155111
bin2c $< $@ MCSERV_irx
156-
157112
USBD_irx.c: $(PS2SDK)/iop/irx/usbd.irx
158113
bin2c $< $@ USBD_irx
159-
160114
ATAD_irx.c: $(PS2SDK)/iop/irx/ps2atad.irx
161115
bin2c $< $@ ATAD_irx
162-
163116
HDD_irx.c: $(PS2SDK)/iop/irx/ps2hdd-osd.irx
164117
bin2c $< $@ HDD_irx
165-
166118
PFS_irx.c: $(PS2SDK)/iop/irx/ps2fs.irx
167119
bin2c $< $@ PFS_irx
168-
169-
# Custom/Project-specific IRXs (from IRX_DIR)
170120
SECRSIF_irx.c: $(IRX_DIR)/secrsif.irx
171121
bin2c $< $@ SECRSIF_irx
172-
173122
MCTOOLS_irx.c: $(IRX_DIR)/mctools.irx
174123
bin2c $< $@ MCTOOLS_irx
175-
176124
IOPRP_img.c: $(IRX_DIR)/IOPRP.img
177125
bin2c $< $@ IOPRP_img
178-
179-
# Conditional IRX to C conversion based on EXFAT support
180126
ifeq ($(EXFAT), 1)
181127
usbmass_bd_irx.c: $(IRX_DIR)/usbmass_bd.irx
182128
bin2c $< $@ usbmass_bd_irx
183-
184129
bdm_irx.c: $(IRX_DIR)/bdm.irx
185130
bin2c $< $@ bdm_irx
186-
187131
bdmfs_fatfs_irx.c: $(IRX_DIR)/bdmfs_fatfs.irx
188132
bin2c $< $@ bdmfs_fatfs_irx
189133
else
190-
# Standard USBHDFSD if not using exFAT
191134
USBHDFSD_irx.c: $(PS2SDK)/iop/irx/usbhdfsd.irx
192135
bin2c $< $@ USBHDFSD_irx
193136
endif
194137

195-
# Include common PS2SDK makefile definitions
196138
include $(PS2SDK)/Defs.make

0 commit comments

Comments
 (0)