1 # SPDX-License-Identifier: GPL-2.0
2 out
:= arch
/$(SRCARCH
)/include/generated
/asm
3 uapi
:= arch
/$(SRCARCH
)/include/generated
/uapi
/asm
5 # Create output directory if not already present
6 _dummy
:= $(shell [ -d
'$(out)' ] || mkdir
-p
'$(out)') \
7 $(shell [ -d
'$(uapi)' ] || mkdir
-p
'$(uapi)')
9 syscall32
:= $(srctree
)/$(src
)/syscall_32.tbl
10 syscall64
:= $(srctree
)/$(src
)/syscall_64.tbl
12 syshdr
:= $(srctree
)/$(src
)/syscallhdr.sh
13 systbl
:= $(srctree
)/$(src
)/syscalltbl.sh
15 quiet_cmd_syshdr
= SYSHDR
$@
16 cmd_syshdr
= $(CONFIG_SHELL
) '$(syshdr)' '$<' '$@' \
17 '$(syshdr_abi_$(basetarget))' \
18 '$(syshdr_pfx_$(basetarget))' \
19 '$(syshdr_offset_$(basetarget))'
20 quiet_cmd_systbl
= SYSTBL
$@
21 cmd_systbl
= $(CONFIG_SHELL
) '$(systbl)' $< $@
23 quiet_cmd_hypercalls
= HYPERCALLS
$@
24 cmd_hypercalls
= $(CONFIG_SHELL
) '$<' $@
$(filter-out $<,$^
)
26 syshdr_abi_unistd_32
:= i386
27 $(uapi
)/unistd_32.h
: $(syscall32
) $(syshdr
)
28 $(call if_changed
,syshdr
)
30 syshdr_abi_unistd_32_ia32
:= i386
31 syshdr_pfx_unistd_32_ia32
:= ia32_
32 $(out
)/unistd_32_ia32.h
: $(syscall32
) $(syshdr
)
33 $(call if_changed
,syshdr
)
35 syshdr_abi_unistd_x32
:= common
,x32
36 syshdr_offset_unistd_x32
:= __X32_SYSCALL_BIT
37 $(uapi
)/unistd_x32.h
: $(syscall64
) $(syshdr
)
38 $(call if_changed
,syshdr
)
40 syshdr_abi_unistd_64
:= common
,64
41 $(uapi
)/unistd_64.h
: $(syscall64
) $(syshdr
)
42 $(call if_changed
,syshdr
)
44 syshdr_abi_unistd_64_x32
:= x32
45 syshdr_pfx_unistd_64_x32
:= x32_
46 $(out
)/unistd_64_x32.h
: $(syscall64
) $(syshdr
)
47 $(call if_changed
,syshdr
)
49 $(out
)/syscalls_32.h
: $(syscall32
) $(systbl
)
50 $(call if_changed
,systbl
)
51 $(out
)/syscalls_64.h
: $(syscall64
) $(systbl
)
52 $(call if_changed
,systbl
)
54 $(out
)/xen-hypercalls.h
: $(srctree
)/scripts
/xen-hypercalls.sh
55 $(call if_changed
,hypercalls
)
57 $(out
)/xen-hypercalls.h
: $(srctree
)/include/xen
/interface
/xen
*.h
59 uapisyshdr-y
+= unistd_32.h unistd_64.h unistd_x32.h
60 syshdr-y
+= syscalls_32.h
61 syshdr-
$(CONFIG_X86_64
) += unistd_32_ia32.h unistd_64_x32.h
62 syshdr-
$(CONFIG_X86_64
) += syscalls_64.h
63 syshdr-
$(CONFIG_XEN
) += xen-hypercalls.h
65 targets
+= $(uapisyshdr-y
) $(syshdr-y
)
68 all: $(addprefix $(uapi
)/,$(uapisyshdr-y
))
69 all: $(addprefix $(out
)/,$(syshdr-y
))