-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
46 lines (34 loc) · 1.43 KB
/
Makefile
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
TARGET = linuxloader
TARGET_OBJS = main.o resume.o
BOOTSTRAP_OBJS = linux_bootstrap.o
LIBS = -ltaihenForKernel_stub -lSceSysclibForDriver_stub -lSceSysmemForDriver_stub \
-lSceSysmemForKernel_stub -lSceThreadmgrForDriver_stub -lSceCpuForKernel_stub \
-lSceCpuForDriver_stub -lSceUartForKernel_stub -lScePervasiveForDriver_stub \
-lSceSysconForDriver_stub -lScePowerForDriver_stub -lSceIofilemgrForDriver_stub \
-lSceSblAIMgrForDriver_stub
PREFIX = arm-vita-eabi
CC = $(PREFIX)-gcc
AS = $(PREFIX)-as
OBJCOPY = $(PREFIX)-objcopy
CFLAGS = -Wl,-q -Wall -O0 -nostartfiles -mcpu=cortex-a9 -mthumb-interwork
ASFLAGS =
all: $(TARGET).skprx
%.skprx: %.velf
vita-make-fself -c $< $@
%.velf: %.elf
vita-elf-create -e $(TARGET).yml $< $@
linux_bootstrap.elf: $(BOOTSTRAP_OBJS)
$(CC) -T linux_bootstrap.ld -nostartfiles -nostdlib $^ -o $@ -lgcc
linux_bootstrap.bin: linux_bootstrap.elf
$(OBJCOPY) -S -O binary $^ $@
linux_bootstrap_bin.o: linux_bootstrap.bin
$(OBJCOPY) -I binary -O elf32-littlearm --binary-architecture arm $^ $@
$(TARGET).elf: $(TARGET_OBJS) linux_bootstrap_bin.o
$(CC) $(CFLAGS) $^ $(LIBS) -o $@
.PHONY: all clean send
clean:
@rm -rf $(TARGET).skprx $(TARGET).velf $(TARGET).elf $(TARGET_OBJS) $(BOOTSTRAP_OBJS) \
linux_bootstrap.elf linux_bootstrap.bin linux_bootstrap_bin.o
send: $(TARGET).skprx
curl --ftp-method nocwd -T $(TARGET).skprx ftp://$(PSVITAIP):1337/ux0:/data/tai/kplugin.skprx
@echo "Sent."