Welcome! Log In Create A New Profile

Advanced

Makefile errors?

Posted by Jacic 
Makefile errors?
January 20, 2010 01:46AM
And Im not sure why. This makefile came in devkitPro, so it should work(I have the latest version too). In programmers notepad, I click Tools -> make to compile, but I get these errors:

Error makefile 7: Command syntax error
Error makefile 8: Command syntax error
Error makefile 9: Command syntax error
Error makefile 11: Command syntax error
Error makefile 49: Command syntax error
Error makefile 71: Command syntax error
Error makefile 73: Command syntax error
Error makefile 75: Command syntax error
Error makefile 99: Command syntax error
Error makefile 100: Command syntax error
Error makefile 101: Command syntax error
Error makefile 112: Command syntax error
Error makefile 119: Colon expected
Error makefile 120: Colon expected
Error makefile 130: Command syntax error
Error makefile 133: Command syntax error
*** 16 errors during make ***

Here is a link to the makefile: [www.megaupload.com]
Thanks in advance for any help.
Re: Makefile errors?
January 20, 2010 03:09AM
megaupload.com ??? I needed to wait 45 sec to download the file.

Next time paste the content here or use [pastie.org]

Is that what you are trying to do (compile all the subfolders):
SUBDIRS:= `ls | egrep -v '^(\.svn)$$'`

DATESTRING	:=	$(shell date +%Y)$(shell date +%m)$(shell date +%d)

all:
	@for i in $(SUBDIRS); do \
	  if test -e $$i/Makefile ; then \
	    echo "-----------------------------------------------------------";\
	    $(MAKE) -C $$i || { exit 1;} \
	  fi; \
	done;

clean:
	@rm -f *.bz2
	@for i in $(SUBDIRS); do \
	  if test -e $$i/Makefile ; then \
	    $(MAKE) -C $$i clean || { exit 1;} \
	  fi; \
	done;

dist: clean
	@tar --exclude=.svn -cvjf wii-examples-$(DATESTRING).tar.bz2 *

If it came from devkitPro, what folder was it in?
Re: Makefile errors?
January 20, 2010 03:23AM
Sorry about megaupload, I know it sucks(I didnt want to paste the whole thing because it would take up lots of room). Yes I just want it to compile. This is the makefile from the examples section, for the basic template. Nothing was changed, but it wont compile.
Re: Makefile errors?
January 20, 2010 03:31AM
Try this makefile:
#---------------------------------------------------------------------------------
# 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	:=

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

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

LDFLAGS	=	-g $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:=	-lhbmenu -ldb -lftimage -lwiisprite -lpng -lz -lfreetype -lasnd -lmad -lwiiuse -lbte -lfat -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)

#---------------------------------------------------------------------------------
# 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 .png extension
#---------------------------------------------------------------------------------
%.png.o	:	%.png
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	$(bin2o)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .ttf extension
#---------------------------------------------------------------------------------
%.ttf.o	:	%.ttf
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	$(bin2o)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .mp3 extension
#---------------------------------------------------------------------------------
%.mp3.o	:	%.mp3
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	$(bin2o)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
Re: Makefile errors?
January 21, 2010 12:09AM
yes the makefile from the examples is not the one you should use for most stuff. that is just a tool to help you compile all the examples in 1 go. use one from inside one of the example projects.



Edited 1 time(s). Last edit at 01/21/2010 12:09AM by giantpune.
Re: Makefile errors?
January 21, 2010 05:29AM
I still get errors, so Im starting to think it could be something else? Im not sure what though. Id try it in another compiler, except then it cant find gamecuberules and Im not sure how to get Dev-C++ to export .dol files. So Im not sure why it wont compile.
Re: Makefile errors?
January 21, 2010 09:16PM
Reinstall devkitPRO?
Re: Makefile errors?
January 21, 2010 09:57PM
Jacic, are you trying to make a GameCube game?

Because the MakeFile you uploaded was the one from gamecube folder: [devkitpro.svn.sourceforge.net]

And in your last comment you talked about gamecuberules: [devkitpro.svn.sourceforge.net]
Re: Makefile errors?
January 21, 2010 10:57PM
Yes, I uploaded the gamecube one as an example. The same thing happens when I try to compile for the Wii too. I tried re-installing devkitPro already. Twice.
Re: Makefile errors?
January 22, 2010 12:43AM
What error are you getting?

From now on, please only talk about Wii, or else it will be too confusing.
Re: Makefile errors?
January 22, 2010 09:32AM
You have an other C++ compilator in your PC (for example Borland).

The make used is the one of your other compilator. Check your %PATH% variable and you should have the path of devkitpro/devkitppc/bin before the path of your other compilator.
Re: Makefile errors?
January 26, 2010 07:33PM
Now thats ironic: I had to erase my hard drive, re-install windows vista, re-install devkitPro, and now it works fine...Hmm...Thanks anyway everyone.
Re: Makefile errors?
February 02, 2010 06:52AM
Quote
Jacic
Now thats ironic: I had to erase my hard drive, re-install windows vista, re-install devkitPro, and now it works fine...Hmm...Thanks anyway everyone.
That seems like overkill.
Re: Makefile errors?
February 02, 2010 10:33AM
Like i said, it was because you had an other make program on your pc. And it's path was defined before your devkitpro bin folder in the %PATH% environement variable.

When you've formatted your hard drive, you've also erased the other make program and you know have a clean %PATH% variable...
Sorry, only registered users may post in this forum.

Click here to login