Update Makefile to current devkitPro/libogc version. Using auto generated headerfiles from bin2o in filelist.h.

This commit is contained in:
retro100 2021-04-20 22:09:19 +02:00
parent 4fc9d4baec
commit 3a9e60e7fa
4 changed files with 54 additions and 139 deletions

View File

@ -9,23 +9,6 @@ endif
include $(DEVKITPPC)/wii_rules
#---------------------------------------------------------------------------------
# LIBS_VER can be CUR or OLD
#---------------------------------------------------------------------------------
LIBS_VER=CUR
INCLUDES_EXTRA_CUR := -I$(PORTLIBS_PATH)/wii/include/SDL
CFLAGS_EXTRA_CUR := `freetype-config --cflags` -DDEFINE_GLOBALS -DNEW_DEVOPTAB_API
LIBS_CUR := -lSDL -lfat -lwiiuse -lbte -lasnd -logc -lwiikeyboard \
-lvorbisidec -logg -laesnd \
`freetype-config --libs`
INCLUDES_EXTRA_OLD := -I$(LIBOGC_INC)/SDL -I$(PORTLIBS)/include/freetype2
CFLAGS_EXTRA_OLD :=
LIBS_OLD := -lSDL -lfat -lwiiuse -lbte -lasnd -logc -lwiikeyboard \
-lpng -lvorbisidec -lfreetype -lz
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
@ -47,15 +30,15 @@ INCLUDES := include src/platform/wii
#---------------------------------------------------------------------------------
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
-Wno-strict-aliasing -DWORDS_BIGENDIAN \
$(CFLAGS_EXTRA_$(LIBS_VER))
-Wno-strict-aliasing -DWORDS_BIGENDIAN
CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with
#---------------------------------------------------------------------------------
LIBS := $(LIBS_$(LIBS_VER))
LIBS := -lSDL -lfat -lwiiuse -lbte -lasnd -logc -lwiikeyboard \
-lpng -lvorbisidec -logg -lfreetype -lbz2 -lz
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
@ -84,10 +67,9 @@ CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
TTFFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ttf)))
PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png)))
OGGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ogg)))
PCMFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.pcm)))
BINFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ttf) \
$(wildcard $(dir)/*.lang) $(wildcard $(dir)/*.png) \
$(wildcard $(dir)/*.ogg) $(wildcard $(dir)/*.pcm)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
@ -98,10 +80,11 @@ else
export LD := $(CXX)
endif
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(TTFFILES:.ttf=.ttf.o) $(PNGFILES:.png=.png.o) \
$(OGGFILES:.ogg=.ogg.o) $(PCMFILES:.pcm=.pcm.o)
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(sFILES:.s=.o) $(SFILES:.S=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
#---------------------------------------------------------------------------------
# build a list of include paths
@ -109,8 +92,7 @@ export OFILES := $(addsuffix .o,$(BINFILES)) \
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC) \
$(INCLUDES_EXTRA_$(LIBS_VER))
-I$(LIBOGC_INC) -I$(PORTLIBS_PATH)/wii/include/SDL -I$(PORTLIBS_PATH)/ppc/include/freetype2
#---------------------------------------------------------------------------------
# build a list of library paths
@ -124,7 +106,7 @@ export OUTPUT := $(CURDIR)/$(TARGET)
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
@make --no-print-directory -j4 -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@ -150,22 +132,27 @@ DEPENDS := $(OFILES:.o=.d)
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)
$(OFILES_SOURCES): $(HFILES)
#---------------------------------------------------------------------------------
# This rule links in binary data with .ttf, .png, and .mp3 extensions
#---------------------------------------------------------------------------------
%.ttf.o : %.ttf
%.ttf.o %_ttf.h : %.ttf
@echo $(notdir $<)
$(bin2o)
%.png.o : %.png
%.lang.o %_lang.h : %.lang
@echo $(notdir $<)
$(bin2o)
%.ogg.o : %.ogg
%.png.o %_png.h : %.png
@echo $(notdir $<)
$(bin2o)
%.pcm.o : %.pcm
%.ogg.o %_ogg.h : %.ogg
@echo $(notdir $<)
$(bin2o)
%.pcm.o %_pcm.h : %.pcm
@echo $(notdir $<)
$(bin2o)

View File

@ -11,96 +11,45 @@
#ifndef _FILELIST_H_
#define _FILELIST_H_
#include <gccore.h>
#include "font_ttf.h"
extern const u8 font_ttf[];
extern const u32 font_ttf_size;
#include "enter_ogg.h"
#include "exit_ogg.h"
extern const u8 enter_ogg[];
extern const u32 enter_ogg_size;
#include "button_over_pcm.h"
#include "button_click_pcm.h"
extern const u8 exit_ogg[];
extern const u32 exit_ogg_size;
#include "logo_png.h"
#include "logo_over_png.h"
extern const u8 button_over_pcm[];
extern const u32 button_over_pcm_size;
#include "bg_top_png.h"
#include "bg_bottom_png.h"
extern const u8 button_click_pcm[];
extern const u32 button_click_pcm_size;
#include "button_png.h"
#include "button_over_png.h"
extern const u8 logo_png[];
extern const u32 logo_png_size;
#include "button_small_png.h"
#include "button_small_over_png.h"
#include "button_large_png.h"
#include "button_large_over_png.h"
extern const u8 logo_over_png[];
extern const u32 logo_over_png_size;
#include "battery_png.h"
#include "battery_red_png.h"
#include "battery_bar_png.h"
extern const u8 bg_top_png[];
extern const u32 bg_top_png_size;
#include "credits_box_png.h"
extern const u8 bg_bottom_png[];
extern const u32 bg_bottom_png_size;
#include "keyboard_textbox_png.h"
#include "keyboard_key_png.h"
#include "keyboard_key_over_png.h"
#include "keyboard_mediumkey_png.h"
#include "keyboard_mediumkey_over_png.h"
#include "keyboard_largekey_png.h"
#include "keyboard_largekey_over_png.h"
extern const u8 button_png[];
extern const u32 button_png_size;
extern const u8 button_over_png[];
extern const u32 button_over_png_size;
extern const u8 button_small_png[];
extern const u32 button_small_png_size;
extern const u8 button_small_over_png[];
extern const u32 button_small_over_png_size;
extern const u8 button_large_png[];
extern const u32 button_large_png_size;
extern const u8 button_large_over_png[];
extern const u32 button_large_over_png_size;
extern const u8 battery_png[];
extern const u32 battery_png_size;
extern const u8 battery_red_png[];
extern const u32 battery_red_png_size;
extern const u8 battery_bar_png[];
extern const u32 battery_bar_png_size;
extern const u8 credits_box_png[];
extern const u32 credits_box_png_size;
extern const u8 keyboard_textbox_png[];
extern const u32 keyboard_textbox_png_size;
extern const u8 keyboard_key_png[];
extern const u32 keyboard_key_png_size;
extern const u8 keyboard_key_over_png[];
extern const u32 keyboard_key_over_png_size;
extern const u8 keyboard_mediumkey_png[];
extern const u32 keyboard_mediumkey_png_size;
extern const u8 keyboard_mediumkey_over_png[];
extern const u32 keyboard_mediumkey_over_png_size;
extern const u8 keyboard_largekey_png[];
extern const u32 keyboard_largekey_png_size;
extern const u8 keyboard_largekey_over_png[];
extern const u32 keyboard_largekey_over_png_size;
extern const u8 player1_point_png[];
extern const u32 player1_point_png_size;
extern const u8 player2_point_png[];
extern const u32 player2_point_png_size;
extern const u8 player3_point_png[];
extern const u32 player3_point_png_size;
extern const u8 player4_point_png[];
extern const u32 player4_point_png_size;
#include "player1_point_png.h"
#include "player2_point_png.h"
#include "player3_point_png.h"
#include "player4_point_png.h"
#endif

View File

@ -1,17 +0,0 @@
/*
Define DEFINE_GLOBALS if you have undefined reference errors
for font_ttf_size, botton_over_pcm_size, etc.
*/
//#define DEFINE_GLOBALS
#ifdef DEFINE_GLOBALS
#include <gccore.h>
extern const u32 font_ttf_size = 29244;
extern const u32 button_over_pcm_size = 2876;
extern const u32 button_click_pcm_size = 7204;
extern const u32 enter_ogg_size = 59779;
extern const u32 exit_ogg_size = 51898;
#endif

View File

@ -149,11 +149,7 @@ static void * PressKeys (void *arg)
static bool gecko = false;
static mutex_t gecko_mutex = 0;
#ifdef NEW_DEVOPTAB_API
static ssize_t __out_write(struct _reent *r, void* fd, const char *ptr, size_t len)
#else
static ssize_t __out_write(struct _reent *r, int fd, const char *ptr, size_t len)
#endif
{
u32 level;