1
00:00:00,005 --> 00:00:01,004
- [Instructor] We do a lot with the

2
00:00:01,004 --> 00:00:05,003
kernel source code using Make.

3
00:00:05,003 --> 00:00:08,005
So the kernel Makefile is an important

4
00:00:08,005 --> 00:00:13,005
file to use and know something about.

5
00:00:13,005 --> 00:00:16,007
So one thing you can do is do make help

6
00:00:16,007 --> 00:00:18,006
and that will give you quite a bit

7
00:00:18,006 --> 00:00:21,005
of information about the sort of things you can make.

8
00:00:21,005 --> 00:00:25,003
You can make menuconfig or make xconfig,

9
00:00:25,003 --> 00:00:28,001
and later on we'll configure a kernel,

10
00:00:28,001 --> 00:00:31,006
but in the top-level kernel directory,

11
00:00:31,006 --> 00:00:35,002
if you do a config, you'll get a file called .config

12
00:00:35,002 --> 00:00:36,002
and that's a text file.

13
00:00:36,002 --> 00:00:37,009
You can read it, you can grip it and all that.

14
00:00:37,009 --> 00:00:40,009
And that's all the configuration choices.

15
00:00:40,009 --> 00:00:42,002
That's a really nice thing.

16
00:00:42,002 --> 00:00:44,008
You can make a copy of that.

17
00:00:44,008 --> 00:00:47,000
You can give that to other people.

18
00:00:47,000 --> 00:00:50,001
There may even be a copy for your kernel

19
00:00:50,001 --> 00:00:51,002
in your boot directory

20
00:00:51,002 --> 00:00:54,005
with a name like config dash kernel version,

21
00:00:54,005 --> 00:00:59,001
so you can figure out how your kernel was configured.

22
00:00:59,001 --> 00:01:03,005
Also, other things you can make are things like bzImage,

23
00:01:03,005 --> 00:01:08,002
modules, modules_install, install, clean.

24
00:01:08,002 --> 00:01:11,000
So some of these compile things, some of these copy things,

25
00:01:11,000 --> 00:01:13,008
some of these delete things.

26
00:01:13,008 --> 00:01:17,007
Right? There's a lot you could do with a kernel Makefile.

27
00:01:17,007 --> 00:01:21,003
Also, in the Makefile should be variable set

28
00:01:21,003 --> 00:01:22,005
like version information.

29
00:01:22,005 --> 00:01:24,008
So at the very top of it you should see things like

30
00:01:24,008 --> 00:01:27,002
the version and the patchlevel set

31
00:01:27,002 --> 00:01:31,002
and the cool name that they've given that version.

32
00:01:31,002 --> 00:01:33,001
I like make help.

33
00:01:33,001 --> 00:01:35,006
So, I think you ought to do it.

34
00:01:35,006 --> 00:01:38,009
You'll see stuff you can use for cleaning

35
00:01:38,009 --> 00:01:41,006
and tell you the difference between clean, and mrproper,

36
00:01:41,006 --> 00:01:44,009
and distclean, for example.

37
00:01:44,009 --> 00:01:48,003
And ways you can configure the kernel.

38
00:01:48,003 --> 00:01:51,004
Kind of the classic interface for configuring the kernel

39
00:01:51,004 --> 00:01:53,009
is make menuconfig,

40
00:01:53,009 --> 00:01:56,006
but there's other choices there.

41
00:01:56,006 --> 00:01:58,005
And then, building stuff.

42
00:01:58,005 --> 00:02:00,001
If you say build all,

43
00:02:00,001 --> 00:02:03,000
it'll build everything that's marked with an asterisk.

44
00:02:03,000 --> 00:02:05,004
For example, vmlinux.

45
00:02:05,004 --> 00:02:09,000
So that's a uncompressed object file.

46
00:02:09,000 --> 00:02:11,005
That's the kernel.

47
00:02:11,005 --> 00:02:16,002
BzImage is that vmlinux compressed

48
00:02:16,002 --> 00:02:19,008
and put some extra information in it.

49
00:02:19,008 --> 00:02:24,006
Make modules, builds all the loadable kernel modules

50
00:02:24,006 --> 00:02:26,009
that were configured.

51
00:02:26,009 --> 00:02:30,006
That's actually probably quite a bit to do.

52
00:02:30,006 --> 00:02:33,007
Module install will install those modules

53
00:02:33,007 --> 00:02:37,004
into the standard place on your system

54
00:02:37,004 --> 00:02:40,001
or you can tell it where to install them

55
00:02:40,001 --> 00:02:43,002
if you want to give it another path.

56
00:02:43,002 --> 00:02:46,008
Install, installs the kernel.

57
00:02:46,008 --> 00:02:48,009
So if you're building for your system

58
00:02:48,009 --> 00:02:50,000
do a module install,

59
00:02:50,000 --> 00:02:51,008
or install might be handy.

60
00:02:51,008 --> 00:02:53,008
When you're just building,

61
00:02:53,008 --> 00:02:58,004
doing a make all is probably what you want to do.

62
00:02:58,004 --> 00:03:01,000
All right, we'll be doing some of that later.

