Questions tagged [kbuild]

kbuild is the build system used by the Linux kernel.

kbuild is a build framework based on GNU make and a standard set of cross platform tools. It was originally developed for the Linux Kernel, but is now used in other projects such as crosstool-ng, buildroot, ltib, etc.

kbuild is extremely powerful and tries to hide most of its complexity in templates so that the actual makefiles are relatively easy to understand and write. There are two distinct parts of kbuild; A set of tools and languages for describing configuration variables and Gnu make template code to drive the actual build process.

There are stock documentation for different topics,

The Gnu make harness for the Linux kernel is in the main Makefile and Kbuild.include. The tools for configuring variable (and processing the Kconfig language) are in a kconfig directory. Obviously other projects such as buildroot, and crosstool-ng use modified versions.

The two aspects are found in files within the kernel source. They are a Kconfig file defining variables that can be defined by the tools. The second portion is a Makefile, which uses the Kconfig output (usually .config) to guide the build process through normal Gnu make rules, templates and macros.

144 questions
0
votes
1 answer

How to add kernel args when compiling linux kernel?

I followed intructions in this project, but I couldn't figure out how to add "console=ttyAMA0,115200 panic=5" to kernel args. Anyone knows how to add this kernel args?
Tgn Yang
  • 330
  • 3
  • 16
0
votes
0 answers

How does make config command work

In an effort to understand the configuration tools of the make build environment, I like to ask given the following config parameters: make VARIANT_DEFCONFIG=msm8974_sec_hlte_spr_defconfig msm8974_sec_defconfig…
user3326293
  • 817
  • 1
  • 14
  • 37
0
votes
1 answer

Proper makefile setup for external kernel modules

I'm writing a character driver to sit on top of a modified version of ahci in the source tree. I basically have something that looks like this: topdir | |- Makfile | |- mod_ahci | | - Makefile, codefiles | |-…
Andrew Falanga
  • 2,274
  • 4
  • 26
  • 51
0
votes
1 answer

Linux module makefile compilation error

I have the following makefile: 1 MODULES_DIR := /lib/modules/$(shell uname -r) 2 KERNEL_DIR := ${MODULES_DIR}/build 3 4 obj-m += module.o 5 6 all: 7 make −C $(KERNEL_DIR) M=$(PWD) modules; 8 clean: 9 make −C /lib/modules/$(shell…
user1231049
0
votes
1 answer

Kconfig, macro and undefined macro warnings

I am adding a multiple choice style configuration to a Kconfig in Linux kernel. Depending on the user's choice, it defines a macro. Once it is configured, the kernel driver source code has #ifdef block where it checks and uses the macro to compile.…
Adam Lee
  • 2,983
  • 7
  • 35
  • 47
0
votes
1 answer

Can Kconfig language install on mac OS

I have to do a project by using Kconfig but it seems this stuff can just work on Mac OS. I don't know if there is a tool that install Kconfig on MAC OS.
wzf1943
  • 121
  • 1
  • 9
0
votes
2 answers

Adding userspace header files to make file

I am building a linux device using make and i need to use string.h in my device. I tried to add /usr/include to make file but it does not work. can any one help me on adding another include path to make file. my make file is KBUILD_CFLAGS +=…
user2714949
  • 399
  • 2
  • 3
  • 11
0
votes
4 answers

How to create a header file in a large C code base?

I know how to write .h files and include guards. I want to write a new bar123.h file that contains global variables. Assume that bar123.c does not exist. Other header files e.g. bar.h would include bar123.h, to make the global variables visible to…
tech
  • 107
  • 5
0
votes
1 answer

Kbuild - including source file from external directory

I have some source code which I want to use for both a kernel module and in a user-space program. I'd like to only maintain a single copy of that code within my source tree. I was thinking of putting the shared source files in a shared folder…
John
  • 3,400
  • 3
  • 31
  • 47
1 2 3
9
10