Ошибка no rule to make target all stop

I’ve just downloaded Eclipse CDT developer kit (87MB) for Windows. I’ve also installed MinGW, and msys.
I also added this to PATH: C:msys1.0bin;C:mingwbin. and restarted computer after that. I’ve checked by type «make —version» in cmd and it works.

However, for some reason I cannot compile my C project. I don’t get binary files and got only the following things in COnsole:

**** Build of configuration Default for project XXX ****

make all 
make: *** No rule to make target `all'.  Stop.

Could some one help me with this please?

asked Sep 15, 2010 at 5:16

chepukha's user avatar

3

For future reference, if you’re trying to import an existing project with a makefile…

This message will still pop up if your makefile doesn’t have an «all» rule. Using the «Generate Makefiles automatically» option should take care of this automatically. If you don’t want makefiles made for you, you have at least 3 simple options…

Option 1

If you don’t want to use a rule by that name, use twokats’ solution. Here’s a clarification.

  1. Go to Project Properties -> C/C++ Build -> Behaviour Tab.
  2. Leave Build (Incremental Build) Checked.
  3. Remove «all» from the text box next to Build (Incremental Build).

This lets Eclipse know you aren’t trying to use a make target called «all». For some reason, that is the default.

Option 2

Use something similar to Etiennebr’s makefile. Note, the all: $(TARGET) line is the rule that Eclipse is complaining it can’t find.

Option 3

Substitute «all» with a rule name of your choice, and be sure to include that rule in your makefile.

answered Jun 17, 2013 at 3:22

drmuelr's user avatar

drmuelrdrmuelr

9151 gold badge13 silver badges30 bronze badges

Just for your reference, there is a way to configure the CDT build options. I had this same error message (although I did have a make target — just not named «all») and found this solution (for Galileo + CDT):

Right click your project and choose Properties. The Properties dialog will appear and you should see a C/C++ Build option where you can set specific build options. Highlight this item, and the Properties page will appear. Choose the configuration you wish to modify, and then in the section below that you should see 2 tabs: Builder Settings and Behavior. It is the Behavior tab you want. In this section you can set preferences for build settings and workbench settings, including specifying a target name (default is «all») or turning off automatic builds.

This was incredibly helpful to me when I started using the CDT. My source code is separate from the build area, and until I configure, no makefiles exist. When I configured, my default target name is explicitly «default», not «all». It was annoying to have Eclipse report an error in my project before I did anything. Setting up the environment to match my development worked wonders. HTH.

answered Sep 16, 2010 at 20:50

twokats's user avatar

twokatstwokats

5201 gold badge4 silver badges12 bronze badges

right click the project Properties->C/C++ Build, in the «Builder Settings» check the «Generate Makefiles automatically» option, and then select the «Builder type» option to «Internal builder», and then click ok, the problem was solved!

answered May 27, 2015 at 8:20

user2913643's user avatar

1

I spent a lot of time on this error and now realized that those projects that are not compiled were created before I installed MinGW and msys so there was no makefile before. And there was no include folder with link to the makefile. That’s the reason why I could not compile it. Now as I create new project, it’s fine.

However, I wonder if there is any way to add the path to makefile for the previous projects?

Thanks

answered Sep 15, 2010 at 5:22

chepukha's user avatar

chepukhachepukha

2,3513 gold badges28 silver badges39 bronze badges

1

You should take a look at your makefile (or create one if missing). That’s the default makefile :

CXXFLAGS =  -O2 -g -Wall -fmessage-length=0
OBJS =      main.cpp
LIBS =
TARGET =      main.exe

$(TARGET):  $(OBJS)
    $(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all:    $(TARGET)
clean:
    rm -f $(OBJS) $(TARGET)

answered Dec 3, 2010 at 16:31

Etienne Racine's user avatar

Etienne RacineEtienne Racine

1,3231 gold badge11 silver badges25 bronze badges

1

I am doing an install of git on Ubuntu 20.04, according to this tutorial. I executed from «Install Git on Linux«, the Debian/Ubuntu parts. And then I get the errors:

make: *** No rule to make target 'all'.  Stop.
make: *** No rule to make target 'install'.  Stop.

at point 3 under «Build Git from source on Linux«. I am new to Linux, but it seems as though make is automatically installed. When I run:

apt list --installed

it is listed:

make/focal,now 4.2.1-1.2 amd64 [installed,automatic]

Can you help on how to take this forward or approach learning about the problem?

Содержание

No rule to make target
GNUmakefile:1: *** missing separator. Stop.
Syntax error : end of file unexpected (expecting «fi»)
OLDPWD not set
@echo: command not found
-bash: make: command not found
Похожие статьи

No rule to make target

make: *** No rule to make target ‘main.cpp’, needed by ‘main.o’. Stop.

GNUmakefile:1: *** missing separator. Stop.

Если вы видите ошибку

GNUmakefile:1: *** missing separator. Stop.

Обратите внимание на GNUmakefile:1:

1 — это номер строки, в которой произошла ошибка

Возможно где-то вместо табуляции затесался пробел. Напоминаю, что в makefile отступы должны быть заданы табуляциями.

Либо таргет перечислен без двоеточия .PHONY clean вместо .PHONY: clean

Либо какая-то похожая ошибка.

Syntax error : end of file unexpected (expecting «fi»)

Если вы видите ошибку

Syntax error : end of file unexpected (expecting «fi»)

Обратите внимание на расстановку ; в конце выражений и расстановку при переносе строк.

Изучите этот

пример

и сравните со своим кодом.

OLDPWD not set

Если внутри makefile вы выполняете cd и видите ошибку

OLDPWD not set

Попробуйте сперва явно перейти в текущую директорию с помощью

CURDIR

cd $(CURDIR)

@echo: command not found

Если внутри makefile вы пытаетесь подавить вывод echo и получаете

@echo: command not found

Скорее всего echo это не первая команда в строке

НЕПРАВИЛЬНО:

if [ ! -f /home/andrei/Downloads/iso/centos_netinstall.iso ]; then
rm ./CentOS-7-x86_64-NetInstall-*;
wget -r -np «http://builder.hel.fi.ssh.com/privx-builds/latest/PrivX-master/Deliverables/» -A «CentOS-7-x86_64-NetInstall-2009.iso

-*.iso;
else
@echo «WARNING: centos_netinstall.iso already exists»;

ПРАВИЛЬНО:

@if [ ! -f /home/andrei/Downloads/iso/centos_netinstall.iso ]; then
rm ./CentOS-7-x86_64-NetInstall-*;
wget -r -np «http://builder.hel.fi.ssh.com/privx-builds/latest/PrivX-master/Deliverables/» -A «CentOS-7-x86_64-NetInstall-2009.iso

-*.iso;
else
echo «WARNING: centos_netinstall.iso already exists»;

-bash: make: command not found

Ошибка

-bash: make: command not found

Означает, что make не установлен.

Установить make в rpm системах можно с помощью yum в deb система — с помощью apt

sudo yum -y install make

sudo apt -y install make

Похожие статьи

make
Основы make
PHONY
CURDIR
shell
wget + make
Переменные в Make файлах
ifeq: Условные операторы
filter
-c: Компиляция
Linux
Bash
C
C++
C++ Header файлы
Configure make install
DevOps
Docker
OpenBSD
Errors make

This topic has been deleted. Only users with topic management privileges can see it.

  • Hi I’m IsaacPrkr and I’m a beginner with using Qt and installed it today to do some work with a C++ project and I’ve ran into an error when trying to run the program and it just says «no rule to make target ‘all’. Stop» at first I searched around the forums trying to find a fix but came to no help for my issue so I was wondering if I make my own someone can help. Really would appreciate it. Thank you.

  • I am not using Qt-Creator myself but the error you get is the compiler telling you it does not know what to do.
    I had a look at QT-Creator once and as far as I know, if you create a new project using their widget, all required MakeFiles are automatically created and you should be able to run your program without any errors like this. I chose to go with another editor and I am using CMake, this forced me to dive into the build process,.. it is boring but you learn a lot about how a program is compiled.

    Either recreate you application within Qt-Creator or do some research into the build process.

  • @jsulm It’s from a git repository. I just imported the file and that was it. I think that’s where I’ve gone wrong however but I’m not sure how I fix it. Is there another way of importing the file so that it builds correctly?

  • «No rule to make target….» usually tells you that the configuring has failed and your compiler doesn’t know what to do at all. But that’s poking around in the fog. To help we’d need more info.

    • Which Qt version are you using?
    • Is it CMake or QMake?
    • Can you post the CMakeLists.txt or the .pro file respectively?
    • Does the «Compile Output» tab say anything?
  • @IsaacPrkr said in New to QtCreator Error «no rule to make target ‘all’. Stop.»:

    I just imported the file and that was it

    What file?
    Is ther a *.pro or CMakeLists.txt file?

  • @jsulm I imported a file named gps from a git repo which contains files inside such as data, headers, src, and tests. Inside data there is data of gps locations, inside headers there are the header programs, inside src is the main cpp programs, and tests is boost tests.

    Outside of these subfiles when you open just the gps file which is the main file I downloaded from the git repo it has a bunch of other files created when I loaded it into qt for the first time. And one of them is a .pro file which I can’t open and dont see in qt.

  • @IsaacPrkr Please post a link to the Git repo.
    You need to load the project file in QtCreator. QtCreator supports Qmake (*.pro) and CMake (CMakeLists.txt).

  • @IsaacPrkr said in New to QtCreator Error «no rule to make target ‘all’. Stop.»:

    And one of them is a .pro file which I can’t open and dont see in qt

    Why can’t you open it? What happens?

  • @jsulm Do you want the https link? If it’s easier we can message on a alternative platform like Discord if that’s better to resolve things.

    Thank you for the help I really do appreciate it.

  • @jsulm I can’t open it it just says I dont have the software to open it that’s all.

  • @IsaacPrkr said in New to QtCreator Error «no rule to make target ‘all’. Stop.»:

    Do you want the https link?

    Yes, the link to the repo.

    How exactly are you trying to open the pro file?
    Do this:

    • Open QtCreator
    • Go to «File/Open File or Project…»
    • Navigate to the project and select the pro file
    • What exactly happens now?
  • @jsulm it says could not display ‘gps.pro’ there is no application for «qt qmake profiles».

    The link is here: https://olympuss.ntu.ac.uk/N0923887/gps.git

    It’s gonna be password protected most likely however.

    When I open the .pro file in qt it comes up with configure project. And it says no suitable kits found and I can’t seem to do anything the configure project is grayed out.

  • @IsaacPrkr said in New to QtCreator Error «no rule to make target ‘all’. Stop.»:

    When I open the .pro file in qt it comes up with configure project. And it says no suitable kits found

    Did you also install at least one Qt version?
    QtCreator is an IDE, you also need Qt if you want to build a Qt application.

  • @jsulm
    When installing all I did was enter
    sudo apt update
    sudo apt install libclang-common-8-dev qt5-default qtcreator ssh-askpass

    In the terminal. Is this wrong?

  • @IsaacPrkr Make sure qt5-qmake is also installed.
    And check whether you have any properly configured Kit in QtCreator.

  • @jsulm I’ve installed qt5-qmake. And how do I go check whether I have a properly configured kit?

  • @IsaacPrkr In QtCreator go to «Tools/Options…/Kits» and check whether there is at least one Kit

  • @jsulm There is only options that say Auto-detected and Manual.

  • @IsaacPrkr said in New to QtCreator Error «no rule to make target ‘all’. Stop.»:

    There is only options that say Auto-detected and Manual

    But are there any Kits, either in manual or auto detected section?
    If there are no Kits then that explains your problem. In this case add a Kit manually — first add your Qt in «Qt Versions» tab (you ) and then a Kit.

  • Я только что загрузил комплект разработчика Eclipse CDT (87 МБ) для Windows. Я также установил MinGW и msys. Я также добавил это в PATH: C:msys1.0bin; C:mingwbin. и после этого перезагрузился компьютер. Я проверил по типу «make -version» в cmd, и он работает.

    Однако по какой-то причине я не могу скомпилировать мой проект C. Я не получаю двоичные файлы и получаю только следующие вещи в COnsole:

    **** Build of configuration Default for project XXX ****
    
    make all 
    make: *** No rule to make target `all'.  Stop.
    

    Может кто-нибудь мне поможет?

    4b9b3361

    Ответ 1

    Для дальнейшего использования, если вы пытаетесь импортировать существующий проект с make файлом…

    Это сообщение будет всплывать, если ваш make файл не имеет правила «все». При использовании опции «Создать файлы Makefile автоматически» следует позаботиться об этом автоматически. Если вам не нужны make файлы, сделанные для вас, у вас есть как минимум 3 простых варианта…

    Вариант 1

    Если вы не хотите использовать правило под этим именем, используйте решение twokats. Здесь уточнение.

    • Перейдите в Project Properties → C/С++ Build → вкладка Behavior.
    • Оставьте сборку (добавочную сборку).
    • Удалите «все» из текстового поля рядом с Build (Incremental Build).

    Это позволяет Eclipse знать, что вы не пытаетесь использовать цель make, называемую «все». По какой-то причине это по умолчанию.

    Вариант 2

    Используйте что-то похожее на make файл Etiennebr. Обратите внимание: строка all: $(TARGET) — это правило, в котором Eclipse жалуется, что не может найти.

    Вариант 3

    Замените «все» на имя правила по вашему выбору и обязательно включите это правило в свой файл.

    Ответ 2

    Как раз для вашей справки, есть способ настроить параметры сборки CDT. У меня было это же сообщение об ошибке (хотя у я была есть цель make — просто не названа «все» ) и нашел это решение (для Galileo + CDT):

    Щелкните правой кнопкой мыши свой проект и выберите Свойства. Появится диалоговое окно «Свойства», и вы увидите опцию C/С++ Build, где вы можете установить определенные параметры сборки. Выделите этот элемент и отобразится страница «Свойства». Выберите конфигурацию, которую вы хотите изменить, а затем в следующем разделе вы увидите две вкладки: Настройки Builder и Поведение. Это вкладка Поведение, которую вы хотите. В этом разделе вы можете установить настройки для параметров сборки и настроек рабочего места, включая указание целевого имени (по умолчанию — «все» ) или отключение автоматических сборок.

    Это было невероятно полезно для меня, когда я начал использовать CDT. Мой исходный код отделен от области сборки, и до тех пор, пока я не настроюсь, никаких make файлов не существует. Когда я настроен, мое целевое имя по умолчанию явно «по умолчанию», а не «все» . Было очень неприятно, что Eclipse сообщал об ошибке в моем проекте, прежде чем я что-то сделал. Настройка среды в соответствии с моей разработкой породила чудеса. НТН.

    Ответ 3

    щелкните правой кнопкой мыши проект Properties- > C/С++ Build, в «Настройках Builder» установите флажок «Генерировать файлы автоматически», а затем выберите «Тип строителя» для «Внутренний строитель», а затем нажмите «ОК», проблема была решена!

    Ответ 4

    Я потратил много времени на эту ошибку и теперь понял, что те проекты, которые не скомпилированы, были созданы до того, как я установил MinGW и msys, поэтому раньше не было makefile. И не было папки include со ссылкой на make файл. Это причина, по которой я не мог ее скомпилировать. Теперь, когда я создаю новый проект, это прекрасно.

    Однако, интересно, есть ли способ добавить путь к makefile для предыдущих проектов?

    Спасибо

    Ответ 5

    Вы должны взглянуть на свой файл makefile (или создать его, если отсутствует). Это файл make default:

    CXXFLAGS =  -O2 -g -Wall -fmessage-length=0
    OBJS =      main.cpp
    LIBS =
    TARGET =      main.exe
    
    $(TARGET):  $(OBJS)
        $(CXX) -o $(TARGET) $(OBJS) $(LIBS)
    all:    $(TARGET)
    clean:
        rm -f $(OBJS) $(TARGET)
    

    Понравилась статья? Поделить с друзьями:
  • Ошибка no response from gameranger server
  • Ошибка no remote refs found similar to flathub
  • Ошибка no option to boot to
  • Ошибка no member named cout in namespace std
  • Ошибка no newline at end of file