xref: /linux/arch/powerpc/kernel/syscalls/Makefile (revision 14b3c9d24a7a5c274a9df27d245516f466d3bc5f)
1aff85039SFiroz Khan# SPDX-License-Identifier: GPL-2.0
2aff85039SFiroz Khankapi := arch/$(SRCARCH)/include/generated/asm
3aff85039SFiroz Khanuapi := arch/$(SRCARCH)/include/generated/uapi/asm
4aff85039SFiroz Khan
5aff85039SFiroz Khan_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
6aff85039SFiroz Khan	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7aff85039SFiroz Khan
829c5c3acSMasahiro Yamadasyscall := $(src)/syscall.tbl
9aff85039SFiroz Khansyshdr := $(srctree)/$(src)/syscallhdr.sh
10*14b3c9d2SMasahiro Yamadasystbl := $(srctree)/scripts/syscalltbl.sh
11aff85039SFiroz Khan
12aff85039SFiroz Khanquiet_cmd_syshdr = SYSHDR  $@
13aff85039SFiroz Khan      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'	\
14aff85039SFiroz Khan		   '$(syshdr_abis_$(basetarget))'		\
15aff85039SFiroz Khan		   '$(syshdr_pfx_$(basetarget))'		\
16aff85039SFiroz Khan		   '$(syshdr_offset_$(basetarget))'
17aff85039SFiroz Khan
18aff85039SFiroz Khanquiet_cmd_systbl = SYSTBL  $@
19*14b3c9d2SMasahiro Yamada      cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@
20aff85039SFiroz Khan
21aff85039SFiroz Khansyshdr_abis_unistd_32 := common,nospu,32
22865fa29fSMasahiro Yamada$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
23aff85039SFiroz Khan	$(call if_changed,syshdr)
24aff85039SFiroz Khan
25aff85039SFiroz Khansyshdr_abis_unistd_64 := common,nospu,64
26865fa29fSMasahiro Yamada$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
27aff85039SFiroz Khan	$(call if_changed,syshdr)
28aff85039SFiroz Khan
29*14b3c9d2SMasahiro Yamada$(kapi)/syscall_table_32.h: abis := common,nospu,32
30865fa29fSMasahiro Yamada$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
31aff85039SFiroz Khan	$(call if_changed,systbl)
32aff85039SFiroz Khan
33*14b3c9d2SMasahiro Yamada$(kapi)/syscall_table_64.h: abis := common,nospu,64
34865fa29fSMasahiro Yamada$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
35aff85039SFiroz Khan	$(call if_changed,systbl)
36aff85039SFiroz Khan
37*14b3c9d2SMasahiro Yamada$(kapi)/syscall_table_spu.h: abis := common,spu
38865fa29fSMasahiro Yamada$(kapi)/syscall_table_spu.h: $(syscall) $(systbl) FORCE
39aff85039SFiroz Khan	$(call if_changed,systbl)
40aff85039SFiroz Khan
41aff85039SFiroz Khanuapisyshdr-y		+= unistd_32.h unistd_64.h
42aff85039SFiroz Khankapisyshdr-y		+= syscall_table_32.h		\
43aff85039SFiroz Khan			   syscall_table_64.h		\
44aff85039SFiroz Khan			   syscall_table_spu.h
45aff85039SFiroz Khan
46865fa29fSMasahiro Yamadauapisyshdr-y	:= $(addprefix $(uapi)/, $(uapisyshdr-y))
47865fa29fSMasahiro Yamadakapisyshdr-y	:= $(addprefix $(kapi)/, $(kapisyshdr-y))
48865fa29fSMasahiro Yamadatargets		+= $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
49aff85039SFiroz Khan
50aff85039SFiroz KhanPHONY += all
51865fa29fSMasahiro Yamadaall: $(uapisyshdr-y) $(kapisyshdr-y)
52aff85039SFiroz Khan	@:
53