From bd8559f6c39c41b268443e9d59eaf27c189f9698 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 1 May 2012 12:37:53 +0000 Subject: [PATCH] Patch adding Wii support by tueidj, part 2: Makefile changes I didn't add Makefile.common, because it needs to be made conditional. git-svn-id: https://svn.eduke32.com/eduke32@2622 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 13 ++++++++++++- polymer/eduke32/build/Makefile.shared | 12 ++++++++++++ polymer/eduke32/source/jaudiolib/Makefile | 5 ++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 53cb7b588..3c9bf5281 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -191,6 +191,12 @@ ifeq ($(PLATFORM),LINUX) LIBS += -lvorbisfile -lvorbis -logg endif +ifeq ($(PLATFORM),WII) + STRIP=powerpc-eabi-strip + OURCFLAGS += -g -mcpu=750 -meabi -mhard-float -msdata -O2 -I$(LIBOGC_INC) -I$(PORTLIBS)/include -DGEKKO + LIBS += -L$(LIBOGC_LIB) -L$(PORTLIBS)/lib -lvorbisidec -lfreetype -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard +endif + ifeq ($(PLATFORM),DARWIN) OURCFLAGS += -fno-pic -I$(abspath Apple) -I$(abspath Apple/include) @@ -247,7 +253,9 @@ else # -lGLU to build with gluBuild2DMipmaps ifeq ($(RENDERTYPE),SDL) ifeq (0,$(SDL_FRAMEWORK)) - OURCFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags)) + ifneq ($(PLATFORM),WII) + OURCFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags)) + endif LIBS+= -lSDL_mixer else OURCFLAGS += -DSDL_FRAMEWORK @@ -280,6 +288,9 @@ endif ifneq (0,$(PROFILER)) OURLDFLAGS+=-pg endif +ifeq ($(PLATFORM),WII) + MISCLINKOPTS+= -g -mrvl -meabi -mhard-float -msdata -Wl,--gc-sections -Wl,-Map,$(notdir $@).map +endif ifeq ($(PRETTY_OUTPUT),1) .SILENT: diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index b6f075fe5..7076c28e4 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -36,11 +36,15 @@ ifeq (4,$(GCC_MAJOR)) endif ifndef ARCH + ifeq ($(PLATFORM), WII) + ARCH= + else ifeq ($(findstring i686, $(shell uname -m)), i686) ARCH=-march=pentium3 $(M_TUNE_GENERIC) -mmmx # -msse2 -mfpmath=sse,387 -malign-double $(M_STACKREALIGN) else ARCH= endif + endif endif BUILDCFLAGS=$(ARCH) @@ -157,6 +161,14 @@ ifeq ($(PLATFORM),SKYOS) SDLCONFIG_CFLAGS=-I/boot/programs/sdk/include/sdl LIBS+= -lSDL -lnet endif +ifeq ($(PLATFORM),WII) + RENDERTYPE=SDL + EXESUFFIX=.elf + override WITHOUT_GTK=1 + BUILDCFLAGS+= -g -mcpu=750 -meabi -mhard-float -msdata -O2 -DGEKKO -DHAVE_INTTYPES -D__POWERPC__ -I$(LIBOGC_INC) -I$(LIBOGC_INC)/SDL + SDLCONFIG= + LIBS+= -lSDL_mixer -lsmpeg -lSDL -laesnd +endif ifeq ($(PLATFORM),QNX) RENDERTYPE=SDL override USE_OPENGL=0 diff --git a/polymer/eduke32/source/jaudiolib/Makefile b/polymer/eduke32/source/jaudiolib/Makefile index b457333e1..d1cad42ad 100644 --- a/polymer/eduke32/source/jaudiolib/Makefile +++ b/polymer/eduke32/source/jaudiolib/Makefile @@ -15,7 +15,10 @@ else endif # for BUILD_ECHOFLAGS: -OURCFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) -I$(INC) -I$(SRC) -DHAVE_VORBIS +OURCFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) -I$(INC) -I$(SRC) +ifneq ($(PLATFORM),WII) + OURCFLAGS+= -DHAVE_VORBIS +endif ifneq ($(RELEASE),0) # Debugging disabled debug+= $(F_NO_STACK_PROTECTOR)