mirror of
https://github.com/wiiu-env/homebrew_launcher.git
synced 2024-11-24 05:39:18 +01:00
- re-based to v1.3
- returned back to own makefile with --gc-sections - wut adaptions required for that (not yet submitted)
This commit is contained in:
commit
e8fa4998b2
238
Makefile
238
Makefile
@ -2,107 +2,207 @@
|
|||||||
# Clear the implicit built in rules
|
# Clear the implicit built in rules
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
ifeq ($(strip $(DEVKITPPC)),)
|
||||||
|
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(DEVKITPRO)),)
|
||||||
|
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
|
||||||
|
endif
|
||||||
ifeq ($(strip $(WUT_ROOT)),)
|
ifeq ($(strip $(WUT_ROOT)),)
|
||||||
$(error "Please ensure WUT_ROOT is in your environment.")
|
$(error "Please ensure WUT_ROOT is in your environment.")
|
||||||
endif
|
endif
|
||||||
|
export PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH)
|
||||||
ifeq ($(findstring CYGWIN,$(shell uname -s)),CYGWIN)
|
export LIBOGC_INC := $(DEVKITPRO)/libogc/include
|
||||||
ROOT := $(shell cygpath -w ${CURDIR})
|
export LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/wii
|
||||||
WUT_ROOT := $(shell cygpath -w ${WUT_ROOT})
|
|
||||||
else
|
|
||||||
ROOT := $(CURDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
export PORTLIBS := $(DEVKITPRO)/portlibs/ppc
|
export PORTLIBS := $(DEVKITPRO)/portlibs/ppc
|
||||||
|
|
||||||
include $(WUT_ROOT)/rules/rpl.mk
|
PREFIX := powerpc-eabi-
|
||||||
|
|
||||||
AS := $(PREFIX)as
|
export AS := $(PREFIX)as
|
||||||
|
export CC := $(PREFIX)gcc
|
||||||
|
export CXX := $(PREFIX)g++
|
||||||
|
export AR := $(PREFIX)ar
|
||||||
|
export OBJCOPY := $(PREFIX)objcopy
|
||||||
|
|
||||||
TARGET := $(notdir $(CURDIR))
|
export ELF2RPL := $(WUT_ROOT)/bin/elf2rpl
|
||||||
BUILD := build
|
|
||||||
SOURCE := src \
|
|
||||||
src/dynamic_libs \
|
|
||||||
src/fs \
|
|
||||||
src/game \
|
|
||||||
src/gui \
|
|
||||||
src/kernel \
|
|
||||||
src/loader \
|
|
||||||
src/menu \
|
|
||||||
src/network \
|
|
||||||
src/patcher \
|
|
||||||
src/resources \
|
|
||||||
src/settings \
|
|
||||||
src/sounds \
|
|
||||||
src/system \
|
|
||||||
src/utils \
|
|
||||||
src/video \
|
|
||||||
src/video/shaders
|
|
||||||
INCLUDE := src
|
|
||||||
DATA := data \
|
|
||||||
data/images \
|
|
||||||
data/fonts \
|
|
||||||
data/sounds
|
|
||||||
LIBS := -lgcc -lcrt -lcoreinit -lproc_ui -lnsysnet -lsndcore2 -lvpad -lgx2 -lgd -lpng -lz -lfreetype -lmad -lvorbisidec
|
|
||||||
|
|
||||||
CFLAGS += -O3 -std=gnu11 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing
|
#---------------------------------------------------------------------------------
|
||||||
CXXFLAGS += -O3 -std=gnu++11 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing
|
# TARGET is the name of the output
|
||||||
|
# BUILD is the directory where object files & intermediate files will be placed
|
||||||
|
# SOURCES is a list of directories containing source code
|
||||||
|
# INCLUDES is a list of directories containing extra header files
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
TARGET := homebrew_launcher
|
||||||
|
BUILD := build
|
||||||
|
BUILD_DBG := $(TARGET)_dbg
|
||||||
|
SOURCES := src \
|
||||||
|
src/dynamic_libs \
|
||||||
|
src/fs \
|
||||||
|
src/game \
|
||||||
|
src/gui \
|
||||||
|
src/kernel \
|
||||||
|
src/loader \
|
||||||
|
src/menu \
|
||||||
|
src/network \
|
||||||
|
src/patcher \
|
||||||
|
src/resources \
|
||||||
|
src/settings \
|
||||||
|
src/sounds \
|
||||||
|
src/system \
|
||||||
|
src/utils \
|
||||||
|
src/video \
|
||||||
|
src/video/shaders
|
||||||
|
DATA := data \
|
||||||
|
data/images \
|
||||||
|
data/fonts \
|
||||||
|
data/sounds
|
||||||
|
|
||||||
|
INCLUDES := src
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# options for code generation
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
CFLAGS := -std=gnu11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \
|
||||||
|
-O3 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE)
|
||||||
|
CXXFLAGS := -std=gnu++11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \
|
||||||
|
-O3 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE)
|
||||||
|
ASFLAGS := -mregnames
|
||||||
|
LDFLAGS := -nostartfiles -T $(WUT_ROOT)/rules/rpl.ld -pie -fPIE -z common-page-size=64 -z max-page-size=64 -lcrt \
|
||||||
|
-Wl,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size \
|
||||||
|
-Wl,-wrap,_malloc_r,-wrap,_free_r,-wrap,_realloc_r,-wrap,_calloc_r,-wrap,_memalign_r,-wrap,_malloc_usable_size_r \
|
||||||
|
-Wl,-wrap,valloc,-wrap,_valloc_r,-wrap,_pvalloc_r,-wrap,__eabi -Wl,--gc-sections
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
Q := @
|
||||||
|
MAKEFLAGS += --no-print-directory
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# any extra libraries we wish to link with the project
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
LIBS := -lcrt -lcoreinit -lproc_ui -lnsysnet -lsndcore2 -lvpad -lgx2 -lgd -lpng -lz -lfreetype -lmad -lvorbisidec
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# list of directories containing libraries, this must be the top level containing
|
||||||
|
# include and lib
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
LIBDIRS := $(CURDIR) \
|
||||||
|
$(DEVKITPPC)/ \
|
||||||
|
$(DEVKITPPC)/lib/gcc/powerpc-eabi/4.8.2 \
|
||||||
|
$(WUT_ROOT)/lib
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# no real need to edit anything past this point unless you need to add additional
|
||||||
|
# rules for different file extensions
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
export PROJECTDIR := $(CURDIR)
|
||||||
|
export OUTPUT := $(CURDIR)/$(TARGETDIR)/$(TARGET)
|
||||||
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||||
|
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||||
|
export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||||
|
|
||||||
export OUTPUT := $(ROOT)/$(TARGET)
|
#---------------------------------------------------------------------------------
|
||||||
export VPATH := $(foreach dir,$(SOURCE),$(ROOT)/$(dir)) \
|
# automatically build a list of object files for our project
|
||||||
$(foreach dir,$(DATA),$(ROOT)/$(dir))
|
#---------------------------------------------------------------------------------
|
||||||
export BUILDDIR := $(ROOT)
|
FILELIST := $(shell bash ./filelist.sh)
|
||||||
export DEPSDIR := $(BUILDDIR)
|
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||||
|
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||||
CFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.c)))
|
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||||
CXXFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.cpp)))
|
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
||||||
SFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.S)))
|
|
||||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||||
|
TTFFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf)))
|
||||||
|
PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png)))
|
||||||
|
|
||||||
ifeq ($(strip $(CXXFILES)),)
|
#---------------------------------------------------------------------------------
|
||||||
export LD := $(CC)
|
# use CXX for linking C++ projects, CC for standard C
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
ifeq ($(strip $(CPPFILES)),)
|
||||||
|
export LD := $(CC)
|
||||||
else
|
else
|
||||||
export LD := $(CXX)
|
export LD := $(CXX)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export OFILES := $(CFILES:.c=.o) \
|
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||||
$(CXXFILES:.cpp=.o) \
|
$(sFILES:.s=.o) $(SFILES:.S=.o) \
|
||||||
$(SFILES:.S=.o) \
|
$(PNGFILES:.png=.png.o) $(addsuffix .o,$(BINFILES))
|
||||||
$(addsuffix .o,$(BINFILES))
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# build a list of include paths
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||||
|
-I$(CURDIR)/$(BUILD) -I$(WUT_ROOT)/include \
|
||||||
|
-I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2
|
||||||
|
|
||||||
export INCLUDES := $(foreach dir,$(INCLUDE),-I$(ROOT)/$(dir)) \
|
|
||||||
-I$(ROOT)/$(BUILD) \
|
|
||||||
-I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# build a list of library paths
|
# build a list of library paths
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
export LIB_DIRS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)) \
|
||||||
-L$(PORTLIBS)/lib
|
-L$(LIBOGC_LIB) -L$(PORTLIBS)/lib
|
||||||
|
|
||||||
.PHONY: $(BUILD) clean
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||||
|
.PHONY: $(BUILD) clean install
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
$(BUILD):
|
$(BUILD):
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $@ ] || mkdir -p $@
|
||||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(ROOT)/Makefile
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
clean:
|
clean:
|
||||||
@echo "[RM] $(notdir $(OUTPUT))"
|
@echo clean ...
|
||||||
@rm -rf $(BUILD) $(OUTPUT).elf $(OUTPUT).rpx $(OUTPUT).a
|
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).bin $(BUILD_DBG).elf
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
else
|
else
|
||||||
|
|
||||||
# workaround as wut overwrites the LIBPATHS with its rules -> not cool
|
DEPENDS := $(OFILES:.o=.d)
|
||||||
export LIBPATHS := $(LIBPATHS) $(LIB_DIRS)
|
|
||||||
|
|
||||||
DEPENDS := $(OFILES:.o=.d)
|
#---------------------------------------------------------------------------------
|
||||||
|
# main targets
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
$(OUTPUT).rpx: $(OUTPUT).elf
|
||||||
|
$(OUTPUT).elf: $(OFILES)
|
||||||
|
|
||||||
$(OUTPUT).rpx: $(OUTPUT).elf
|
#---------------------------------------------------------------------------------
|
||||||
$(OUTPUT).elf: $(OFILES)
|
# This rule links in binary data with the .jpg extension
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.elf: $(OFILES)
|
||||||
|
@echo "linking ... $(TARGET).elf"
|
||||||
|
$(Q)$(LD) $^ $(LDFLAGS) -o $@ $(LIBPATHS) $(LIBS)
|
||||||
|
# $(Q)$(OBJCOPY) -S -R .comment -R .gnu.attributes ../$(BUILD_DBG).elf $@
|
||||||
|
|
||||||
|
../data/loader.bin:
|
||||||
|
$(MAKE) -C ../loader clean
|
||||||
|
$(MAKE) -C ../loader
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.rpx: %.elf
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
@echo "[RPX] $(notdir $@)"
|
||||||
|
$(ELF2RPL) $^ $@
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.a:
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
@echo $(notdir $@)
|
||||||
|
@rm -f $@
|
||||||
|
@$(AR) -rc $@ $^
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.o: %.cpp
|
||||||
|
@echo $(notdir $<)
|
||||||
|
@$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.o: %.c
|
||||||
|
@echo $(notdir $<)
|
||||||
|
@$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.o: %.S
|
||||||
|
@echo $(notdir $<)
|
||||||
|
@$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
%.png.o : %.png
|
%.png.o : %.png
|
||||||
|
@ -20,10 +20,9 @@
|
|||||||
* along with FreeTypeGX. If not, see <http://www.gnu.org/licenses/>.
|
* along with FreeTypeGX. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FreeTypeGX.h"
|
|
||||||
#include "video/CVideo.h"
|
#include "video/CVideo.h"
|
||||||
#include "video/shaders/Texture2DShader.h"
|
#include "video/shaders/Texture2DShader.h"
|
||||||
#include "utils/logger.h"
|
#include "FreeTypeGX.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user