Debian Codegraph @

Makefile.vita

raw
1 ###########################################################################
2 # fheroes2: https://github.com/ihhub/fheroes2 #
3 # Copyright (C) 2021 - 2026 #
4 # #
5 # This program is free software; you can redistribute it and/or modify #
6 # it under the terms of the GNU General Public License as published by #
7 # the Free Software Foundation; either version 2 of the License, or #
8 # (at your option) any later version. #
9 # #
10 # This program is distributed in the hope that it will be useful, #
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
13 # GNU General Public License for more details. #
14 # #
15 # You should have received a copy of the GNU General Public License #
16 # along with this program; if not, write to the #
17 # Free Software Foundation, Inc., #
18 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
19 ###########################################################################
20
21 # Options:
22 #
23 # FHEROES2_STRICT_COMPILATION: build in strict compilation mode (turns warnings into errors)
24 # FHEROES2_WITH_DEBUG: build in debug mode
25 # FHEROES2_DATA: set the built-in path to the fheroes2 data directory (e.g. /usr/share/fheroes2)
26
27 PROJECT_TITLE := fheroes2
28 PROJECT_TITLEID := FHOMM0002
29 # Version should be in XX.YY format
30 PROJECT_VERSION := $(strip $(shell printf %02d.%02d "$$(cat version.txt | cut -s -f1 -d.)" "$$(cat version.txt | cut -s -f2 -d.)") \
31 $(and $(filter-out 0,$(.SHELLSTATUS)),$(error Invalid version syntax)))
32
33 .PHONY: all clean fheroes2.vpk param.sfo fheroes2.elf translations
34
35 all: fheroes2.vpk
36
37 fheroes2.vpk: eboot.bin param.sfo translations
38 vita-pack-vpk -s param.sfo -b eboot.bin \
39 --add files/images/platform/psv/sce_sys=sce_sys \
40 $(shell find files/data -name "*.h2d" -exec printf "--add %q=%q\n" {} {} \;) \
41 $(shell find files/lang -name "*.mo" -exec printf "--add %q=%q\n" {} {} \;) \
42 $(shell find files/timidity -name "timidity.cfg" -exec printf "--add %q=%q\n" {} {} \;) \
43 $(shell find files/timidity/instruments -name "*.*" -exec printf "--add %q=%q\n" {} {} \;) \
44 $(shell find maps -name "*.fh2m" -exec printf "--add %q=%q\n" {} {} \;) \
45 fheroes2.vpk
46
47 translations: fheroes2.elf
48 $(MAKE) -C files/lang
49
50 eboot.bin: fheroes2.velf
51 vita-make-fself fheroes2.velf eboot.bin
52
53 param.sfo:
54 vita-mksfoex -s TITLE_ID="$(PROJECT_TITLEID)" -s APP_VER="$(PROJECT_VERSION)" "$(PROJECT_TITLE)" param.sfo
55
56 fheroes2.velf: fheroes2.elf
57 arm-vita-eabi-strip -g $<
58 vita-elf-create $< $@
59
60 fheroes2.elf:
61 $(MAKE) -C src/dist PLATFORM=vita
62 cp src/dist/fheroes2/fheroes2 fheroes2.elf
63
64 clean:
65 $(MAKE) -C src/dist clean
66 $(MAKE) -C files/lang clean
67 -rm -f fheroes2.velf fheroes2.elf fheroes2.vpk eboot.bin param.sfo