Hacking Help compiling a .dol using makefile

  • Thread starter Thread starter SpaceJump
  • Start date Start date
  • Views Views 3,931
  • Replies Replies 14

SpaceJump

Well-Known Member
Member
Joined
Aug 18, 2005
Messages
3,870
Reaction score
284
Trophies
2
Location
Zebes
XP
3,855
Country
Germany
I want to add a Wii reboot function to the MPlayerWii app so I looked up how to code it (I'm a medium Java developer...). So I wrote a little test app using devkitpro and the test app works, so that I can choose if I want to go to the HBC or to the Wii menu. I compiled the .dol file with the editor of devkitpro using the "make" option. No problem here.
Now I think I added the necessary code to the MPlayerWii source, but this app has to be compiled using a Makefile. I downloaded make.exe but I cannot get it to build the .dol file.

Can anyone tell me how to do it or link me to a good point of information?
 
Screemer said:
makefile should be found here: http://code.google.com/p/mplayerwii/source/browse/#svn/trunk

edit: and maybe you should consider bringing your patch into the actual svn.

You misunderstood me. I already checked the project out with TortoiseSVN (spelling?) using the URL "http://mplayerwii.googlecode.com/svn/trunk" for the checkout. So I have the Makefile. I now want to know how to compile the build using this Makefile to test if my code works.
 
considering DevkitPPC is well installed (ie environment variable properly set),:

1/open a command window
2/go into the directory where the Makefile is
3/type make
4/wait until compilation is done... tadaaa

if you got errors message, then copy them here, just telling "I downloaded make.exe but I cannot get it to build the .dol file" doesn't help
btw, you don't need to download make.exe (from where ?), it's already in devkitppc
 
Jacobeian said:
considering DevkitPPC is well installed (ie environment variable properly set),:

1/open a command window
2/go into the directory where the Makefile is
3/type make
4/wait until compilation is done... tadaaa

if you got errors message, then copy them here, just telling "I downloaded make.exe but I cannot get it to build the .dol file" doesn't help
btw, you don't need to download make.exe (from where ?), it's already in devkitppc

Ok, when typing make in the project directory I get the error message, that the file "wii_rules" cannot be found. What environment variable do I have to set?
 
I already used the devkitpro auto updater (I asume you mean this) and I think it installed correctly (unsure)...
 
1) open up programmers notepad *included in devkitpro*
2) open the makefile with programmers notepad.
3) go to tools>make (or press alt+1)
4) wait.
5) enjoy.
 
QUOTE said:
I want to add a Wii reboot function to the MPlayerWii
I wanted to do that with DMP but he hasn't included the full source and it would take ages getting all the binaries
frown.gif
i contacted him and no reply.

I wouldn't mind that if you mange to edit the return to loader with restart wii
smile.gif
obviously you'll know the command from developers tips on wiibrew
smile.gif
 
hartleyshc said:
1) open up programmers notepad *included in devkitpro*
2) open the makefile with programmers notepad.
3) go to tools>make (or press alt+1)
4) wait.
5) enjoy.

This gives me the same error message as when typing make in cmd:

CODE> "make"
Makefile:10: /c/devkitPro/devkitPPC/wii_rules: No such file or directory
make: *** No rule to make target `/c/devkitPro/devkitPPC/wii_rules'.ÂÂStop.

> Process Exit Code: 2

EDIT: I checked the directory c:/devkitPro/devkitPPC and there's is a file called wii_rules in it.

Any ideas?
 
No, I didn't change the Makefile that came with the checkout. Here is its contents:

CODE#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC")
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# 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ÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(notdir $(CURDIR))
BUILDÂÂÂÂÂÂÂÂ:=ÂÂÂÂbuild
SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂsource
DATAÂÂÂÂÂÂÂÂ:=ÂÂÂÂdataÂÂ
INCLUDESÂÂÂÂ:=

MPLAYER := $(CURDIR)/../mplayer

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGSÂÂÂÂ= -g -O2 -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGSÂÂÂÂ=ÂÂÂÂ$(CFLAGS)

LDFLAGSÂÂÂÂ=ÂÂÂÂ-g $(MACHDEP) -Wl,-Map,$(notdir $@).map -L$(MPLAYER) \
ÂÂÂÂÂÂÂÂÂÂÂÂ$(wildcard $(MPLAYER)/*.o)
ÂÂÂÂÂÂÂÂÂÂÂÂ
#ÂÂÂÂÂÂÂÂÂÂÂÂ$(wildcard $(MPLAYER)/*.a)
ÂÂÂÂÂÂÂÂÂÂÂÂ

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBSÂÂÂÂ:=ÂÂÂÂ-ltinysmb -lwiiuse -lbte -lfat -logc -lm

LIBS := -lvo -lao2 -linput -lmpcodecs -laf -lmpdemux -lstream \
ÂÂÂÂÂÂÂÂ-lswscale -losd -lavformat -lavcodec -lavutil -lpostproc -lmp3 \
ÂÂÂÂÂÂÂÂ-la52 -lmpeg2 -lfaad2 -lvorbisidec -losdep $(LIBS)

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRSÂÂÂÂ:=

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUTÂÂÂÂ:=ÂÂÂÂ$(CURDIR)/$(TARGET)

export VPATHÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIRÂÂÂÂ:=ÂÂÂÂ$(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILESÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILESÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
ÂÂÂÂexport LDÂÂÂÂ:=ÂÂÂÂ$(CC)
else
ÂÂÂÂexport LDÂÂÂÂ:=ÂÂÂÂ$(CXX)
endif

export OFILESÂÂÂÂ:=ÂÂÂÂ$(addsuffix .o,$(BINFILES)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDEÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ-I$(CURDIR)/$(BUILD) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHSÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ-L$(LIBOGC_LIB)

export OUTPUTÂÂÂÂ:=ÂÂÂÂ$(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
ÂÂÂÂ@[ -d $@ ] || mkdir -p $@
ÂÂÂÂ@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
clean:
ÂÂÂÂ@echo clean ...
ÂÂÂÂ@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
run:
ÂÂÂÂwiiload $(TARGET).dol


#---------------------------------------------------------------------------------
else

DEPENDSÂÂÂÂ:=ÂÂÂÂ$(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.jpg.oÂÂÂÂ:ÂÂÂÂ%.jpg
#---------------------------------------------------------------------------------
ÂÂÂÂ@echo $(notdir $
 
hmm if you haven't change the makefile, im at a bit of a loss.
it seems its getting the wrong info on the drive location of wii_rules.
even though it says /c/devkitPro, the output should still be c:\ even if you have to type it c:/

since ive spent a good part of the evening trying to do what your doing *set mplayer to reset instead of boot to launcher.*
mind posting your source?
 
After changing the environment variables (it seems the installer set them wrong without a ":"), I'm now getting this error when compiling with Makefile:

Code:
> "make" 
make[1]: /Makefile: No such file or directory
make[1]: *** No rule to make target `/Makefile'.ÂÂStop.
make: *** [build] Error 2

> Process Exit Code: 2
 

Site & Scene News

Popular threads in this forum