#--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITPRO)),) $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPro") endif ifeq ($(strip $(DEVKITPPC)),) $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif export PATH := $(DEVKITPPC)/bin:$(PATH) ifeq ($(PLATFORM),) PLATFORM=wii endif #--------------------------------------------------------------------------------- # change shell on Snow Leopard #--------------------------------------------------------------------------------- UNAME_S := $(shell uname -s) UNAME_R := $(shell uname -r) ifneq (,$(findstring Darwin,$(UNAME_S))) ifneq (,$(findstring 10.8.0,$(UNAME_R))) export SHELL=/bin/bash endif endif #--------------------------------------------------------------------------------- # path to tools #--------------------------------------------------------------------------------- export PORTLIBS := $(DEVKITPRO)/portlibs/ppc export PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH) #--------------------------------------------------------------------------------- # the prefix on the compiler executables #--------------------------------------------------------------------------------- PREFIX := powerpc-eabi- export AS := $(PREFIX)as export CC := $(PREFIX)gcc export CXX := $(PREFIX)g++ export AR := $(PREFIX)ar export OBJCOPY := $(PREFIX)objcopy ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH)) #--------------------------------------------------------------------------------- %.a: #--------------------------------------------------------------------------------- @rm -f $@ $(AR) -rc $@ $^ #--------------------------------------------------------------------------------- %.o: %.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.m $(CC) $(OBJCFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.s $(CC) -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.S $(CC) -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- # canned command sequence for binary data #--------------------------------------------------------------------------------- define bin2o bin2s -a 32 $< | $(AS) -o $(@) echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $(