Minimalist PSP SDK + Code::Blocks в Linux
2012/12/25Писать на C++ под PSP? С Жирафиком Рафиком Minimalist PSP SDK это так просто!
Необходимые пакеты
CodeBlocks и магия
$ sudo apt-get install autoconf automake bison flex gcc libmpfr-dev libncurses5-dev libreadline-dev libusb-dev make patch subversion texinfo wget zlib1g-dev ligmp3c2 libgmp3-dev codeblocks
Minimalist PSP SDK
Последнюю версию можно найти на странице проекта на Sourceforge: minpspw
Hастройка Code::Blocks
Setting → Compiler and debugger…<.p>2. В поле Selected complier выбрать GNU GCC Compiler, нажать Copy
Ввести имя компилятора (например, PSP-GCC)
Выбрать созданный компилятор, перейти на вкладку Toolchain executables
Compiler’s directory: /opt/pspsdk/
На вкладке Program Files:
C compiler: psp-gcc
C++ compiler: psp-g++
Linker for dynamic libs: psp-g++
Linker for static libs: psp-ar
Debugger:
Resource compiler:
Make program: make- Перейти на вкладку Search directories
На вкладке Complier добавить:
/opt/pspsdk/include /opt/pspsdk/psp/include /opt/pspsdk/psp/sdk/include
На вкладке Linker добавить:
/opt/pspsdk/lib /opt/pspsdk/psp/lib /opt/pspsdk/psp/sdk/lib
Makefile
Также понадобится этот makefile:
TARGET = main
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = HelloWorld
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Его нужно поместить в папку с проектом Code::Blocks.
Проект
File → New → Project → Console Application
Выбрать язык и размещение проекта
Compiler: тот, что был создан (PSP-GCC)
Project → Properties
В поле Makefile указать имя созданного ранее makefile и отметить “This is a custom makefile”
На вкладке Build targets:
Output filename: bin/Debug/psp.elf (для Debug)
Output filename: bin/Debug/psp.elf (для Release)Project → Properties → Project’s build options
На вкладке “Make” commands удалить переменную $target из Debug и Release
В результате билда в папке будет создан EBOOT.PBP, который можно будет запустить на PSP.
Для проверки можно воспользоваться этим исходником, который выводит классический “Hello World”: main.tar.gz