1st Part: Compiling on IDE.(Thanks to J.F.’s post on how to build using Code::Blocks from ps2dev.org forum)
1. Create a new empty project.
2. Enter a project title.
3. For the “Folder to create project in”, use the button to browse for desired folder location. To compile properly, the Makefile should be here.
4. Enter a “Project Filename”.
5. Edit the “Resulting filename” so that the *.cbp file is also located to where the Makefile is. Click “Next”, then “Finish”.
6. The project is done. On the Management panel, right click the project and select “Properties”.
7. In the “Project Settings” tab, edit the “Makefile” so that it is the name of your makefile, and check the “This is a custom Makefile”. click the “OK” button.
8. On the “Management” panel, right click the project and select “Build Options”. Select the project on the left panel.
9. Go to the “Make” command tab, there will be four fields. on these fields remove the “$target” from all the fields.
10. Paste the following before the “$make” on all fields:
Code: Select all
export PSPDEV=”/usr/local/pspdev” && export PSPSDK=”$PSPDEV/psp/sdk” && export PSPPATH=”$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin” && export PATH=”$PATH:$PSPPATH” && export PKG_CONFIG_PATH=”$PSPDEV/psp/lib/pkgconfig” &&
12. Add your files by “Add files..” or “Add files recursively”. You can now build your projects.
2nd Part. Debugging.
1. Wait a sec. Just before you build, edit your makefile first.
2. on the CFLAGS, append -g.
3. After the ASFLAGS, insert BUILD_PRX=1. Save it and build your eboot.
4. On the menu click “Settings”, then “Compiler and Debugger”.
5. On the “Global Compiler Settings”, On the “Toolchain Executables” tab, set the “Compiler’s installation directory” to “/usr/local/pspdev”.
6. On the 5 fields below, append “psp-” on all these fields.
7. On the “Debugger Settings” section, “Debugger Initialization commands”, enter “file XX.elf” where XX is the name of elf file on your current project. You need to change these every time you change projects/eboots depending on the elf file.
8. Click OK.
9. Open up again your project’s “Properties”.
10. Move to the Debugger’s tab, select target, which is “Release”.
11. Set “Connection Type” to TCP/IP.
12. Set IP address to 127.0.0.1 and port to 1001.
13. This assumes that you had psplink already setup. If not google it.
14. Run psplink on your psp, usbhostfs_pc and pspsh on your terminal.
15. On pspsh, enter debug ./XX.prx, where XX is your file.
16. Set your breakpoints and start debugging.
Happy Coding and debugging. =D
This can also be found here