Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Newbie help

Hi,

I tried to run hello.c as per the tutorial in the linux reference guide. However, I get the following errors when i build the project (in the Nios IDE - Im using Nios2 eval kit 1.1) :

Description                                                                         Resource           In Folder        Location
*** No rule to make target `../Rules.mak'.                        hello_world  
*** No rule to make target `hello.exe', needed by `all'.   hello_world    
../Rules.mak: No such file or directory                                Makefile           hello_world      line 3

I used the same makefile given in the folder with the hello.c program and did not edit the Rules.mak

The code for the rules.mak:

TOPDIR = ..
include $(TOPDIR)/Rules.mak
#  #  configurable options#   - set DEBUG = 1 to turn on debugging support# 
DEBUG = 0
PROJ_NAME = hello
INSTALL_DIR = 
PROGS := $(PROJ_NAME).exe
CFLAGS +=
# #  You should not need to modify anything beyond this point# 
ifeq '$(DEBUG)' '1'
    CFLAGS += -O0 -g
    PROGS += $(PROGS:.exe=.gdb)
endif
all: $(PROGS)
.PHONY: clean
clean:
    -rm -f *. *.elf *.gdb *.bin *.exe
.PHONY: install
install: all
ifeq "$(INSTALL_DIR)" ""
    $(error No installation directory specified)
endif
    mkdir -p $(INSTALL_DIR)/bin
    install -v $(filter %.exe, $(PROGS)) $(INSTALL_DIR)/bin

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    I used the same makefile given in the folder with the hello.c program and did not edit the Rules.mak

    The code for the rules.mak:[/b]

    --- Quote End ---

    I think that you meant Makefile because this is the code of the makefile.

    I think that the problem is :

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    TOPDIR = ..[/b]

    --- Quote End ---

    That means that the path of your Rules.mak file is one directory above the project&#39;s directory.

    If the Rules.mak and Makefile are in the same directory then you must change the TOPDIR to :

    TOPDIR = ./
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes, you are right. It worked after changing it.

    Thanks for the help.