xref: /linux/arch/sh/kernel/syscalls/Makefile (revision 865fa29f7dd1b6af8498fe08f19b4028c1c8a153)
1a0239c8eSFiroz Khan# SPDX-License-Identifier: GPL-2.0
2a0239c8eSFiroz Khankapi := arch/$(SRCARCH)/include/generated/asm
3a0239c8eSFiroz Khanuapi := arch/$(SRCARCH)/include/generated/uapi/asm
4a0239c8eSFiroz Khan
5a0239c8eSFiroz Khan_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
6a0239c8eSFiroz Khan	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7a0239c8eSFiroz Khan
8a0239c8eSFiroz Khansyscall := $(srctree)/$(src)/syscall.tbl
9a0239c8eSFiroz Khansyshdr := $(srctree)/$(src)/syscallhdr.sh
10a0239c8eSFiroz Khansystbl := $(srctree)/$(src)/syscalltbl.sh
11a0239c8eSFiroz Khan
12a0239c8eSFiroz Khanquiet_cmd_syshdr = SYSHDR  $@
13a0239c8eSFiroz Khan      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'	\
14a0239c8eSFiroz Khan		   '$(syshdr_abis_$(basetarget))'		\
15a0239c8eSFiroz Khan		   '$(syshdr_pfx_$(basetarget))'		\
16a0239c8eSFiroz Khan		   '$(syshdr_offset_$(basetarget))'
17a0239c8eSFiroz Khan
18a0239c8eSFiroz Khanquiet_cmd_systbl = SYSTBL  $@
19a0239c8eSFiroz Khan      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'	\
20a0239c8eSFiroz Khan		   '$(systbl_abis_$(basetarget))'		\
21a0239c8eSFiroz Khan		   '$(systbl_abi_$(basetarget))'		\
22a0239c8eSFiroz Khan		   '$(systbl_offset_$(basetarget))'
23a0239c8eSFiroz Khan
24*865fa29fSMasahiro Yamada$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
25a0239c8eSFiroz Khan	$(call if_changed,syshdr)
26a0239c8eSFiroz Khan
27*865fa29fSMasahiro Yamada$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
28a0239c8eSFiroz Khan	$(call if_changed,systbl)
29a0239c8eSFiroz Khan
30a0239c8eSFiroz Khanuapisyshdr-y		+= unistd_32.h
31a0239c8eSFiroz Khankapisyshdr-y		+= syscall_table.h
32a0239c8eSFiroz Khan
33*865fa29fSMasahiro Yamadauapisyshdr-y	:= $(addprefix $(uapi)/, $(uapisyshdr-y))
34*865fa29fSMasahiro Yamadakapisyshdr-y	:= $(addprefix $(kapi)/, $(kapisyshdr-y))
35*865fa29fSMasahiro Yamadatargets		+= $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
36a0239c8eSFiroz Khan
37a0239c8eSFiroz KhanPHONY += all
38*865fa29fSMasahiro Yamadaall: $(uapisyshdr-y) $(kapisyshdr-y)
39a0239c8eSFiroz Khan	@:
40