Skip to content

Commit

Permalink
uapi: export all arch specifics directories
Browse files Browse the repository at this point in the history
This patch removes the need of subdir-y. Now all files/directories under
arch/<arch>/include/uapi/ are exported.

The only change for userland is the layout of the command 'make
headers_install_all': directories asm-<arch> are replaced by arch-<arch>/.
Those new directories contains all files/directories of the specified arch.

Note that only cris and tile have more directories than only asm:
 - arch-v[10|32] for cris;
 - arch for tile.

Signed-off-by: Nicolas Dichtel <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
NicolasDichtel authored and masahir0y committed May 10, 2017
1 parent fcc8487 commit 61562f9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
15 changes: 1 addition & 14 deletions Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ This document describes the Linux kernel Makefiles.
--- 7.3 generic-y
--- 7.4 generated-y
--- 7.5 mandatory-y
--- 7.6 subdir-y

=== 8 Kbuild Variables
=== 9 Makefile language
Expand Down Expand Up @@ -1265,7 +1264,7 @@ The pre-processing does:
- drop all sections that are kernel internal (guarded by ifdef __KERNEL__)

All headers under include/uapi/, include/generated/uapi/,
arch/<arch>/include/uapi/asm/ and arch/<arch>/include/generated/uapi/asm/
arch/<arch>/include/uapi/ and arch/<arch>/include/generated/uapi/
are exported.

A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
Expand Down Expand Up @@ -1338,18 +1337,6 @@ See subsequent chapter for the syntax of the Kbuild file.
The convention is to list one subdir per line and
preferably in alphabetic order.

--- 7.6 subdir-y

subdir-y may be used to specify a subdirectory to be exported.

Example:
#arch/cris/include/uapi/asm/Kbuild
subdir-y += ../arch-v10/arch/
subdir-y += ../arch-v32/arch/

The convention is to list one subdir per line and
preferably in alphabetic order.

=== 8 Kbuild Variables

The top Makefile exports the following variables:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ firmware_install:
export INSTALL_HDR_PATH = $(objtree)/usr

# If we do an all arch process set dst to asm-$(hdr-arch)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/arch-$(hdr-arch), dst=include)

PHONY += archheaders
archheaders:
Expand All @@ -1149,7 +1149,7 @@ headers_install: __headers
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
$(error Headers not exportable for the $(SRCARCH) architecture))
$(Q)$(MAKE) $(hdr-inst)=include/uapi
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi $(hdr-dst)

PHONY += headers_check_all
headers_check_all: headers_install_all
Expand All @@ -1158,7 +1158,7 @@ headers_check_all: headers_install_all
PHONY += headers_check
headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/ $(hdr-dst) HDRCHECK=1

# ---------------------------------------------------------------------------
# Kernel selftest
Expand Down
3 changes: 0 additions & 3 deletions arch/cris/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

subdir-y += ../arch-v10/arch/
subdir-y += ../arch-v32/arch/
2 changes: 0 additions & 2 deletions arch/tile/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h

subdir-y += ../arch
3 changes: 1 addition & 2 deletions scripts/Makefile.headersinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Installing headers
#
# All headers under include/uapi, include/generated/uapi,
# arch/<arch>/include/uapi/asm and arch/<arch>/include/generated/uapi/asm are
# arch/<arch>/include/uapi and arch/<arch>/include/generated/uapi are
# exported.
# They are preprocessed to remove __KERNEL__ section of the file.
#
Expand Down Expand Up @@ -30,7 +30,6 @@ installdir := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst))
srcdir := $(srctree)/$(obj)
gendir := $(objtree)/$(gen)
subdirs := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/*/.))
subdirs += $(subdir-y)
header-files := $(notdir $(wildcard $(srcdir)/*.h))
header-files += $(notdir $(wildcard $(srcdir)/*.agh))
header-files := $(filter-out $(no-export-headers), $(header-files))
Expand Down

0 comments on commit 61562f9

Please sign in to comment.