Skip to content

Commit

Permalink
Initial rewrite of elf-loader to use mostly code on EE
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Jan 29, 2025
1 parent 16cae0e commit 6aeb535
Show file tree
Hide file tree
Showing 15 changed files with 1,047 additions and 445 deletions.
2 changes: 1 addition & 1 deletion ee/elf-loader-nocolour/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
# Copyright ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
# Copyright ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

EE_SRC_DIR = $(PS2SDKSRC)/ee/elf-loader/src/loader/src/
EE_INC_DIR = $(PS2SDKSRC)/ee/elf-loader/src/loader/include/
EE_SRC_DIR = $(PS2SDKSRC)/ee/elf-loader/src/ldrsrc/src/
EE_INC_DIR = $(PS2SDKSRC)/ee/elf-loader/src/ldrsrc/include/

LOADER_ENABLE_DEBUG_COLORS ?= 0

EE_LINKFILE ?= $(PS2SDKSRC)/ee/elf-loader/src/loader/linkfile
EE_LINKFILE ?= $(PS2SDKSRC)/ee/elf-loader/src/ldrsrc/linkfile

EE_BIN ?= loader.elf

include $(PS2SDKSRC)/ee/elf-loader/src/loader/Makefile
include $(PS2SDKSRC)/ee/elf-loader/src/ldrsrc/Makefile
23 changes: 14 additions & 9 deletions ee/elf-loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# (c) 2020 Francisco Javier Trujillo Mata <[email protected]>
# Copyright ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

EE_OBJS = elf.o loader.o
EE_OBJS = \
elf.o \
elf_loader_compat.o \
elf_loader_reader.o \
elf_loader_stdio.o \
ldrsrc.o

include $(PS2SDKSRC)/Defs.make
include $(PS2SDKSRC)/ee/Rules.lib.make
Expand All @@ -16,19 +21,19 @@ include $(PS2SDKSRC)/ee/Rules.release
$(PS2SDKSRC)/tools/bin2c/bin/bin2c: $(PS2SDKSRC)/tools/bin2c
$(MAKEREC) $<

src/loader/bin/loader.elf:
$(MAKEREC) src/loader
src/ldrsrc/bin/ldrsrc.bin:
$(MAKEREC) src/ldrsrc

$(EE_OBJS_DIR)loader.c: src/loader/bin/loader.elf $(PS2SDKSRC)/tools/bin2c/bin/bin2c
$(PS2SDKSRC)/tools/bin2c/bin/bin2c $< $@ loader_elf
$(EE_OBJS_DIR)ldrsrc.c: src/ldrsrc/bin/ldrsrc.bin $(PS2SDKSRC)/tools/bin2c/bin/bin2c
$(PS2SDKSRC)/tools/bin2c/bin/bin2c $< $@ ldrsrc

$(EE_OBJS_DIR)loader.o: $(EE_OBJS_DIR)loader.c
$(EE_OBJS_DIR)ldrsrc.o: $(EE_OBJS_DIR)ldrsrc.c
$(DIR_GUARD)
$(EE_C_COMPILE) $< -c -o $@

clean::
$(MAKEREC) src/loader clean
$(MAKEREC) src/ldrsrc clean

.NOTPARALLEL:: \
$(PS2SDKSRC)/tools/bin2c/bin/bin2c \
src/loader/bin/loader.elf
src/ldrsrc/bin/ldrsrc.bin
Loading

0 comments on commit 6aeb535

Please sign in to comment.