You are not logged in.
Hi there,
first of all sorry for my english knowledge. I'm from Germany.
I'm trying to build my own app and i got this strange error:
No rule to make target GRRLIB.o, needed by /home/danny/workspace/yamc/yamc.elf
That's my Makefile:
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>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
#---------------------------------------------------------------------------------
GRRLIB := $(DEVKITPRO)/GRRLIB
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src src/gfx $(GRRLIB)/include
DATA := data
INCLUDES :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(GRRLIB)
#---------------------------------------------------------------------------------
# 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:
psoload $(TARGET).dol
#---------------------------------------------------------------------------------
reload:
psoload -r $(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 $<)
$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------Hope anyone can help...
Best regards,
Danny.
EDIT: That's my folder structure:
Last edited by WasserDragoon (2009-07-30 15:36:25)
Offline
Hi, first of all, I don't have any idea why GRRLIB.c in your include folder? If you do that you need to change the path to GRRLIB:
GRRLIB := $(DEVKITPRO)/GRRLIB/include TARGET := $(notdir $(CURDIR)) BUILD := build SOURCES := src src/gfx $(GRRLIB) DATA := data INCLUDES :=
If you have any problem, follow the standard procedure:
1) Download GRRLIB: http://grrlib.santo.fr/release/GRRLib4.0.0.rar
2) Extract it to C:\devkitPro\examples\wii\
3) Go to C:\devkitPro\examples\wii\grrlib\examples\template and compile the code. If it works go to step 4, else paste your error on this forum
4) Change the code in C:\devkitPro\examples\wii\grrlib\examples\template\source\main.c
5) Enjoy homebrewing
Offline
I renamed the GRRLIB folder to "include"...
I need a way to use GRRLIB in more than one project instread of copying it directly to my project dir...
now there's a /opt/devkitPro/GRRLIB/include folder which contains the header and source file, you saw in the picture above...
i changed to
SOURCES := src src/gfx $(GRRLIB)
instead of
SOURCES := src src/gfx $(GRRLIB)/include
and now i get these errors:
main.o: In function `main': /home/danny/workspace/yamc/src/main.c:23: undefined reference to `GRRLIB_LoadTexture' /home/danny/workspace/yamc/src/main.c:25: undefined reference to `GRRLIB_Init' /home/danny/workspace/yamc/src/main.c:32: undefined reference to `GRRLIB_DrawImg' /home/danny/workspace/yamc/src/main.c:34: undefined reference to `GRRLIB_Render' collect2: ld returned 1 exit status make[1]: *** [/home/danny/workspace/yamc/yamc.elf] Fehler 1 make: *** [build] Fehler 2
Last edited by WasserDragoon (2009-07-30 20:06:33)
Offline
I am very worried about this bit:
#--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- LIBDIRS := $(GRRLIB)
The svn/trunk and downloadable versions of GRRLIB are *not* libraries ...they are just a file full of functions for you to put in with all the rest of your source to be compiled in just like everything else ![]()
The lib version is in svn/branches/lib-conversion ...this branch is currently at the state "functional but not optimised for performance"
BC
Offline
if i change
LIBDIRS := $(GRRLIB)
to
LIBDIRS :=
i get the same errors like above...
Offline
WasserDragoon wrote:
i changed to
Code:
SOURCES := src src/gfx $(GRRLIB)instead of
Code:
SOURCES := src src/gfx $(GRRLIB)/include
If you do that, you need to change this too:
GRRLIB := $(DEVKITPRO)/GRRLIB/include
If you don't change it the path will be this equivalent of:
SOURCES := src src/gfx $(DEVKITPRO)/GRRLIB
because:
GRRLIB := $(DEVKITPRO)/GRRLIB
So that's not the path were your .c and .h are.
Offline
now i downloaded the grrlib4.0 file, extracted it to /opt/devkitPro
now the location where the .h and .c files are is: /opt/devkitPro/grrlib/GRRLIB/GRRLIB
that's my new makefile:
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>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
#---------------------------------------------------------------------------------
GRRLIB := $(DEVKITPRO)/grrlib/GRRLIB/GRRLIB
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src src/gfx $(GRRLIB)
DATA := data
INCLUDES :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm
#---------------------------------------------------------------------------------
# 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) \
-I$(GRRLIB)
#---------------------------------------------------------------------------------
# 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:
psoload $(TARGET).dol
#---------------------------------------------------------------------------------
reload:
psoload -r $(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 $<)
$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------error:
make[1]: *** Keine Regel vorhanden, um das Target »GRRLIB.o«, benötigt von »/home/danny/workspace/yamc/yamc.elf«, zu erstellen. Schluss. make: *** [build] Fehler 2
english version:
make[1]: *** No rule to create target »GRRLIB.o«, needed by »/home/danny/workspace/yamc/yamc.elf«.
Offline
Try cleaning the folder with Alt + 2 in Programmer's Notepad.
Could you check after compilation if this file exist: /home/danny/workspace/yamc/build/GRRLIB.o
Offline
i don't have programmer's notepad, im on linux, but i did this:
danny@Danny:~/workspace/yamc$ make clean clean ... danny@Danny:~/workspace/yamc$ make main.c /home/danny/workspace/yamc/src/main.c:11:20: error: GRRLIB.h: No such file or directory /home/danny/workspace/yamc/src/main.c: In function 'main': /home/danny/workspace/yamc/src/main.c:23: error: 'GRRLIB_texImg' undeclared (first use in this function) /home/danny/workspace/yamc/src/main.c:23: error: (Each undeclared identifier is reported only once /home/danny/workspace/yamc/src/main.c:23: error: for each function it appears in.) /home/danny/workspace/yamc/src/main.c:23: error: expected ';' before 'tex_bg' /home/danny/workspace/yamc/src/main.c:25: warning: implicit declaration of function 'GRRLIB_Init' /home/danny/workspace/yamc/src/main.c:32: warning: implicit declaration of function 'GRRLIB_DrawImg' /home/danny/workspace/yamc/src/main.c:32: error: 'tex_bg' undeclared (first use in this function) /home/danny/workspace/yamc/src/main.c:34: warning: implicit declaration of function 'GRRLIB_Render' /home/danny/workspace/yamc/src/main.c:40: warning: implicit declaration of function 'GRRLIB_Exit' make[1]: *** [main.o] Fehler 1 make: *** [build] Fehler 2 danny@Danny:~/workspace/yamc$ cd build danny@Danny:~/workspace/yamc/build$ ls main.d
Offline
In your program (main.c) what is the path to GRRLIB.h, because this won't work you:
#include "../../../GRRLIB/GRRLIB/GRRLIB.h"
You need to adjust to point to /opt/devkitPro/grrlib/GRRLIB/GRRLIB/GRRLIB.h
Offline
if i use this
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC) \
-I$(GRRLIB)i can do:
#include "GRRLIB.h"
if this wouldn't work i would get something like "can't find GRRLIB.h", but thats not the case.
Last edited by WasserDragoon (2009-07-30 21:42:00)
Offline
WasserDragoon wrote:
if this wouldn't work i would get something like "can't find GRRLIB.h", but thats not the case.
In your last message you could read:
WasserDragoon wrote:
Code:
/home/danny/workspace/yamc/src/main.c:11:20: error: GRRLIB.h: No such file or directory
Offline
yes, because i forgot to add the -I flag...
now i get the GRRLIB.o error
EDIT:
danny@Danny:~/workspace/yamc$ make main.c bg.c movies.c movies_hover.c music.c music_hover.c photos_video.c photos_video_hover.c radio.c radio_hover.c television.c television_hover.c make[1]: *** Keine Regel vorhanden, um das Target »GRRLIB.o«, benötigt von »/home/danny/workspace/yamc/yamc.elf«, zu erstellen. Schluss. make: *** [build] Fehler 2 danny@Danny:~/workspace/yamc$ cd build danny@Danny:~/workspace/yamc/build$ ls bg.d movies_hover.o photos_video.d radio_hover.o bg.o movies.o photos_video_hover.d radio.o main.d music.d photos_video_hover.o television.d main.o music_hover.d photos_video.o television_hover.d movies.d music_hover.o radio.d television_hover.o movies_hover.d music.o radio_hover.d television.o
EDIT2: it must be anything in the makefile, because compiling the examples works very well...
here's my current makefile:
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>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
#---------------------------------------------------------------------------------
GRRLIB := /opt/devkitPro/grrlib/GRRLIB
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src src/gfx $(GRRLIB)/GRRLIB
DATA := data
INCLUDES :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(GRRLIB)
#---------------------------------------------------------------------------------
# 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) \
-I$(GRRLIB)/GRRLIB
#---------------------------------------------------------------------------------
# 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:
psoload $(TARGET).dol
#---------------------------------------------------------------------------------
reload:
psoload -r $(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 $<)
$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------Last edited by WasserDragoon (2009-07-31 03:23:25)
Offline
Okay, I got it, i needed a path based on the path of project's makefile - while $DEVKITPRO = /opt/devkitPro:
GRRLIB := ../../../..$(DEVKITPRO)/GRRLIB
That's really strange, because this doesn't work:
GRRLIB := $(DEVKITPRO)/GRRLIB
Why absolute paths doesn't work and relative paths does?
EDIT:
Within the makefile, all paths are relative to the makefile directory. Absolute paths are occasionally required and these are accessed using CURDIR.
Source: http://oreilly.com/catalog/make3/book/ch03.pdf
Last edited by WasserDragoon (2009-08-01 19:02:30)
Offline