From 796b4abc438e426b9e6e84be7f3eebc8a7e97b03 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Thu, 24 Dec 2020 02:09:10 -0600 Subject: [PATCH 1/2] Update for new bin2o configuration --- .gitignore | 3 + Makefile | 8 +-- source/filelist.h | 144 ++++++++++++---------------------------------- 3 files changed, 44 insertions(+), 111 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a6605f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +*.dol +*.elf diff --git a/Makefile b/Makefile index 1d192f2..3fb1607 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ 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))) - + #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- @@ -72,11 +72,11 @@ else export LD := $(CXX) endif -export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.o) \ +export OFILES := $(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) + $(OGGFILES:.ogg=.ogg.o) $(PCMFILES:.pcm=.pcm.o) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) #--------------------------------------------------------------------------------- # build a list of include paths diff --git a/source/filelist.h b/source/filelist.h index 8a838b9..7777a95 100644 --- a/source/filelist.h +++ b/source/filelist.h @@ -12,118 +12,48 @@ #include // Fonts -extern const u8 font_ttf[]; -extern const u32 font_ttf_size; +#include // Languages -extern const u8 en_lang[]; -extern const u32 en_lang_size; +#include // 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 +#include +#include // 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif From bd6da87e45980a529eed934d4e8b757c7f7bff91 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Wed, 13 Jan 2021 18:19:22 -0600 Subject: [PATCH 2/2] Depend on headers explicitly --- Makefile | 30 +++++++++---------- source/filelist.h | 74 +++++++++++++++++++++++------------------------ 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index 3fb1607..765788b 100644 --- a/Makefile +++ b/Makefile @@ -57,11 +57,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))) -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 @@ -72,11 +70,12 @@ else export LD := $(CXX) endif -export OFILES := $(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) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.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 @@ -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) diff --git a/source/filelist.h b/source/filelist.h index 7777a95..7150f95 100644 --- a/source/filelist.h +++ b/source/filelist.h @@ -12,48 +12,48 @@ #include // Fonts -#include +#include "font_ttf.h" // Languages -#include +#include "en_lang.h" // Sounds -#include -#include -#include +#include "bg_music_ogg.h" +#include "button_over_pcm.h" +#include "button_click_pcm.h" // Images -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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