Verminion
Posts: 3
Joined: Sun Dec 30, 2012 12:46 pm

Baking Pi - OK03 Compile problem

Thu Jul 18, 2013 7:45 pm

No problem doing the first two lessons but on the third one I get this compile error.
mkdir build
arm-none-eabi-as -I source/ source/gpio.s -o build/gpio.o
make: *** No rule to make target `build/', needed by `build/main.o'. Stop.
I downloaded the lesson solution and have the same problem. I'm on windows XP, any help?

ckschim
Posts: 1
Joined: Thu Jul 25, 2013 9:28 pm

Re: Baking Pi - OK03 Compile problem

Thu Jul 25, 2013 9:29 pm

Same problem here. I'm on Windows 7 with YATARGO installed. :cry:


EDIT:
Solved it! Change the Makefile, be sure the directory 'build' exists and compile! :D

Code: Select all

###############################################################################
#	makefile
#	 by Alex Chadwick
#
#	A makefile script for generation of raspberry pi kernel images.
###############################################################################

# The toolchain to use. arm-none-eabi works, but there does exist 
# arm-bcm2708-linux-gnueabi.
ARMGNU ?= arm-none-eabi

# The intermediate directory for compiled object files.
BUILD = build/

# The directory in which source files are stored.
SOURCE = source/

# The name of the output file to generate.
TARGET = kernel.img

# The name of the assembler listing file to generate.
LIST = kernel.list

# The name of the map file to generate.
MAP = kernel.map

# The name of the linker script to use.
LINKER = kernel.ld

# The names of all object files that must be generated. Deduced from the 
# assembly code files in source.
OBJECTS := $(patsubst $(SOURCE)%.s,$(BUILD)%.o,$(wildcard $(SOURCE)*.s))

# Rule to make everything.
all: $(TARGET) $(LIST)

# Rule to remake everything. Does not include clean.
rebuild: all

# Rule to make the listing file.
$(LIST) : $(BUILD)output.elf
	$(ARMGNU)-objdump -d $(BUILD)output.elf > $(LIST)

# Rule to make the image file.
$(TARGET) : $(BUILD)output.elf
	$(ARMGNU)-objcopy $(BUILD)output.elf -O binary $(TARGET) 

# Rule to make the elf file.
$(BUILD)output.elf : $(OBJECTS) $(LINKER)
	$(ARMGNU)-ld --no-undefined $(OBJECTS) -Map $(MAP) -o $(BUILD)output.elf -T $(LINKER)

# Rule to make the object files.
$(BUILD)%.o: $(SOURCE)%.s
	$(ARMGNU)-as -I $(SOURCE) $< -o $@

# Rule to clean files.
clean : 
	-rm -f $(BUILD)*.o 
	-rm -f $(BUILD)output.elf
	-rm -f $(TARGET)
	-rm -f $(LIST)
	-rm -f $(MAP)

oneway3124
Posts: 3
Joined: Sun Aug 11, 2013 12:06 pm

Re: Baking Pi - OK03 Compile problem

Sun Aug 11, 2013 1:06 pm

I have some question!

oneway3124
Posts: 3
Joined: Sun Aug 11, 2013 12:06 pm

Re: Baking Pi - OK03 Compile problem

Tue Aug 13, 2013 1:39 pm

> Hello David,
>
> I've not seen that problem before. You could try downloading the
> template again and copying your code into it.
>
> If that doesn't work, I suspect editing the file `Makefile' line 53
> changing it from
> $(BUILD)%.o: $(SOURCE)%.s $(BUILD)
> to
> $(BUILD)%.o: $(SOURCE)%.s
>
> Should fix it. This will also mean that the folder `build' doesn't get
> regenerated if it does not exist, so you would have to create it manually.
>
> Regards,
> Alex Chadwick
>
> On 11/08/2013 15:09, 王伟 wrote:
>> Hi Sir,
>>
>> When I use the Baking Pi course for my os development study , I can
>> finish the lesson one and two succeed, but in lesson , I cannot
>> compile it.
>>
>> I cannot find the real reason?why?The message is as follow!
>>
>> mkdir build
>> arm-none-eabi-as -I source/ source/gpio.s -o build/gpio.o
>> make: *** No rule to make target `build/', needed by `build/main.o'. Stop.
>>
>> Can you help me?
>>
>> My environment is win7, C:\yagarto-20121222
>>
>> Any question you can free contact me.
>>
>> Thanks a lot!
>> Best Regards,
>> David.Wang
>> Engineer,Software
>> China Research & Development Center
>> Harman Automotive
>>
>> VoIP: 3163571
>> Phone: +86-028-64663571
>> Mobile: +86-0-15908106107
>> Email: oneway3124@gmail.com david.wang@harman.com
>> Web: www.harman.com
>
>
> --
> Alex Chadwick
> Part 1B Computer Science
> Girton College - University of Cambridge

Return to “Bare metal, Assembly language”