scripts/Makefile.asm-headers
Source file repositories/reference/linux-study-clean/scripts/Makefile.asm-headers
File Facts
- System
- Linux kernel
- Corpus path
scripts/Makefile.asm-headers- Extension
.asm-headers- Size
- 3459 bytes
- Lines
- 107
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: build/configuration rule
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
# SPDX-License-Identifier: GPL-2.0
# include/asm-generic contains a lot of files that are used
# verbatim by several architectures.
#
# This Makefile generates arch/$(SRCARCH)/include/generated/(uapi/)/asm
# headers from multiple sources:
# - a small wrapper to include the corresponding asm-generic/*.h
# is generated for each file listed as generic-y
# - uapi/asm/unistd_*.h files listed as syscalls-y are generated from
# syscall.tbl with the __NR_* macros
# - Corresponding asm/syscall_table_*.h are generated from the same input
PHONY := all
all:
src := $(srctree)/$(subst /generated,,$(obj))
syscall_abis_32 += common,32
syscall_abis_64 += common,64
syscalltbl := $(srctree)/scripts/syscall.tbl
syshdr-args := --emit-nr
# let architectures override $(syscall_abis_%) and $(syscalltbl)
-include $(srctree)/arch/$(SRCARCH)/kernel/Makefile.syscalls
include $(srctree)/scripts/Kbuild.include
-include $(kbuild-file)
syshdr := $(srctree)/scripts/syscallhdr.sh
systbl := $(srctree)/scripts/syscalltbl.sh
# $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case.
ifneq ($(SRCARCH),um)
include $(srctree)/$(generic)/Kbuild
endif
redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
redundant += $(foreach f, $(generic-y), $(if $(wildcard $(src)/$(f)),$(f)))
redundant := $(sort $(redundant))
$(if $(redundant),\
$(warning redundant generic-y found in $(src)/Kbuild: $(redundant)))
# If arch does not implement mandatory headers, fallback to asm-generic ones.
mandatory-y := $(filter-out $(generated-y), $(mandatory-y))
generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(src)/$(f)),,$(f)))
generic-y := $(addprefix $(obj)/, $(generic-y))
syscall-y := $(addprefix $(obj)/, $(syscall-y))
generated-y := $(addprefix $(obj)/, $(generated-y))
# Remove stale wrappers when the corresponding files are removed from generic-y
old-headers := $(wildcard $(obj)/*.h)
unwanted := $(filter-out $(generic-y) $(generated-y) $(syscall-y),$(old-headers))
quiet_cmd_wrap = WRAP $@
cmd_wrap = echo "\#include <asm-generic/$*.h>" > $@
quiet_cmd_remove = REMOVE $(unwanted)
cmd_remove = rm -f $(unwanted)
quiet_cmd_syshdr = SYSHDR $@
cmd_syshdr = $(CONFIG_SHELL) $(syshdr) \
$(if $(syshdr-args-$*),$(syshdr-args-$*),$(syshdr-args)) \
$(if $(syscall_compat),--prefix "compat$*_") \
--abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
$< $@
quiet_cmd_systbl = SYSTBL $@
cmd_systbl = $(CONFIG_SHELL) $(systbl) \
$(if $(systbl-args-$*),$(systbl-args-$*),$(systbl-args)) \
--abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
Annotation
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.