This repository has been archived by the owner on Dec 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
61 lines (43 loc) · 1.45 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
TITLE_ID = ACTI00000
TARGET = vita-activator
NAME = Vita Activator
SRC_C :=$(call rwildcard, src/, *.c)
OBJ_DIRS := $(addprefix out/, $(dir $(SRC_C:src/%.c=%.o)))
OBJS := $(addprefix out/, $(SRC_C:src/%.c=%.o))
LIBS := -lSceKernel_stub -lSceAppUtil_stub -lSceCommonDialog_stub -lSceIme_stub -lSceCtrl_stub \
-lSceVshBridge_stub -lSceSysmodule_stub -lSceNet_stub -lSceNetCtl_stub -lSceHttp_stub \
-lSceSsl_stub -lSceDisplay_stub -lSceGxm_stub -lScePgf_stub -lvita2d -lSceReg_stub
CC := arm-vita-eabi-gcc
STRIP := arm-vita-eabi-strip
CONF ?= RELEASE
CFLAGS += -Wl,-q -Wall -O3 -D $(CONF)
ASFLAGS += $(CFLAGS)
.PHONY: all vpk eboot elf clean
all: vpk eboot elf
vpk: build/$(TARGET).vpk
eboot: build/eboot.bin
elf: build/$(TARGET).elf
build/%.vpk: vpk/eboot.bin vpk/sce_sys/param.sfo
mkdir -p build
cd vpk; zip -r -q ../$@ ./*; cd ..
build/eboot.bin: vpk/eboot.bin
mkdir -p build
cp vpk/eboot.bin build
build/%.velf: out/%.velf
mkdir -p build
cp out/$(@:build/%=%) build
vpk/sce_sys/param.sfo:
vita-mksfoex -s TITLE_ID=$(TITLE_ID) "$(NAME)" $@
vpk/eboot.bin: out/$(TARGET).velf
vita-make-fself $< $@
%.velf: %.elf
vita-elf-create $< $@
%.elf: $(OBJS)
$(CC) $(CFLAGS) $^ $(LIBS) -o $@
$(OBJ_DIRS):
mkdir -p $@
out/%.o : src/%.c | $(OBJ_DIRS)
$(CC) -c -o $@ $(CFLAGS) $<
clean:
@rm -rf out/*.velf out/*.elf $(OBJS) release/* vpk/eboot.bin vpk/sce_sys/param.sfo