But I don’t understand how to read it. And how to use it.
For example, in -f what does --file=file means. And what do I do with it? What do I do with --makefile=FILE.
all:
echo "Hello I am all."
build:
echo "Hello I am build."
IMPORTANT POINT! The 8 spaces I have here on the lines after build: and all: are actually 1 single TAB character. Don’t just copy paste this, write it with a text editor that puts a tab in there.
Now do this:
make
make all
make build
That’s basic Makefile. You can put multiple commands under each colon target all: and build:.
Thank you guys.
My question was more about how to read the man page.
So in the -f line we have:
-f file (which is a command. I tried it out and it works)
–file=file ( what is this? how do I use it?)
–makefile=FILE (and what is this? and why FILE and not file?) @io_io
If you want to use a nonstandard name for your makefile, you can specify the makefile name with the -f' or–file’ option. The arguments -f name' or–file=name’ tell make to read the file name as the makefile. If you use more than one -f' or–file’ option, you can specify several makefiles. All the makefiles are effectively concatenated in the order specified. The default makefile names GNUmakefile',makefile’ and Makefile' are not checked automatically if you specify-f’ or `–file’.
So, if you just use a makefile named makefile or Makefile, you will never have to use those commands you find confusing.