From the top...
make
compiles and links the kernel image. This is a single file named vmlinuz
.
make modules
compiles individual files for each question you answered M
during kernel config. The object code is linked against your freshly built kernel. (For questions answered Y
, these are already part of vmlinuz
, and for questions answered N
they are skipped).
make install
installs your built kernel to /vmlinuz
.
make modules_install
installs your kernel modules to /lib/modules
or /lib/modules/<version>
.
As for adding it to the list of available kernels, that's taken care of by the boot loader. It's different for each boot loader, but grub
is the most common on x86 and amd64 so I'll describe that. It's actually quite simple. Grub looks in /
, /boot
and /lib/modules
for any thing that looks like it might be a working kernel and adds it. And yes, this is an oversimplified description.
That extra "horrible stuff" in the Ubuntu documentation is extra stuff to create a deb
package. When you're doing it for more than yourself it's far better to package it. You'll switch in time.
Building the kernel and modules is kept separate because for the people who need to (i.e., kernel developers) they are often making changes to only a module. They can apply their changes, rebuild and install just the modules. This saves a lot of time when it has to be done 20 times a day. It will never be updated to have a single make everything
command. You instead, run make && make modules && make install && make modules_install
just like the documentation says to do. The build process favors kernel developers, not you. And that's the way it should be.
In reality there's almost no reason for anybody except kernel developers or distro packagers to compile a kernel. In almost any circumstance the kernel feature you want has already been built for you and is available in one of the pre-packaged kernels. There are exceptions, but they are exceedingly rare these days.
Not that I'm discouraging you from doing building your own kernel, I actually encourage you to do it. I think building your kernel from scratch is an invaluable practice for learning about how it all works down there. In part, because maybe one day you will be the exception that needs to. But it also teaches you a lot about the kernel & boot process in general. You will be a better person for having done it.
From make
manpage:
$@
is:
The file name of the target of the rule. If the target is an archive
member, then ‘$@’ is the name of the archive file. In a pattern rule
that has multiple targets (see Introduction to Pattern Rules), ‘$@’ is
the name of whichever target caused the rule's recipe to be run.
$<
is:
The name of the first prerequisite. If the target got its recipe from
an implicit rule, this will be the first prerequisite added by the
implicit rule.
You can see complete manual here.
Best Answer
$(1)
is the first argument to a GNU make “function”, which is a variable interpreted by thecall
function:This defines a function,
dataverse_download
, which downloads the datafile matching the DOI given as the first argument; thedownload_wget
target shows how to use this with the$(call)
function.