No Image

Recipe commences before first target

СОДЕРЖАНИЕ
553 просмотров
10 марта 2020

Я пытался создать файл make для загрузки плагина из оснастки телеметрии. когда я пытался с помощью команды sudo make build она показывает Makefile:21: *** recipe commences before first target. Stop. Makefile:21: *** recipe commences before first target. Stop. эта ошибка. В файле make я добавил

Мой файл make выглядит, как cat -e -t -v Makefile ниже, когда я делаю cat -e -t -v Makefile где ^ я показывает пространство вкладок, а $ представляет конец строки

Где может быть проблема. согласно моим знаниям, я дал правильные вкладки.

Несколько вещей: во-первых, make ожидает цели/рецепт в виде:

И он будет запускать рецепты тогда и только тогда, когда цель должна быть перестроена. Вы не указываете цель, но вы указываете строки, начинающиеся с вкладок (рецептов). Make жалуется, что у вас есть рецепты без цели (как и должно быть).

Однако, если сказать, что это не похоже на то, что вы хотите, чтобы ваши строки запускались как часть рецепта (это не сработало бы, так как экспортируемые переменные не запоминаются с одной линии рецептов на другую, не говоря уже о разных целях),

Вероятно, вы захотите сделать:

без предшествующих вкладок. Отсутствие вкладок означает, что make интерпретирует команды как часть интерпретатора make файла на этапе анализа синтаксиса. Обратите внимание, что echo – это команда оболочки, которая make не понимает, поэтому я заменил ее на make $(info. ) что эквивалентно.

I was trying to build a make file to load a plugin from snap telemetry. when I was trying with the command sudo make build it is showing Makefile:21: *** recipe commences before first target. Stop. this error. In make file I added

Читайте также:  Как добавить видео на iphone через itunes

My make file looks like below when I do cat -e -t -v Makefile where ^I shows tab space and $ represents end of line

Where might be the problem. as per my knowledge I have given correct tab places..

1 Answer 1

A few things: First, make expects targets/recipe’s in the form of:

And it will run the recipes if and only if the target needs to be rebuilt. You don’t specify a target, but you do specify lines that start with tabs (recipes). Make is complaining that you have recipes without a target (as it should).

However, that being said, it does not appear as though you want your lines to be run as part of a recipe (it wouldn’t work anyways, as exported variables are not remembered from one recipe line to another, let alone between targets).

You likely want to do:

without any preceding tabs. The lack of tabs means that make will interpret the commands as part of the makefile interpreter in the make parsing stage. Notice that echo is a shell command, which make does not understand, so I replaced it with make’s $(info . ) which is equivalent.

In *.mak file I receive commands "commence before first target. Stop." I didn’t change it before.

How to solve this problem?

5 Answers 5

make (or NMAKE , or whatever flavour of make you are using) can be quite picky about the format of makefiles – check that you didn’t actually edit the file in any way, e.g. changed line endings, spaces tabs, etc.

This means that there is a line which starts with a space, tab, or some other whitespace without having a target in front of it.

Читайте также:  Asos скидка на день рождения

if you have added a new line, Make sure you have added next line syntax in previous line. typically if "" is missing in your previous line of changes, you will get this error.

It’s a simple Mistake while adding a new file you just have to make sure that is added to the file before and the new file remain as it is eg.

Комментировать
553 просмотров
Комментариев нет, будьте первым кто его оставит

Это интересно
Adblock
detector