forked from ps3dev/PSL1GHT
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ppu_rules
94 lines (75 loc) · 3.12 KB
/
ppu_rules
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ifeq ($(strip $(PS3DEV)),)
ifeq ($(strip $(DEVKITPS3)),)
export PS3DEV := /usr/local/ps3dev
else
export PS3DEV := $(DEVKITPS3)
endif
endif
export PATH := $(PS3DEV)/bin:$(PS3DEV)/ppu/bin:$(PATH)
export PORTLIBS := $(PS3DEV)/portlibs/ppu
export LIBPSL1GHT_INC := -I$(PSL1GHT)/ppu/include -I$(PSL1GHT)/ppu/include/simdmath
export LIBPSL1GHT_LIB := -L$(PSL1GHT)/ppu/lib
export CFLAGS_INIT :=
export CXXFLAGS_INIT := -D_GLIBCXX11_USE_C99_STDIO
PREFIX := ppu-
MACHDEP = -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
include $(PSL1GHT)/base_rules
include $(PSL1GHT)/data_rules
PKG := pkg.py
SFO := sfo.py
SPRX := sprxlinker$(POSTFIX)
CGCOMP := cgcomp$(POSTFIX)
PS3LOADAPP := ps3load$(POSTFIX)
RAW2H := raw2h$(POSTFIX)
# fake SELF type4 / type8 tools
FSELF := fself
FSELF_NPDRM := $(FSELF) -n
# signed SELF type4 / type8 tools
SELF := make_self
SELF_NPDRM := make_self_npdrm
# NPDRM pkg tool
PACKAGE_FINALIZE := package_finalize
# Package settings - allow for user override
TITLE ?= Untitled PSL1GHT homebrew
APPID ?= UNTITLED1
SFOXML ?= $(PS3DEV)/bin/sfo.xml
ICON0 ?= $(PS3DEV)/bin/ICON0.PNG
CONTENTID ?= UP0001-$(APPID)_00-0000000000000000
TARGET ?= $(notdir $(CURDIR))
BUILDDIR ?= $(CURDIR)/build
#---------------------------------------------------------------------------------
%.self: %.elf
$(VERB) echo CEX self ... $(notdir $@)
$(VERB) mkdir -p $(BUILDDIR)
$(VERB) $(STRIP) $< -o $(BUILDDIR)/$(notdir $<)
$(VERB) $(SPRX) $(BUILDDIR)/$(notdir $<)
$(VERB) $(SELF) $(BUILDDIR)/$(notdir $<) $@
$(VERB) $(FSELF) $(BUILDDIR)/$(notdir $<) $(basename $@).fake.self
%.pkg: %.self
$(VERB) echo building pkg ... $(notdir $@)
$(VERB) mkdir -p $(BUILDDIR)/pkg/USRDIR
$(VERB) cp $(ICON0) $(BUILDDIR)/pkg/ICON0.PNG
$(VERB) $(SELF_NPDRM) $(BUILDDIR)/$(basename $(notdir $<)).elf $(BUILDDIR)/pkg/USRDIR/EBOOT.BIN $(CONTENTID) >> /dev/null
$(VERB) $(SFO) --title "$(TITLE)" --appid "$(APPID)" -f $(SFOXML) $(BUILDDIR)/pkg/PARAM.SFO
$(VERB) if [ -n "$(PKGFILES)" -a -d "$(PKGFILES)" ]; then cp -rf $(PKGFILES)/* $(BUILDDIR)/pkg/; fi
$(VERB) $(PKG) --contentid $(CONTENTID) $(BUILDDIR)/pkg/ $@ >> /dev/null
$(VERB) cp $@ $(basename $@).gnpdrm.pkg
$(VERB) $(PACKAGE_FINALIZE) $(basename $@).gnpdrm.pkg
%.info: Makefile
$(VERB) echo "Generating $(basename $@).h"
$(VERB) mkdir -p $(BUILDDIR)
$(VERB) echo "#ifndef __BUILD_INFO_H__" > $(BUILDDIR)/$(basename $@).h
$(VERB) echo "#define __BUILD_INFO_H__" >> $(BUILDDIR)/$(basename $@).h
$(VERB) echo "" >> $(BUILDDIR)/$(basename $@).h
$(VERB) echo "#define SYS_APP_TITLE\t\t\"$(TITLE)\"" >> $(BUILDDIR)/$(basename $@).h
$(VERB) echo "#define SYS_APP_ID\t\t\t\"$(APPID)\"" >> $(BUILDDIR)/$(basename $@).h
$(VERB) echo "#define SYS_CONTENT_ID\t\t\"$(CONTENTID)\"" >> $(BUILDDIR)/$(basename $@).h
$(VERB) echo "" >> $(BUILDDIR)/$(basename $@).h
$(VERB) echo "#endif // __BUILD_INFO_H__" >> $(BUILDDIR)/$(basename $@).h
#---------------------------------------------------------------------------------
%.vpo: %.vcg
$(VERB) echo $(notdir $<)
$(VERB) $(CGCOMP) -v $(CGCFLAGS) $^ $@
%.fpo: %.fcg
$(VERB) echo $(notdir $<)
$(VERB) $(CGCOMP) -f $(CGCFLAGS) $^ $@