1 # SPDX-License-Identifier: GPL-2.0
3 gen
:= arch
/$(ARCH
)/include/generated
5 uapi
:= $(gen
)/uapi
/asm
7 syscall
:= $(srctree
)/$(src
)/syscall.tbl
8 systbl
:= $(srctree
)/$(src
)/syscalltbl
10 gen-y
:= $(kapi
)/syscall_table.h
11 kapi-hdrs-y
:= $(kapi
)/unistd_nr.h
12 uapi-hdrs-y
:= $(uapi
)/unistd_32.h
13 uapi-hdrs-y
+= $(uapi
)/unistd_64.h
15 targets
+= $(addprefix ..
/..
/..
/,$(gen-y
) $(kapi-hdrs-y
) $(uapi-hdrs-y
))
19 kapi
: $(gen-y
) $(kapi-hdrs-y
)
23 # Create output directory if not already present
24 _dummy
:= $(shell [ -d
'$(uapi)' ] || mkdir
-p
'$(uapi)') \
25 $(shell [ -d
'$(kapi)' ] || mkdir
-p
'$(kapi)')
28 $(CONFIG_SHELL
) '$(systbl)' -H
-a
$(syshdr_abi_
$(basetarget
)) -f
"$2" < $<
32 $(CONFIG_SHELL
) '$(systbl)' -N
-a
$(sysnr_abi_
$(basetarget
)) < $<
35 define filechk_syscalls
36 $(CONFIG_SHELL
) '$(systbl)' -S
< $<
39 syshdr_abi_unistd_32
:= common
,32
40 $(uapi
)/unistd_32.h
: $(syscall
) FORCE
41 $(call filechk
,syshdr
,$@
)
43 syshdr_abi_unistd_64
:= common
,64
44 $(uapi
)/unistd_64.h
: $(syscall
) FORCE
45 $(call filechk
,syshdr
,$@
)
47 $(kapi
)/syscall_table.h
: $(syscall
) FORCE
48 $(call filechk
,syscalls
)
50 sysnr_abi_unistd_nr
:= common
,32,64
51 $(kapi
)/unistd_nr.h
: $(syscall
) FORCE