-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile_loader
51 lines (38 loc) · 1.35 KB
/
Makefile_loader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# make to compile without debug info
# make DEBUG=1 to compile with debug info
ifeq ($(EXPLOIT),launcher)
all: $(O)/EBOOT.PBP
else
all: $(O)/H.BIN
endif
O_PRIV := $(O)/loader
include common.mk
ifneq ($(EXPLOIT),launcher)
CFLAGS += -fomit-frame-pointer -fno-zero-initialized-in-bss
endif
OBJ_START := loader/start.o
OBJS_LOADER := loader/loader.o loader/bruteforce.o loader/freemem.o loader/runtime.o
ifneq ($(EXPLOIT),launcher)
OBJS_LOADER += $(OBJ_START)
endif
ifeq ($(EXPLOIT),launcher)
LOADER_LDSCRIPT := -Wl,-Tlauncher.ld $(PRX_LDSCRIPT)
else
LOADER_LDSCRIPT := -Wl,-Tloader.ld
endif
OBJS := $(addprefix $(O_PRIV)/,$(OBJS_COMMON) $(OBJS_LOADER))
DEPS := $(addprefix $(O_PRIV)/.deps/,$(patsubst %.o,%.d,$(OBJS_COMMON) $(OBJS_LOADER)))
$(call DEPDIR,$(OBJS) $(DEPS) $(addprefix $(O)/,H.elf PARAM.SFO) $(addpefix $(O_PRIV)/,H.BIN, H.PRX, EBOOT.PBP))
$(O)/EBOOT.PBP: $(O_PRIV)/PARAM.SFO assets/ICON0.PNG assets/PIC1.PNG $(O)/H.PRX
pack-pbp $@ $(O_PRIV)/PARAM.SFO assets/ICON0.PNG NULL \
NULL assets/PIC1.PNG NULL $(O)/H.PRX NULL
$(O_PRIV)/PARAM.SFO:
mksfo 'Half Byte Loader' $@
$(O)/H.BIN: $(O_PRIV)/H.elf
psp-objcopy -S -O binary $< $@
$(O_PRIV)/H.elf: $(PRXEXPORTS) $(OBJS) $(IMPORTS)
$(LINK.o) $(LOADER_LDSCRIPT) $(LIBDIR) $^ $(LIBS) -o $@
$(FIXUP) $@
clean: clean-imports
rm -rf $(O_PRIV) $(O)/config.h $(O)/H.BIN $(O)/H.PRX $(O)/EBOOT.PBP
-include $(DEPS)