-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (45 loc) · 1.92 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
62
63
# You should only use Makefile-based build if you know what you're doing.
# For most vitasdk projects, CMake is a better choice. See CMakeLists.txt for an example.
PHONY := all package clean
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
CC := arm-vita-eabi-gcc
CXX := arm-vita-eabi-g++
STRIP := arm-vita-eabi-strip
PROJECT_TITLE := VitaForge
PROJECT_TITLEID := VSDK00007
PROJECT := VitaForge
CFLAGS += -Wl,-q -I../common
CXXFLAGS += -Wl,-q -std=c++11 -I../common
SRC_C :=$(call rwildcard, src/, *.c)
SRC_CPP :=$(call rwildcard, src/, *.cpp)
OBJ_DIRS := $(addprefix out/, $(dir $(SRC_C:src/%.c=%.o))) $(addprefix out/, $(dir $(SRC_CPP:src/%.cpp=%.o)))
OBJS := $(addprefix out/, $(SRC_C:src/%.c=%.o)) $(addprefix out/, $(SRC_CPP:src/%.cpp=%.o))
# Needed by psvDebugScreenPrintf
LIBS += -lSceDisplay_stub -lSceRegistryMgr_stub -lSceCtrl_stub -lSceVshBridge_stub # Added SceRegMgr_stub here
all: package
package: $(PROJECT).vpk
$(PROJECT).vpk: eboot.bin param.sfo
vita-pack-vpk -s param.sfo -b eboot.bin \
--add sce_sys/icon0.png=sce_sys/icon0.png \
--add sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png \
--add sce_sys/livearea/contents/startup.png=sce_sys/livearea/contents/startup.png \
--add sce_sys/livearea/contents/template.xml=sce_sys/livearea/contents/template.xml \
$(PROJECT).vpk
eboot.bin: $(PROJECT).velf
vita-make-fself $(PROJECT).velf eboot.bin
param.sfo:
vita-mksfoex -s TITLE_ID="$(PROJECT_TITLEID)" "$(PROJECT_TITLE)" param.sfo
$(PROJECT).velf: $(PROJECT).elf
$(STRIP) -g $<
vita-elf-create $< $@
$(PROJECT).elf: $(OBJS)
$(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@
$(OBJ_DIRS):
mkdir -p $@
out/%.o : src/%.cpp | $(OBJ_DIRS)
arm-vita-eabi-g++ -c $(CXXFLAGS) -o $@ $<
out/%.o : src/%.c | $(OBJ_DIRS)
arm-vita-eabi-gcc -c $(CFLAGS) -o $@ $<
clean:
rm -f $(PROJECT).velf $(PROJECT).elf $(PROJECT).vpk param.sfo eboot.bin $(OBJS)
rm -r $(abspath $(OBJ_DIRS))