Я больше не могу запускать Makefile. Я получаю:
./Makefile: line 1: sorter:: command not found
Содержимое Makefile:
sorter: sorter.o
gcc sorter.o -o sorter
sorter.o: sorter.c
gcc -c sorter.c
test:
./run_test
check:
c_style_check sorter.c
clean:
rm -f sorter *.o
Что удивительно, так это то, что все мои файлы Makefile были использованы только вчера. Я не знаю, что случилось, я думаю, что у моего Lubuntu было обновление, но это все.
Ошибка возникает из-за того, что вы ожидаете, что ваша оболочка будет понимать и запускать файл.
Makefiles не предназначены для исполнения - они приводятся в качестве входных данных для команды make, например. make -f Makefile - или просто make, так как он будет искать текущий каталог для файла с именами по умолчанию, такими как Makefile, makefile.
Из man make:
To prepare to use make, you must write a file called the makefile that
describes the relationships among files in your program, and the states
the commands for updating each file. In a program, typically the exe‐
cutable file is updated from object files, which are in turn made by
compiling source files.
Once a suitable makefile exists, each time you change some source
files, this simple shell command:
make
suffices to perform all necessary recompilations. The make program
uses the makefile description and the last-modification times of the
files to decide which of the files need to be updated. For each of
those files, it issues the commands recorded in the makefile.
make executes commands in the makefile to update one or more target
names, where name is typically a program. If no -f option is present,
make will look for the makefiles GNUmakefile, makefile, and Makefile,
in that order.
Ошибка возникает из-за того, что вы ожидаете, что ваша оболочка будет понимать и запускать файл.
Makefiles не предназначены для исполнения - они приводятся в качестве входных данных для команды make, например. make -f Makefile - или просто make, так как он будет искать текущий каталог для файла с именами по умолчанию, такими как Makefile, makefile.
Из man make:
To prepare to use make, you must write a file called the makefile that
describes the relationships among files in your program, and the states
the commands for updating each file. In a program, typically the exe‐
cutable file is updated from object files, which are in turn made by
compiling source files.
Once a suitable makefile exists, each time you change some source
files, this simple shell command:
make
suffices to perform all necessary recompilations. The make program
uses the makefile description and the last-modification times of the
files to decide which of the files need to be updated. For each of
those files, it issues the commands recorded in the makefile.
make executes commands in the makefile to update one or more target
names, where name is typically a program. If no -f option is present,
make will look for the makefiles GNUmakefile, makefile, and Makefile,
in that order.
Ошибка возникает из-за того, что вы ожидаете, что ваша оболочка будет понимать и запускать файл.
Makefiles не предназначены для исполнения - они приводятся в качестве входных данных для команды make, например. make -f Makefile - или просто make, так как он будет искать текущий каталог для файла с именами по умолчанию, такими как Makefile, makefile.
Из man make:
To prepare to use make, you must write a file called the makefile that
describes the relationships among files in your program, and the states
the commands for updating each file. In a program, typically the exe‐
cutable file is updated from object files, which are in turn made by
compiling source files.
Once a suitable makefile exists, each time you change some source
files, this simple shell command:
make
suffices to perform all necessary recompilations. The make program
uses the makefile description and the last-modification times of the
files to decide which of the files need to be updated. For each of
those files, it issues the commands recorded in the makefile.
make executes commands in the makefile to update one or more target
names, where name is typically a program. If no -f option is present,
make will look for the makefiles GNUmakefile, makefile, and Makefile,
in that order.