-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile.vita
57 lines (43 loc) · 1.69 KB
/
Makefile.vita
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
ifeq ($(strip $(VITASDK)),)
$(error "Please define VITASDK to point to your SDK path!")
endif
NAME := noods
BUILD := build-vita
SRCS := src src/common src/console
DATA := src/console/images
ARGS := -Ofast -flto -std=c++11 -march=armv7-a -mtune=generic-armv7-a -D__VITA__ -DNO_FDOPEN #-DDEBUG
LIBS := -Wl,-q -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lvita2d -lSceAppMgr_stub -lSceAudio_stub \
-lSceCommonDialog_stub -lSceCtrl_stub -lSceDisplay_stub -lSceGxm_stub -lSceSysmodule_stub -lSceTouch_stub \
-lScePower_stub
APPNAME := NooDS
TITLEID := NOODSVITA
CPPFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.cpp))
BMPFILES := $(foreach dir,$(DATA),$(wildcard $(dir)/*.bmp))
HFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.h))
OFILES := $(patsubst %.cpp,$(BUILD)/%.o,$(CPPFILES)) $(patsubst %.bmp,$(BUILD)/%.o,$(BMPFILES))
CXX := $(VITASDK)/bin/arm-vita-eabi-g++
LD := $(VITASDK)/bin/arm-vita-eabi-ld
PACKVPK := $(VITASDK)/bin/vita-pack-vpk
MAKEFSELF := $(VITASDK)/bin/vita-make-fself
MKSFOEX := $(VITASDK)/bin/vita-mksfoex
ELFCREATE := $(VITASDK)/bin/vita-elf-create
all: $(NAME).vpk
$(NAME).vpk: eboot.bin param.sfo
$(PACKVPK) -b eboot.bin -s param.sfo --add icon/icon-vita.png=sce_sys/icon0.png $@
eboot.bin: $(NAME).velf
$(MAKEFSELF) -c $< $@
param.sfo:
$(MKSFOEX) -s TITLE_ID="$(TITLEID)" "$(APPNAME)" $@
$(NAME).velf: $(NAME).elf
$(ELFCREATE) -s $< $@
$(NAME).elf: $(OFILES)
$(CXX) $^ $(LIBS) -o $@
$(BUILD)/%.o: %.cpp $(HFILES) $(BUILD)
$(CXX) -c -o $@ $(ARGS) $<
$(BUILD)/%.o: %.bmp $(BUILD)
$(LD) -r -b binary -o $@ $<
$(BUILD):
for dir in $(SRCS) $(DATA); do mkdir -p $(BUILD)/$$dir; done
clean:
rm -f $(NAME).velf $(NAME).elf $(NAME).vpk param.sfo eboot.bin
rm -rf $(BUILD)