2011-09-15 20:45:48 +00:00
|
|
|
--
|
2012-06-13 22:29:51 +00:00
|
|
|
-- tests/actions/make/cpp/test_wiidev.lua
|
2011-09-15 20:45:48 +00:00
|
|
|
-- Tests for Wii homebrew support in makefiles.
|
2012-06-13 22:29:51 +00:00
|
|
|
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project
|
2011-09-15 20:45:48 +00:00
|
|
|
--
|
|
|
|
|
2012-06-13 22:29:51 +00:00
|
|
|
T.make_wiidev = {}
|
2011-09-15 20:45:48 +00:00
|
|
|
local suite = T.make_wiidev
|
|
|
|
local make = premake.make
|
|
|
|
local cpp = premake.make.cpp
|
2012-06-13 22:29:51 +00:00
|
|
|
local project = premake5.project
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup
|
|
|
|
--
|
2011-09-15 20:45:48 +00:00
|
|
|
|
|
|
|
local sln, prj, cfg
|
2012-06-13 22:29:51 +00:00
|
|
|
|
2011-09-15 20:45:48 +00:00
|
|
|
function suite.setup()
|
2012-06-13 22:29:51 +00:00
|
|
|
sln, prj = test.createsolution()
|
|
|
|
system "wii"
|
|
|
|
cfg = project.getconfig(prj, "Debug")
|
2011-09-15 20:45:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Make sure that the Wii-specific flags are passed to the tools.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.writesCorrectFlags()
|
2012-06-13 22:29:51 +00:00
|
|
|
cpp.flags(cfg, premake.tools.gcc)
|
2011-09-15 20:45:48 +00:00
|
|
|
test.capture [[
|
2012-06-13 22:29:51 +00:00
|
|
|
DEFINES +=
|
|
|
|
INCLUDES +=
|
|
|
|
CPPFLAGS += -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) $(DEFINES) $(INCLUDES)
|
2011-09-15 20:45:48 +00:00
|
|
|
CFLAGS += $(CPPFLAGS) $(ARCH)
|
|
|
|
CXXFLAGS += $(CFLAGS)
|
2011-09-19 20:45:49 +00:00
|
|
|
LDFLAGS += -s -L$(LIBOGC_LIB) $(MACHDEP)
|
2011-09-15 20:45:48 +00:00
|
|
|
RESFLAGS += $(DEFINES) $(INCLUDES)
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Make sure the dev kit include is written to each Wii build configuration.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.writesIncludeBlock()
|
2012-06-13 22:29:51 +00:00
|
|
|
make.settings(cfg, premake.tools.gcc)
|
2011-09-15 20:45:48 +00:00
|
|
|
test.capture [[
|
|
|
|
ifeq ($(strip $(DEVKITPPC)),)
|
|
|
|
$(error "DEVKITPPC environment variable is not set")'
|
|
|
|
endif
|
|
|
|
include $(DEVKITPPC)/wii_rules'
|
|
|
|
]]
|
|
|
|
end
|