JsTypeHax_payload/Makefile

47 lines
1.3 KiB
Makefile
Raw Permalink Normal View History

2023-11-17 17:08:35 +01:00
include $(DEVKITPPC)/base_tools
2019-01-13 14:13:02 +01:00
PATH := $(DEVKITPPC)/bin:$(PATH)
PREFIX ?= powerpc-eabi-
CC = $(PREFIX)gcc
AS = $(PREFIX)gcc
CFLAGS = -std=gnu99 -Os -fno-builtin
ASFLAGS = -mregnames -x assembler-with-cpp
LD = $(PREFIX)ld
GCC_VER := $(shell $(DEVKITPPC)/bin/powerpc-eabi-gcc -dumpversion)
LDFLAGS=-Ttext 1800000 -L$(DEVKITPPC)/lib/gcc/powerpc-eabi/$(GCC_VER) -lgcc
OBJDUMP ?= $(PREFIX)objdump
project := .
root := $(CURDIR)
build := $(root)/bin
2023-11-17 17:08:35 +01:00
main_hook_elf := main_hook/main_hook.elf
2019-01-13 14:13:02 +01:00
all: clean setup main550
2023-11-17 17:08:35 +01:00
main_hook_elf.bin: $(main_hook_elf)
@$(bin2o)
$(main_hook_elf):
2019-01-13 14:13:02 +01:00
make -C main_hook
setup:
mkdir -p $(root)/bin/
main550:
make main FIRMWARE=550
2023-11-17 17:08:35 +01:00
main: main_hook_elf.bin
2019-01-13 14:13:02 +01:00
$(CC) $(CFLAGS) -DVER=$(FIRMWARE) -c $(project)/launcher.c
2019-01-24 17:00:21 +01:00
$(CC) $(CFLAGS) -DVER=$(FIRMWARE) -c $(project)/gx2sploit/kexploit.c
$(AS) $(ASFLAGS) -DVER=$(FIRMWARE) -c $(project)/gx2sploit/syscalls.S
2019-01-13 14:13:02 +01:00
$(AS) $(ASFLAGS) -DVER=$(FIRMWARE) -c $(project)/crt0.S
cp -r $(root)/*.o $(build)
rm $(root)/*.o
$(LD) -s -o code$(FIRMWARE).bin $(build)/crt0.o `find $(build) -name "*.o" ! -name "crt0.o"` --oformat binary $(LDFLAGS)
$(LD) -s -o code$(FIRMWARE).elf $(build)/crt0.o `find $(build) -name "*.o" ! -name "crt0.o"` $(LDFLAGS)
clean:
rm -rf $(build)
2023-11-17 17:08:35 +01:00
rm -rf code550.h
rm -rf main_hook_elf.h
2019-01-13 14:13:02 +01:00
make clean -C main_hook