From 3449e0062fcba0e455075d990244cecfc91e1182 Mon Sep 17 00:00:00 2001 From: Damian Parrino Date: Mon, 23 Dec 2019 20:22:12 -0300 Subject: [PATCH] Improved makefile --- Makefile | 4 +++- README.md | 7 ++++--- include/pkgi.h | 7 +------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e4a111e..cc078db 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,9 @@ CXXFLAGS = $(CFLAGS) LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map - +ifdef PKGI_ENABLE_LOGGING +CFLAGS += -DPKGI_ENABLE_LOGGING +endif #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib diff --git a/README.md b/README.md index f48734b..c81cd98 100644 --- a/README.md +++ b/README.md @@ -127,14 +127,15 @@ You need to have installed: - [PSL1GHT](https://github.com/bucanero/PSL1GHT) library - [tiny3D lib & libfont](https://github.com/Estwald/PSDK3v2/tree/master/libraries-src/Tiny3D) (from Estwald) - [YA2D lib](https://github.com/bucanero/ya2d_ps3) (an extended version from my repo) +- [MikMod lib](https://github.com/ps3dev/ps3libraries/blob/master/scripts/011-libmikmod-3.1.11.sh) - [dbglogger lib](https://github.com/bucanero/psl1ght-libs/tree/master/dbglogger) (my own debug logging library) -Run `make` to create a release build. After than run `make pkg` to create a `.pkg` install file. +Run `make` to create a release build. After that, run `make pkg` to create a `.pkg` install file. You can also set the environment variable `PS3LOAD=tcp:x.x.x.x` to the PS3's IP address; -that will allow to use `make run` and send `pkgi-ps3.self` directly to the PS3Load listener. +that will allow you to use `make run` and send `pkgi-ps3.self` directly to the PS3Load listener. -To enable debugging logging pass `-DPKGI_ENABLE_LOGGING=ON` argument to make. Then application will send debug messages to +To enable debug logging, build PKGi PS3 with `make PKGI_ENABLE_LOGGING`. The application will send debug messages to UDP multicast address 239.255.0.100:30000. To receive them you can use [socat][] on your PC: $ socat udp4-recv:30000,ip-add-membership=239.255.0.100:0.0.0.0 - diff --git a/include/pkgi.h b/include/pkgi.h index 9223c7c..13cd1e6 100644 --- a/include/pkgi.h +++ b/include/pkgi.h @@ -3,8 +3,6 @@ #include #include -#include - #define PKGI_UPDATE_URL "https://api.github.com/repos/bucanero/pkgi-ps3/releases/latest" #define PKGI_VERSION "1.1.0" @@ -42,16 +40,13 @@ typedef struct pkgi_input { #define PKGI_COUNTOF(arr) (sizeof(arr)/sizeof(0[arr])) -#define PKGI_ENABLE_LOGGING 1 - - #ifdef PKGI_ENABLE_LOGGING +#include #define LOG dbglogger_log #else #define LOG(...) #endif - int pkgi_snprintf(char* buffer, uint32_t size, const char* msg, ...); void pkgi_vsnprintf(char* buffer, uint32_t size, const char* msg, va_list args); char* pkgi_strstr(const char* str, const char* sub);