From bf309324423d14f4da55308d821d47a07cb8530d Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Wed, 10 Apr 2019 23:24:47 -0400 Subject: [PATCH] Use Makefile from template --- examples/basic_drawing/Makefile | 29 +++++++++--------- examples/particle/Makefile | 29 +++++++++--------- .../{source/GFX => data}/RGFX_Background.jpg | Bin .../{source/GFX => data}/RGFX_Crosshair.png | Bin .../{source/GFX => data}/RGFX_Font.png | Bin .../{source/GFX => data}/RGFX_Smoke.png | Bin examples/template/Makefile | 15 +++++---- examples/ttf/Makefile | 17 +++++----- 8 files changed, 47 insertions(+), 43 deletions(-) rename examples/particle/{source/GFX => data}/RGFX_Background.jpg (100%) rename examples/particle/{source/GFX => data}/RGFX_Crosshair.png (100%) rename examples/particle/{source/GFX => data}/RGFX_Font.png (100%) rename examples/particle/{source/GFX => data}/RGFX_Smoke.png (100%) diff --git a/examples/basic_drawing/Makefile b/examples/basic_drawing/Makefile index acfcc36..88e6a5d 100644 --- a/examples/basic_drawing/Makefile +++ b/examples/basic_drawing/Makefile @@ -4,7 +4,7 @@ .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITPPC)),) -$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC) +$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif include $(DEVKITPPC)/wii_rules @@ -17,7 +17,7 @@ include $(DEVKITPPC)/wii_rules #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build -SOURCES := source source/gfx GRRLIB_addon +SOURCES := source source/gfx DATA := data INCLUDES := @@ -25,10 +25,10 @@ INCLUDES := # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE) +CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) CXXFLAGS = $(CFLAGS) -LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map +LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project @@ -73,9 +73,11 @@ else export LD := $(CXX) endif -export OFILES := $(addsuffix .o,$(BINFILES)) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.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 @@ -88,8 +90,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) +export LIBPATHS := -L$(LIBOGC_LIB) $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean @@ -97,7 +98,7 @@ export OUTPUT := $(CURDIR)/$(TARGET) #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ - @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @@ -106,11 +107,7 @@ clean: #--------------------------------------------------------------------------------- run: - psoload $(TARGET).dol - -#--------------------------------------------------------------------------------- -reload: - psoload -r $(TARGET).dol + wiiload $(TARGET).dol #--------------------------------------------------------------------------------- @@ -124,6 +121,8 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES) : $(HFILES) + #--------------------------------------------------------------------------------- # This rule links in binary data with the .jpg extension #--------------------------------------------------------------------------------- diff --git a/examples/particle/Makefile b/examples/particle/Makefile index 1bf07ce..f0a40ce 100644 --- a/examples/particle/Makefile +++ b/examples/particle/Makefile @@ -4,7 +4,7 @@ .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITPPC)),) -$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC) +$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif include $(DEVKITPPC)/wii_rules @@ -18,17 +18,17 @@ include $(DEVKITPPC)/wii_rules TARGET := $(notdir $(CURDIR)) BUILD := build SOURCES := source -DATA := source/GFX +DATA := data INCLUDES := #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE) +CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) CXXFLAGS = $(CFLAGS) -LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map +LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project @@ -73,9 +73,11 @@ else export LD := $(CXX) endif -export OFILES := $(addsuffix .o,$(BINFILES)) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.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 @@ -88,8 +90,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) +export LIBPATHS := -L$(LIBOGC_LIB) $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean @@ -97,7 +98,7 @@ export OUTPUT := $(CURDIR)/$(TARGET) #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ - @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @@ -106,11 +107,7 @@ clean: #--------------------------------------------------------------------------------- run: - psoload $(TARGET).dol - -#--------------------------------------------------------------------------------- -reload: - psoload -r $(TARGET).dol + wiiload $(TARGET).dol #--------------------------------------------------------------------------------- @@ -124,6 +121,8 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES) : $(HFILES) + #--------------------------------------------------------------------------------- # This rule links in binary data with the .jpg extension #--------------------------------------------------------------------------------- diff --git a/examples/particle/source/GFX/RGFX_Background.jpg b/examples/particle/data/RGFX_Background.jpg similarity index 100% rename from examples/particle/source/GFX/RGFX_Background.jpg rename to examples/particle/data/RGFX_Background.jpg diff --git a/examples/particle/source/GFX/RGFX_Crosshair.png b/examples/particle/data/RGFX_Crosshair.png similarity index 100% rename from examples/particle/source/GFX/RGFX_Crosshair.png rename to examples/particle/data/RGFX_Crosshair.png diff --git a/examples/particle/source/GFX/RGFX_Font.png b/examples/particle/data/RGFX_Font.png similarity index 100% rename from examples/particle/source/GFX/RGFX_Font.png rename to examples/particle/data/RGFX_Font.png diff --git a/examples/particle/source/GFX/RGFX_Smoke.png b/examples/particle/data/RGFX_Smoke.png similarity index 100% rename from examples/particle/source/GFX/RGFX_Smoke.png rename to examples/particle/data/RGFX_Smoke.png diff --git a/examples/template/Makefile b/examples/template/Makefile index bd903c5..843b158 100644 --- a/examples/template/Makefile +++ b/examples/template/Makefile @@ -77,9 +77,11 @@ else export LD := $(CXX) endif -export OFILES := $(addsuffix .o,$(BINFILES)) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.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 @@ -92,8 +94,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) +export LIBPATHS := -L$(LIBOGC_LIB) $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean @@ -101,7 +102,7 @@ export OUTPUT := $(CURDIR)/$(TARGET) #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ - @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @@ -124,6 +125,8 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES) : $(HFILES) + #--------------------------------------------------------------------------------- # This rule links in binary data with the .jpg extension #--------------------------------------------------------------------------------- diff --git a/examples/ttf/Makefile b/examples/ttf/Makefile index b743dd3..d023477 100644 --- a/examples/ttf/Makefile +++ b/examples/ttf/Makefile @@ -18,7 +18,7 @@ include $(DEVKITPPC)/wii_rules TARGET := $(notdir $(CURDIR)) BUILD := build SOURCES := source -DATA := data +DATA := data INCLUDES := #--------------------------------------------------------------------------------- @@ -79,9 +79,11 @@ else export LD := $(CXX) endif -export OFILES := $(addsuffix .o,$(BINFILES)) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.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 @@ -94,8 +96,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) +export LIBPATHS := -L$(LIBOGC_LIB) $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean @@ -103,7 +104,7 @@ export OUTPUT := $(CURDIR)/$(TARGET) #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ - @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @@ -126,6 +127,8 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES) : $(HFILES) + #--------------------------------------------------------------------------------- # This rule links in binary data with the .jpg extension #---------------------------------------------------------------------------------