blob: f325af26107c2fde096fe2961d3579e2f3b78e91 [file] [log] [blame]
H. Peter Anvind1817642011-11-11 15:55:49 -08001out := $(obj)/../include/generated/asm
David Howells10b63952012-10-02 18:01:57 +01002uapi := $(obj)/../include/generated/uapi/asm
H. Peter Anvind1817642011-11-11 15:55:49 -08003
4# Create output directory if not already present
David Howellsec28b7f2012-10-02 18:01:56 +01005_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
6 $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
H. Peter Anvind1817642011-11-11 15:55:49 -08007
8syscall32 := $(srctree)/$(src)/syscall_32.tbl
9syscall64 := $(srctree)/$(src)/syscall_64.tbl
10
11syshdr := $(srctree)/$(src)/syscallhdr.sh
12systbl := $(srctree)/$(src)/syscalltbl.sh
13
14quiet_cmd_syshdr = SYSHDR $@
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080015 cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
16 '$(syshdr_abi_$(basetarget))' \
17 '$(syshdr_pfx_$(basetarget))' \
18 '$(syshdr_offset_$(basetarget))'
H. Peter Anvind1817642011-11-11 15:55:49 -080019quiet_cmd_systbl = SYSTBL $@
20 cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@
21
22syshdr_abi_unistd_32 := i386
David Howellsec28b7f2012-10-02 18:01:56 +010023$(uapi)/unistd_32.h: $(syscall32) $(syshdr)
H. Peter Anvind1817642011-11-11 15:55:49 -080024 $(call if_changed,syshdr)
25
26syshdr_abi_unistd_32_ia32 := i386
27syshdr_pfx_unistd_32_ia32 := ia32_
28$(out)/unistd_32_ia32.h: $(syscall32) $(syshdr)
29 $(call if_changed,syshdr)
30
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080031syshdr_abi_unistd_x32 := common,x32
32syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT
David Howellsec28b7f2012-10-02 18:01:56 +010033$(uapi)/unistd_x32.h: $(syscall64) $(syshdr)
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080034 $(call if_changed,syshdr)
35
H. Peter Anvin6630f112012-02-14 14:18:50 -080036syshdr_abi_unistd_64 := common,64
David Howellsec28b7f2012-10-02 18:01:56 +010037$(uapi)/unistd_64.h: $(syscall64) $(syshdr)
H. Peter Anvind1817642011-11-11 15:55:49 -080038 $(call if_changed,syshdr)
39
H. Peter Anvinea499fe2012-02-14 14:46:23 -080040syshdr_abi_unistd_64_x32 := x32
41syshdr_pfx_unistd_64_x32 := x32_
42$(out)/unistd_64_x32.h: $(syscall64) $(syshdr)
43 $(call if_changed,syshdr)
44
H. Peter Anvind1817642011-11-11 15:55:49 -080045$(out)/syscalls_32.h: $(syscall32) $(systbl)
46 $(call if_changed,systbl)
47$(out)/syscalls_64.h: $(syscall64) $(systbl)
48 $(call if_changed,systbl)
49
David Howellsec28b7f2012-10-02 18:01:56 +010050uapisyshdr-y += unistd_32.h unistd_64.h unistd_x32.h
H. Peter Anvind1817642011-11-11 15:55:49 -080051syshdr-y += syscalls_32.h
H. Peter Anvinea499fe2012-02-14 14:46:23 -080052syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h
H. Peter Anvind1817642011-11-11 15:55:49 -080053syshdr-$(CONFIG_X86_64) += syscalls_64.h
54
David Howellsec28b7f2012-10-02 18:01:56 +010055targets += $(uapisyshdr-y) $(syshdr-y)
H. Peter Anvind1817642011-11-11 15:55:49 -080056
David Howellsec28b7f2012-10-02 18:01:56 +010057all: $(addprefix $(uapi)/,$(uapisyshdr-y))
58all: $(addprefix $(out)/,$(syshdr-y))