The document discusses the structure and functions of the Linux kernel Makefile. It describes the top-level Makefile and how it builds the kernel image (vmlinux) and modules. It explains the roles of the .config file, architecture Makefiles, Script/Makefile and various Kbuild Makefiles. Key files like obj-y, obj-m and lib-y goals are identified. The document provides an overview of who develops different parts of the kernel build system and lists some important Kbuild files.
2. MakefileMakefile 의 구조의 구조
OverviewOverview
Who does whatWho does what
Important check kbuild filesImportant check kbuild files
Observe Makefiles sourceObserve Makefiles source
4. Top makefileTop makefile
The top makefile reads the .config fileThe top makefile reads the .config file
Two major product :Two major product :
Vmlinux(the resident kernel image)Vmlinux(the resident kernel image)
Modules(any module files)Modules(any module files)
5. .config & arch makefile.config & arch makefile
.config file.config file
From kernel configuration processFrom kernel configuration process
Get list of subderectoriesGet list of subderectories
Arch makefileArch makefile
Supplies architecture specific informationSupplies architecture specific information
6. Script & kbuild makefileScript & kbuild makefile
Script makefileScript makefile
Contains all the definitions/rules etcContains all the definitions/rules etc
Kbuild makefileKbuild makefile
Build any built-in or modular targetsBuild any built-in or modular targets
Uses from the .config fileUses from the .config file
7. Who does whatWho does what
Users : people(build kernels)Users : people(build kernels)
Normal developersNormal developers
Make features(device drivers, file systems,Make features(device drivers, file systems,
network protocols)network protocols)
Arch developersArch developers
Make entire architecture(sparc or ia64..etc)Make entire architecture(sparc or ia64..etc)
Kbuild developersKbuild developers
Make kernel build system itselfMake kernel build system itself
8. Check important kbuild filesCheck important kbuild files
Goal definitionsGoal definitions
Contain files to built, compilation options,Contain files to built, compilation options,
and any subdirectories..etcand any subdirectories..etc
Built-in object goals(obj-y)Built-in object goals(obj-y)
Object file to compileObject file to compile
Loadable module goals(obj-m)Loadable module goals(obj-m)
Library file goals(lib-y)Library file goals(lib-y)
Library to built-in object files for modulesLibrary to built-in object files for modules
and combineand combine