xref: /linux/arch/powerpc/kernel/syscalls/Makefile (revision aff8503932004d10eec4d550ec3527117fe18724)
1*aff85039SFiroz Khan# SPDX-License-Identifier: GPL-2.0
2*aff85039SFiroz Khankapi := arch/$(SRCARCH)/include/generated/asm
3*aff85039SFiroz Khanuapi := arch/$(SRCARCH)/include/generated/uapi/asm
4*aff85039SFiroz Khan
5*aff85039SFiroz Khan_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
6*aff85039SFiroz Khan	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7*aff85039SFiroz Khan
8*aff85039SFiroz Khansyscall := $(srctree)/$(src)/syscall.tbl
9*aff85039SFiroz Khansyshdr := $(srctree)/$(src)/syscallhdr.sh
10*aff85039SFiroz Khansystbl := $(srctree)/$(src)/syscalltbl.sh
11*aff85039SFiroz Khan
12*aff85039SFiroz Khanquiet_cmd_syshdr = SYSHDR  $@
13*aff85039SFiroz Khan      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'	\
14*aff85039SFiroz Khan		   '$(syshdr_abis_$(basetarget))'		\
15*aff85039SFiroz Khan		   '$(syshdr_pfx_$(basetarget))'		\
16*aff85039SFiroz Khan		   '$(syshdr_offset_$(basetarget))'
17*aff85039SFiroz Khan
18*aff85039SFiroz Khanquiet_cmd_systbl = SYSTBL  $@
19*aff85039SFiroz Khan      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'	\
20*aff85039SFiroz Khan		   '$(systbl_abis_$(basetarget))'		\
21*aff85039SFiroz Khan		   '$(systbl_abi_$(basetarget))'		\
22*aff85039SFiroz Khan		   '$(systbl_offset_$(basetarget))'
23*aff85039SFiroz Khan
24*aff85039SFiroz Khansyshdr_abis_unistd_32 := common,nospu,32
25*aff85039SFiroz Khan$(uapi)/unistd_32.h: $(syscall) $(syshdr)
26*aff85039SFiroz Khan	$(call if_changed,syshdr)
27*aff85039SFiroz Khan
28*aff85039SFiroz Khansyshdr_abis_unistd_64 := common,nospu,64
29*aff85039SFiroz Khan$(uapi)/unistd_64.h: $(syscall) $(syshdr)
30*aff85039SFiroz Khan	$(call if_changed,syshdr)
31*aff85039SFiroz Khan
32*aff85039SFiroz Khansystbl_abis_syscall_table_32 := common,nospu,32
33*aff85039SFiroz Khansystbl_abi_syscall_table_32 := 32
34*aff85039SFiroz Khan$(kapi)/syscall_table_32.h: $(syscall) $(systbl)
35*aff85039SFiroz Khan	$(call if_changed,systbl)
36*aff85039SFiroz Khan
37*aff85039SFiroz Khansystbl_abis_syscall_table_64 := common,nospu,64
38*aff85039SFiroz Khansystbl_abi_syscall_table_64 := 64
39*aff85039SFiroz Khan$(kapi)/syscall_table_64.h: $(syscall) $(systbl)
40*aff85039SFiroz Khan	$(call if_changed,systbl)
41*aff85039SFiroz Khan
42*aff85039SFiroz Khansystbl_abis_syscall_table_c32 := common,nospu,32
43*aff85039SFiroz Khansystbl_abi_syscall_table_c32 := c32
44*aff85039SFiroz Khan$(kapi)/syscall_table_c32.h: $(syscall) $(systbl)
45*aff85039SFiroz Khan	$(call if_changed,systbl)
46*aff85039SFiroz Khan
47*aff85039SFiroz Khansystbl_abis_syscall_table_spu := common,spu
48*aff85039SFiroz Khansystbl_abi_syscall_table_spu := spu
49*aff85039SFiroz Khan$(kapi)/syscall_table_spu.h: $(syscall) $(systbl)
50*aff85039SFiroz Khan	$(call if_changed,systbl)
51*aff85039SFiroz Khan
52*aff85039SFiroz Khanuapisyshdr-y		+= unistd_32.h unistd_64.h
53*aff85039SFiroz Khankapisyshdr-y		+= syscall_table_32.h		\
54*aff85039SFiroz Khan			   syscall_table_64.h		\
55*aff85039SFiroz Khan			   syscall_table_c32.h		\
56*aff85039SFiroz Khan			   syscall_table_spu.h
57*aff85039SFiroz Khan
58*aff85039SFiroz Khantargets	+= $(uapisyshdr-y) $(kapisyshdr-y)
59*aff85039SFiroz Khan
60*aff85039SFiroz KhanPHONY += all
61*aff85039SFiroz Khanall: $(addprefix $(uapi)/,$(uapisyshdr-y))
62*aff85039SFiroz Khanall: $(addprefix $(kapi)/,$(kapisyshdr-y))
63*aff85039SFiroz Khan	@:
64