Remove deprecated wut.mk buildsystem & obsolete cmake macros

This commit is contained in:
fincs 2021-01-01 20:02:46 +01:00
parent f5f5668cd9
commit 0951f1d8a6
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60
2 changed files with 0 additions and 238 deletions

View File

@ -1,25 +1,5 @@
cmake_minimum_required(VERSION 3.2)
# Links against wutnewlib
macro(wut_enable_newlib target)
message(DEPRECATION "wut_enable_newlib is deprecated and has no effect - it is always enabled; and the macro will be removed in a future release. Please remove it from your CMakeLists.")
endmacro()
# Links against stdc++ wutstdc++ and set -std=c++17
macro(wut_enable_stdcpp target)
message(DEPRECATION "wut_enable_stdcpp is deprecated and has no effect - it is always enabled when using C++; and the macro will be removed in a future release. Please remove it from your CMakeLists.")
endmacro()
# Links against devoptab
macro(wut_enable_devoptab target)
message(DEPRECATION "wut_enable_devoptab is deprecated and has no effect - it is always enabled; and the macro will be removed in a future release. Please remove it from your CMakeLists.")
endmacro()
# Links against wutmalloc
macro(wut_default_malloc target)
message(DEPRECATION "wut_default_malloc is deprecated and has no effect - it is always enabled; and the macro will be removed in a future release. Please remove it from your CMakeLists.")
endmacro()
# Generates ${target}_exports.s from an exports file and adds it to the build
function(wut_add_exports target exports_file)
set(RPL_EXPORTS_FILE ${exports_file})
@ -52,41 +32,12 @@ function(wut_link_rpl target source)
target_link_libraries(${target} ${source}_imports)
endfunction()
function(wut_create_rpl_deprecated target source)
set(RPL_OPTIONS IS_RPX)
set(RPL_SINGLE_ARGS "")
set(RPL_MULTI_ARGS "")
cmake_parse_arguments(RPL "${RPL_OPTIONS}" "${RPL_SINGLE_ARGS}" "${RPL_MULTI_ARGS}" "${ARGN}")
if(RPL_IS_RPX)
# Do nothing - the defaults are good for RPX
else()
set(ELF2RPL_FLAGS ${ELF2RPL_FLAGS} --rpl)
set_property(TARGET ${source} APPEND_STRING PROPERTY
LINK_FLAGS "-specs=${WUT_ROOT}/share/rpl.specs")
endif()
add_custom_target(${target} ALL
COMMAND ${CMAKE_STRIP} -g ${source}
COMMAND ${WUT_ELF2RPL} ${ELF2RPL_FLAGS} ${source} ${target}
DEPENDS ${source}
COMMENT "Creating ${target}")
add_dependencies(${target} ${source})
endfunction()
function(wut_create_rpl target)
set(RPL_OPTIONS IS_RPX)
set(RPL_SINGLE_ARGS "")
set(RPL_MULTI_ARGS "")
cmake_parse_arguments(RPL "${RPL_OPTIONS}" "${RPL_SINGLE_ARGS}" "${RPL_MULTI_ARGS}" "${ARGN}")
if(${ARGC} GREATER 1 AND NOT "${ARGV1}" STREQUAL "IS_RPX")
message(DEPRECATION "wut_create_rpl(dest source) is deprecated, prefer using wut_create_rpl(target) or wut_create_rpx(target)")
wut_create_rpl_deprecated(${ARGV})
return()
endif()
if(RPL_IS_RPX)
# Do nothing - the defaults are good for RPX
set(RPL_SUFFIX "rpx")

View File

