yagarto-tools make error. "Expecting macro or rule defn"

OP (Company: personel) #1533996
Rate this post
• ▲ useful
▼ not useful
I am trying to compile atmel at91sam7s-ek  getting-started-project with 
yagarto. I've configured CHIP/BOARD/CROSS_COMPILE correct. But when I 
stat to make, it prompted "make:  makefile:  line 128:  Error -- 
Expecting macro or rule defn, found neither".

And line 128 is " define rules ". Is that because the make.exe too old 
to recognize the "define" command?  But I'm using the latest 
yagarto-tools-20091223.

######## Makefile ###########
..
all: $(BIN) $(OBJ) $(MEMORIES)

$(BIN) $(OBJ):
  mkdir $@
# The following line is line 128.
define rules

C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))

$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
  $(CC) $(LDFLAGS) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@.lds" -o 
$(OUTPUT)-$$@.elf $$^
  $(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
  $(SIZE) $$^ $(OUTPUT)-$$@.elf

$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
  $(CC) $(CFLAGS) -D$(1) -c -o $$@ $$<

$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
  $(CC) $(ASFLAGS) -D$(1) -c -o $$@ $$<

debug_$(1): $(1)
  perl ../resources/gdb/debug.pl $(OUTPUT)-$(1).elf

endef

$(foreach MEMORY, $(MEMORIES), $(eval $(call rules,$(MEMORY))))

clean:
  -rm -f $(OBJ)/*.o $(BIN)/*.bin $(BIN)/*.elf
###################################
#1534014
Rate this post
• ▲ useful
▼ not useful
Hello Liang,

no problem here, I have double check it again now.
Have you take a look here too:

http://www.yagarto.de/#errata

If I change the BOARD and CHIP like:

CHIP  = at91sam7s256
BOARD = at91sam7s-ek

and CROSS_COMPILE:

CROSS_COMPILE = arm-elf-

it works here. The version from my make is (make --version):

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-mingw32

Best regards,

Michael
OP (Company: personel) #1534039
Rate this post
• ▲ useful
▼ not useful
sorry, my bad.
I've tried make --version before I stated the post. It echoed:

make --version
Usage:
make [-AeEhiknpqrsStTuvVx] [-P#] [-f file] [macro[*][+][:]=value ...] 
[target ...]

I thought it was a special version that yagarto builded.

After I saw your reply, I realized that there must be something wrong 
with the make.exe, then I swithed to the yagarto-tools-20091223\bin dir, 
and tried make --version. I saw the GUN prompt. Then I checked the 
system env vars, the system env var have linked make.exe to something 
else.

thanks & sorry.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.