071157d230
[ Upstream commit 0708967e2d56e370231fd07defa0d69f9ad125e8 ] Building the kernel with ARCH=s390 creates a weird arch/arch/ directory. $ find arch/arch arch/arch arch/arch/s390 arch/arch/s390/include arch/arch/s390/include/generated arch/arch/s390/include/generated/asm arch/arch/s390/include/generated/uapi arch/arch/s390/include/generated/uapi/asm The root cause is 'targets' in arch/s390/kernel/syscalls/Makefile, where the relative path is incorrect. Strictly speaking, 'targets' was not necessary in the first place because this Makefile uses 'filechk' instead of 'if_changed'. However, this commit keeps it, as it will be useful when converting 'filechk' to 'if_changed' later. Fixes: 5c75824d915e ("s390/syscalls: add Makefile to generate system call header files") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20241111134603.2063226-1-masahiroy@kernel.org Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
46 lines
1.2 KiB
Makefile
Executable file
46 lines
1.2 KiB
Makefile
Executable file
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
gen := arch/$(ARCH)/include/generated
|
|
kapi := $(gen)/asm
|
|
uapi := $(gen)/uapi/asm
|
|
|
|
syscall := $(srctree)/$(src)/syscall.tbl
|
|
systbl := $(srctree)/$(src)/syscalltbl
|
|
|
|
gen-y := $(kapi)/syscall_table.h
|
|
kapi-hdrs-y := $(kapi)/unistd_nr.h
|
|
uapi-hdrs-y := $(uapi)/unistd_32.h
|
|
uapi-hdrs-y += $(uapi)/unistd_64.h
|
|
|
|
targets += $(addprefix ../../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
|
|
|
|
PHONY += kapi uapi
|
|
|
|
kapi: $(gen-y) $(kapi-hdrs-y)
|
|
uapi: $(uapi-hdrs-y)
|
|
|
|
|
|
# Create output directory if not already present
|
|
_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
|
|
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
|
|
|
|
filechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
|
|
|
|
filechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
|
|
|
|
filechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $<
|
|
|
|
syshdr_abi_unistd_32 := common,32
|
|
$(uapi)/unistd_32.h: $(syscall) FORCE
|
|
$(call filechk,syshdr,$@)
|
|
|
|
syshdr_abi_unistd_64 := common,64
|
|
$(uapi)/unistd_64.h: $(syscall) FORCE
|
|
$(call filechk,syshdr,$@)
|
|
|
|
$(kapi)/syscall_table.h: $(syscall) FORCE
|
|
$(call filechk,syscalls)
|
|
|
|
sysnr_abi_unistd_nr := common,32,64
|
|
$(kapi)/unistd_nr.h: $(syscall) FORCE
|
|
$(call filechk,sysnr)
|