@ -1,189 +0,0 @@
# wut makefile beta - let's just stick with cmake, yeah?
# should work for out-of-tree builds
# Scroll to the bottom for predefined/utility variables
# If V isn't given as 1 on the commandline, prepend "@" onto all our commands
# See uses of $(Q) later - this stops make echoing our commands
ifneq ($(strip $(V)), 1)
Q ?= @
endif
# ------------------------------------------------------------------------------
# wut 1.0.0-beta9 and later ships wut_rules, in line with normal devkitPro
# makefiles - please use that!
$(warning "Using wut.mk is deprecated, and will be removed in a future release! Please switch to wut_rules as soon as possible - see https://github.com/devkitPro/wut/blob/master/samples/make/helloworld/Makefile for an example.")
# ------------------------------------------------------------------------------
# Toolchain includes and path setup
# Make sure we have devkitPPC
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment.")
endif
# May as well have a guess. ?= means an existing DEVKITPPC value isn't touched.
export DEVKITPPC ?= $(DEVKITPRO)/devkitPPC
# Pull in devkitPPC bits - this gets $(CC) and friends set up
include $(DEVKITPPC)/base_tools
# Have a guess at WUT_ROOT
export WUT_ROOT ?= $(DEVKITPRO)/wut
# Grab wut tools we need.
WUT_ELF2RPL := $(DEVKITPRO)/tools/bin/elf2rpl
WUT_RPLEXPORTGEN := $(DEVKITPRO)/tools/bin/rplexportgen
# If DEPSDIR isn't defined, assume this is an out-of-tree build and that we're
# already running in the build folder - thus, put deps in CURDIR
DEPSDIR ?= $(CURDIR)
# Default to .d for depends
DEPSEXT ?= d
# ------------------------------------------------------------------------------
# Get our flags in order
# There's some default wut flags, they need to be added
# cpu type and hardware flags, keep all relocations (for elf2rpl), wut includes
WUT_CFLAGS := -mcpu=750 -meabi -mhard-float -isystem $(WUT_ROOT)/include
# Defines to tell code about this environment
WUT_CFLAGS += -D__WIIU__ -D__WUT__ -D__WUT_MAKEFILE__
# keep relocations, use wut linker script
WUT_LDFLAGS := -specs=$(WUT_ROOT)/share/wut.specs
# Path for wut libraries, Always link against coreinit
WUT_LDFLAGS += -L$(WUT_ROOT)/lib -L$(WUT_ROOT)/lib/stubs -lwut
# Append that to user-provided cflags and others
CFLAGS += $(WUT_CFLAGS)
CXXFLAGS += $(WUT_CFLAGS)
OBJCFLAGS += $(WUT_CFLAGS)
# assembler-with-cpp allows using #defines and stuff in Assembly source
# It's forced on devkitPPC, so it's forced here
ASFLAGS += $(WUT_CFLAGS) -x assembler-with-cpp
LDFLAGS += $(WUT_LDFLAGS)
# Linking sucks... this make the ordering of libraries irrelevant, but the
# manuals reckon it's not good for performance. Set WUT_NO_LDGROUPS=1 to disable
# or DIY this bit (_PRE and _POST are included no matter what)
ifneq ($(strip $(WUT_NO_LDGROUPS)), 1)
LDFLAGS_PRE += -Wl,--start-group
LDFLAGS_POST += -Wl,--end-group
endif
# RPX and RPL need slightly different crts (init code)
#%.rpx: LDFLAGS += -specs=$(WUT_ROOT)/share/rpx.specs
%.rpl: LDFLAGS += -specs=$(WUT_ROOT)/share/rpl.specs
# ------------------------------------------------------------------------------
# Linking bits
# What should we call files that have been linked but not run through elf2rpl?
WUT_RPLELF_SUFFIX := .elf
# If we're making an rpl, pass --rpl into elf2rpl
%.rpl: WUT_ELF2RPLFLAGS += --rpl
# Main RPX/RPL linking rule. This process is basically identical for both types,
# aside from a few flags (which we've already set)
%.rpx %.rpl:
# Use CXX to link our initial output file, ready for elf2rpl
@echo LD $(notdir $@)$(WUT_RPLELF_SUFFIX)
$(Q)$(CXX) $^ $(LDFLAGS_PRE) $(LDFLAGS) $(LDFLAGS_POST) -o $@$(WUT_RPLELF_SUFFIX)
$(Q)if [ "$(WUT_NO_STRIP)" = "" ]; then \
echo STRIP $(notdir $@)$(WUT_RPLELF_SUFFIX); \
$(PREFIX)strip -g $@$(WUT_RPLELF_SUFFIX); \
fi
# Run elf2rpl on it
@echo ELF2RPL $(notdir $@)
$(Q)$(WUT_ELF2RPL) $(WUT_ELF2RPLFLAGS) $@$(WUT_RPLELF_SUFFIX) $@
# Unless we're told not to, delete the initial output file
$(Q)if [ "$(WUT_KEEP_RPLELF)" = "" ]; then \
rm -f $@$(WUT_RPLELF_SUFFIX); \
fi
# ------------------------------------------------------------------------------
# Compilation rules
# Bog-standard compilation rules. Only using these and not devkitPPC's
# base_rules because the mkdir bits are needed
# Allow turning off the compilation rules
ifneq ($(strip $(WUT_NO_COMPRULES)), 1)
%.o: %.cpp
@echo CXX $(notdir $<)
@mkdir -p $(dir $*)
$(Q)$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.$(DEPSEXT) $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
%.o: %.c
@echo CC $(notdir $<)
@mkdir -p $(dir $*)
$(Q)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.$(DEPSEXT) $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
%.o: %.m
@echo CC $(notdir $<)
@mkdir -p $(dir $*)
$(Q)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.$(DEPSEXT) $(OBJCFLAGS) -c $< -o $@ $(ERROR_FILTER)
%.o: %.s
@echo CC $(notdir $<)
@mkdir -p $(dir $*)
$(Q)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.$(DEPSEXT) $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
%.o: %.S
@echo CC $(notdir $<)
@mkdir -p $(dir $*)
$(Q)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.$(DEPSEXT) $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
%.a:
@echo AR $(notdir $@)
@mkdir -p $(dir $*)
@rm -f $@
$(Q)$(AR) -rc $@ $^
endif
# Allow turning off the depend rules
ifneq ($(strip $(WUT_NO_DEPEND_INCS)), 1)
# Add the dependency rules, if they exist
include $(shell find $(DEPSDIR) -name "*.$(DEPSEXT)")
endif
# ------------------------------------------------------------------------------
# Optional Extras
# Maybe you want libc/newlib? or a devoptab? These contain the flags you need to
# do it.
# Enable newlib support, making more complex libc functions work. Basic stuff
# like memset doesn't need this, but time functions and malloc do.
# Unless you also use WUT_MALLOC_LDFLAGS, this will dedicate most of the default
# Cafe heap to libc malloc.
# To use:
# LDFLAGS += $(WUT_NEWLIB_LDFLAGS)
#WUT_NEWLIB_LDFLAGS := -Wl,--whole-archive -lwutnewlib -Wl,--no-whole-archive
WUT_NEWLIB_LDFLAGS = $(warning "WUT_NEWLIB_LDFLAGS is deprecated and does nothing")
# Wrap calls to malloc and friends with calls to Cafe's MEMDefaultHeap
# functions, effectivley bypassing the libc heap for most allocations. Forces
# libc heap to be very small.
# To use:
# LDFLAGS += $(WUT_MALLOC_LDFLAGS)
#WUT_MALLOC_LDFLAGS := -Wl,--whole-archive -lwutmalloc -Wl,--no-whole-archive
WUT_MALLOC_LDFLAGS = $(warning "WUT_MALLOC_LDFLAGS is deprecated and does nothing")
# Enable libstdc++ support. Allows use of C++11 threads, along with other C++
# functionality. Make sure to use WUT_NEWLIB_LDFLAGS too.
# To use:
# LDFLAGS += $(WUT_STDCPP_LDFLAGS)
#WUT_STDCPP_LDFLAGS := -lstdc++
#WUT_STDCPP_LDFLAGS += -Wl,--whole-archive -lwutstdc++ -Wl,--no-whole-archive
WUT_STDCPP_LDFLAGS = $(warning "WUT_STDCPP_LDFLAGS is deprecated and does nothing")
# Simple devoptab to allow filesystem access. Mounts the SD alongside the default
# Cafe mounts (/vol/content etc.)
# To use:
# LDFLAGS += $(WUT_DEVOPTAB_LDFLAGS)
#WUT_DEVOPTAB_LDFLAGS := -Wl,--whole-archive -lwutdevoptab -Wl,--no-whole-archive
WUT_DEVOPTAB_LDFLAGS = $(warning "WUT_DEVOPTAB_LDFLAGS is deprecated and does nothing")