Skip to content

Commit

Permalink
Improve Makefile to fix error when compiling with newest PS2 SDK rele…
Browse files Browse the repository at this point in the history
…ases
  • Loading branch information
jdev15 committed Mar 18, 2024
1 parent 1caa65c commit bd4f560
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 81 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/test.yml

This file was deleted.

65 changes: 32 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
.SILENT:

FRONTEND_OBJS = obj/main.o
FRONTEND_OBJS = $(EE_SRC_DIR)main.o

EECORE_OBJS = obj/ps2dev9.o obj/ps2atad.o obj/ps2fs.o obj/ps2hdd.o \
obj/iomanx.o obj/filexio.o
EECORE_OBJS = $(EE_C_DIR)ps2dev9.o $(EE_C_DIR)ps2atad.o $(EE_C_DIR)ps2fs.o $(EE_C_DIR)ps2hdd.o \
$(EE_C_DIR)iomanx.o $(EE_C_DIR)filexio.o

EE_BIN = OPL-Launcher.elf
EE_PACKED_BIN = OPL-Launcher-packed.elf

EE_SRC_DIR = src/
EE_OBJS_DIR = obj/
EE_ASM_DIR = asm/
EE_C_DIR = modules/
EE_OBJS = $(FRONTEND_OBJS) $(EECORE_OBJS)

EE_LIBS = -lfileXio -lpatches -lelf-loader-nocolour
EE_LIB_DIRS += -L$(PS2SDK)/ee/lib
EE_CFLAGS := -O2 -mgpopt -Wno-stringop-truncation
EE_LDFLAGS += -L$(PS2SDK)/ee/lib
EE_LIBS += -lfileXio -lpatches -lelf-loader-nocolour
EE_INCS += -I$(PS2SDK)/ports/include
EE_CFLAGS := -O2 -G8192 -mgpopt -Wno-stringop-truncation
EE_INCS += -I./include

BIN2C = $(PS2SDK)/bin/bin2c

all:
@mkdir -p $(EE_OBJS_DIR)
@mkdir -p $(EE_ASM_DIR)
all: create_dirs $(EE_BIN)
$(EE_STRIP) $(EE_BIN)
ps2-packer $(EE_BIN) $(EE_PACKED_BIN)

echo "Building OPL Launcher..."
$(MAKE) $(EE_BIN)
create_dirs:
mkdir -p $(EE_C_DIR)

clean:
rm -f -r $(EE_OBJS_DIR) $(EE_ASM_DIR) $(EE_BIN)
rm -f -r $(EE_C_DIR) $(EE_BIN) $(EE_PACKED_BIN)

rebuild: clean all

ps2dev9.s:
bin2s $(PS2SDK)/iop/irx/ps2dev9.irx asm/ps2dev9.s ps2dev9_irx

ps2atad.s:
bin2s $(PS2SDK)/iop/irx/ps2atad.irx asm/ps2atad.s ps2atad_irx
$(EE_C_DIR)ps2dev9.c: $(PS2SDK)/iop/irx/ps2dev9.irx
$(BIN2C) $< $@ ps2dev9_irx

ps2fs.s:
bin2s $(PS2SDK)/iop/irx/ps2fs.irx asm/ps2fs.s ps2fs_irx
$(EE_C_DIR)ps2atad.c: $(PS2SDK)/iop/irx/ps2atad.irx
$(BIN2C) $< $@ ps2atad_irx

ps2hdd.s:
bin2s $(PS2SDK)/iop/irx/ps2hdd-osd.irx asm/ps2hdd.s ps2hdd_irx
$(EE_C_DIR)ps2fs.c: $(PS2SDK)/iop/irx/ps2fs.irx
$(BIN2C) $< $@ ps2fs_irx

iomanx.s:
bin2s $(PS2SDK)/iop/irx/iomanX.irx asm/iomanx.s iomanx_irx
$(EE_C_DIR)ps2hdd.c: $(PS2SDK)/iop/irx/ps2hdd-osd.irx
$(BIN2C) $< $@ ps2hdd_irx

filexio.s:
bin2s $(PS2SDK)/iop/irx/fileXio.irx asm/filexio.s filexio_irx
$(EE_C_DIR)iomanx.c: $(PS2SDK)/iop/irx/iomanX.irx
$(BIN2C) $< $@ iomanx_irx

$(EE_OBJS_DIR)%.o : $(EE_SRC_DIR)%.c
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@

$(EE_OBJS_DIR)%.o : %.s
$(EE_AS) $(EE_ASFLAGS) $(EE_ASM_DIR)$< -o $@
$(EE_C_DIR)filexio.c: $(PS2SDK)/iop/irx/fileXio.irx
$(BIN2C) $< $@ filexio_irx

include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
include $(PS2SDK)/samples/Makefile.eeglobal_cpp

56 changes: 56 additions & 0 deletions Makefile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.SILENT:

FRONTEND_OBJS = obj/main.o

EECORE_OBJS = obj/ps2dev9.o obj/ps2atad.o obj/ps2fs.o obj/ps2hdd.o \
obj/iomanx.o obj/filexio.o

EE_BIN = OPL-Launcher.elf
EE_SRC_DIR = src/
EE_OBJS_DIR = obj/
EE_ASM_DIR = asm/
EE_OBJS = $(FRONTEND_OBJS) $(EECORE_OBJS)

EE_LIBS = -lfileXio -lpatches -lelf-loader-nocolour
EE_LIB_DIRS += -L$(PS2SDK)/ee/lib
EE_INCS += -I$(PS2SDK)/ports/include
EE_CFLAGS := -O2 -G8192 -mgpopt -Wno-stringop-truncation

all:
@mkdir -p $(EE_OBJS_DIR)
@mkdir -p $(EE_ASM_DIR)

echo "Building OPL Launcher..."
$(MAKE) $(EE_BIN)

clean:
rm -f -r $(EE_OBJS_DIR) $(EE_ASM_DIR) $(EE_BIN)

rebuild: clean all

ps2dev9.s:
bin2s $(PS2SDK)/iop/irx/ps2dev9.irx asm/ps2dev9.s ps2dev9_irx

ps2atad.s:
bin2s $(PS2SDK)/iop/irx/ps2atad.irx asm/ps2atad.s ps2atad_irx

ps2fs.s:
bin2s $(PS2SDK)/iop/irx/ps2fs.irx asm/ps2fs.s ps2fs_irx

ps2hdd.s:
bin2s $(PS2SDK)/iop/irx/ps2hdd-osd.irx asm/ps2hdd.s ps2hdd_irx

iomanx.s:
bin2s $(PS2SDK)/iop/irx/iomanX.irx asm/iomanx.s iomanx_irx

filexio.s:
bin2s $(PS2SDK)/iop/irx/fileXio.irx asm/filexio.s filexio_irx

$(EE_OBJS_DIR)%.o : $(EE_SRC_DIR)%.c
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@

$(EE_OBJS_DIR)%.o : %.s
$(EE_AS) $(EE_ASFLAGS) $(EE_ASM_DIR)$< -o $@

include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal

0 comments on commit bd4f560

Please sign in to comment.