Skip to content

Commit

Permalink
Update for new bin2o configuration (#28)
Browse files Browse the repository at this point in the history
* Update for new bin2o configuration

* Depend on headers explicitly
  • Loading branch information
spotlightishere authored Jan 15, 2025
1 parent f45fe01 commit 704e3a9
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 123 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
*.dol
*.elf
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ 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)))
LANGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.lang)))
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
#---------------------------------------------------------------------------------
Expand All @@ -72,11 +70,12 @@ else
export LD := $(CXX)
endif

export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o) \
$(TTFFILES:.ttf=.ttf.o) $(LANGFILES:.lang=.lang.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
Expand Down Expand Up @@ -124,26 +123,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)

%.lang.o : %.lang
%.lang.o %_lang.h : %.lang
@echo $(notdir $<)
$(bin2o)

%.png.o : %.png
%.png.o %_png.h : %.png
@echo $(notdir $<)
$(bin2o)

%.ogg.o : %.ogg
%.ogg.o %_ogg.h : %.ogg
@echo $(notdir $<)
$(bin2o)

%.pcm.o : %.pcm
%.pcm.o %_pcm.h : %.pcm
@echo $(notdir $<)
$(bin2o)

Expand Down
144 changes: 37 additions & 107 deletions source/filelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,118 +12,48 @@
#include <gccore.h>

// Fonts
extern const u8 font_ttf[];
extern const u32 font_ttf_size;
#include "font_ttf.h"

// Languages
extern const u8 en_lang[];
extern const u32 en_lang_size;
#include "en_lang.h"

// Sounds
extern const u8 bg_music_ogg[];
extern const u32 bg_music_ogg_size;

extern const u8 button_over_pcm[];
extern const u32 button_over_pcm_size;

extern const u8 button_click_pcm[];
extern const u32 button_click_pcm_size;
#include "bg_music_ogg.h"
#include "button_over_pcm.h"
#include "button_click_pcm.h"

// Images
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_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 dialogue_box_png[];
extern const u32 dialogue_box_png_size;

extern const u8 bg_options_png[];
extern const u32 bg_options_png_size;

extern const u8 bg_options_entry_png[];
extern const u32 bg_options_entry_png_size;

extern const u8 folder_png[];
extern const u32 folder_png_size;

extern const u8 bg_file_selection_png[];
extern const u32 bg_file_selection_png_size;

extern const u8 bg_file_selection_entry_png[];
extern const u32 bg_file_selection_entry_png_size;

extern const u8 scrollbar_png[];
extern const u32 scrollbar_png_size;

extern const u8 scrollbar_arrowup_png[];
extern const u32 scrollbar_arrowup_png_size;

extern const u8 scrollbar_arrowup_over_png[];
extern const u32 scrollbar_arrowup_over_png_size;

extern const u8 scrollbar_arrowdown_png[];
extern const u32 scrollbar_arrowdown_png_size;

extern const u8 scrollbar_arrowdown_over_png[];
extern const u32 scrollbar_arrowdown_over_png_size;

extern const u8 scrollbar_box_png[];
extern const u32 scrollbar_box_png_size;

extern const u8 scrollbar_box_over_png[];
extern const u32 scrollbar_box_over_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;

extern const u8 player1_grab_png[];
extern const u32 player1_grab_png_size;

extern const u8 player2_grab_png[];
extern const u32 player2_grab_png_size;

extern const u8 player3_grab_png[];
extern const u32 player3_grab_png_size;

extern const u8 player4_grab_png[];
extern const u32 player4_grab_png_size;
#include "button_png.h"
#include "button_over_png.h"
#include "button_large_png.h"
#include "button_large_over_png.h"
#include "dialogue_box_png.h"
#include "bg_options_png.h"
#include "bg_options_entry_png.h"
#include "folder_png.h"
#include "bg_file_selection_png.h"
#include "bg_file_selection_entry_png.h"
#include "scrollbar_png.h"
#include "scrollbar_arrowup_png.h"
#include "scrollbar_arrowup_over_png.h"
#include "scrollbar_arrowdown_png.h"
#include "scrollbar_arrowdown_over_png.h"
#include "scrollbar_box_png.h"
#include "scrollbar_box_over_png.h"
#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"
#include "player1_point_png.h"
#include "player2_point_png.h"
#include "player3_point_png.h"
#include "player4_point_png.h"
#include "player1_grab_png.h"
#include "player2_grab_png.h"
#include "player3_grab_png.h"
#include "player4_grab_png.h"

#endif

0 comments on commit 704e3a9

Please sign in to comment.