Skip to content

Commit

Permalink
kbuild: Update documentation of clean-files and clean-dirs
Browse files Browse the repository at this point in the history
Commit a16c5f9 (kbuild: Fix removal of the debian/ directory) slightly
changed the processing of the clean-files and clean-dirs variables.
Also, use a current real-world example of clean-files usage.

Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
michal42 committed Jan 8, 2015
1 parent d9f711d commit 9765918
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,22 +751,21 @@ generated by kbuild are deleted all over the kernel src tree when
Additional files can be specified in kbuild makefiles by use of $(clean-files).

Example:
#drivers/pci/Makefile
clean-files := devlist.h classlist.h
#lib/Makefile
clean-files := crc32table.h

When executing "make clean", the two files "devlist.h classlist.h" will be
deleted. Kbuild will assume files to be in the same relative directory as the
Makefile except if an absolute path is specified (path starting with '/').
Makefile, except if prefixed with $(objtree).

To delete a directory hierarchy use:

Example:
#scripts/package/Makefile
clean-dirs := $(objtree)/debian/

This will delete the directory debian, including all subdirectories.
Kbuild will assume the directories to be in the same relative path as the
Makefile if no absolute path is specified (path does not start with '/').
This will delete the directory debian in the toplevel directory, including all
subdirectories.

To exclude certain files from make clean, use the $(no-clean-files) variable.
This is only a special case used in the top level Kbuild file:
Expand Down

0 comments on commit 9765918

Please sign in to comment.