-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A dummy example to show how to make binary smaller
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
TARGET = light_size | ||
OBJS = main.o | ||
|
||
INCDIR = | ||
CFLAGS = -Os -Wall -fdata-sections -ffunction-sections | ||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti | ||
ASFLAGS = $(CFLAGS) | ||
|
||
LIBDIR = | ||
LDFLAGS = -s | ||
|
||
EXTRA_TARGETS = EBOOT.PBP | ||
PSP_EBOOT_TITLE = Light Hello World | ||
|
||
PSPSDK=$(shell psp-config --pspsdk-path) | ||
include $(PSPSDK)/lib/build.mak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* PSP Software Development Kit - https://github.com/pspdev | ||
* ----------------------------------------------------------------------- | ||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details. | ||
* | ||
* | ||
* Sample program to demonstrate a minimalistic Hello World program. | ||
* The main scope here is to show how we can disable newlib features if we don't need them. | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
// Specific psp headers | ||
#include <pspkernel.h> | ||
#include <pspdebug.h> | ||
#include <pspdisplay.h> | ||
#include <pspkernel.h> | ||
#include <pspmoduleinfo.h> | ||
#include <errno.h> | ||
|
||
// We won't fully disable newlib as we are using printf | ||
// However we can disable timezone, pthreads, pipe and socket support | ||
PSP_DISABLE_NEWLIB_PIPE_SUPPORT() | ||
PSP_DISABLE_NEWLIB_SOCKET_SUPPORT() | ||
PSP_DISABLE_NEWLIB_TIMEZONE_SUPPORT() | ||
PSP_DISABLE_NEWLIB_CWD_SUPPORT() | ||
PSP_DISABLE_AUTOSTART_PTHREAD() | ||
|
||
// configure PSP stuff | ||
#define VERS 1 | ||
#define REVS 0 | ||
|
||
PSP_MODULE_INFO("Light Hello World", PSP_MODULE_USER, VERS, REVS); | ||
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER); | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
while(1) { | ||
printf("Hello World!\n"); | ||
} | ||
|
||
return 0; | ||
} |