H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 1 | out := $(obj)/../include/generated/asm |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 2 | uapi := $(obj)/../include/generated/asm |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 3 | |
| 4 | # Create output directory if not already present |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 5 | _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \ |
| 6 | $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 7 | |
| 8 | syscall32 := $(srctree)/$(src)/syscall_32.tbl |
| 9 | syscall64 := $(srctree)/$(src)/syscall_64.tbl |
| 10 | |
| 11 | syshdr := $(srctree)/$(src)/syscallhdr.sh |
| 12 | systbl := $(srctree)/$(src)/syscalltbl.sh |
| 13 | |
| 14 | quiet_cmd_syshdr = SYSHDR $@ |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 15 | cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ |
| 16 | '$(syshdr_abi_$(basetarget))' \ |
| 17 | '$(syshdr_pfx_$(basetarget))' \ |
| 18 | '$(syshdr_offset_$(basetarget))' |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 19 | quiet_cmd_systbl = SYSTBL $@ |
| 20 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ |
| 21 | |
| 22 | syshdr_abi_unistd_32 := i386 |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 23 | $(uapi)/unistd_32.h: $(syscall32) $(syshdr) |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 24 | $(call if_changed,syshdr) |
| 25 | |
| 26 | syshdr_abi_unistd_32_ia32 := i386 |
| 27 | syshdr_pfx_unistd_32_ia32 := ia32_ |
| 28 | $(out)/unistd_32_ia32.h: $(syscall32) $(syshdr) |
| 29 | $(call if_changed,syshdr) |
| 30 | |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 31 | syshdr_abi_unistd_x32 := common,x32 |
| 32 | syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 33 | $(uapi)/unistd_x32.h: $(syscall64) $(syshdr) |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 34 | $(call if_changed,syshdr) |
| 35 | |
H. Peter Anvin | 6630f11 | 2012-02-14 14:18:50 -0800 | [diff] [blame] | 36 | syshdr_abi_unistd_64 := common,64 |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 37 | $(uapi)/unistd_64.h: $(syscall64) $(syshdr) |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 38 | $(call if_changed,syshdr) |
| 39 | |
H. Peter Anvin | ea499fe | 2012-02-14 14:46:23 -0800 | [diff] [blame] | 40 | syshdr_abi_unistd_64_x32 := x32 |
| 41 | syshdr_pfx_unistd_64_x32 := x32_ |
| 42 | $(out)/unistd_64_x32.h: $(syscall64) $(syshdr) |
| 43 | $(call if_changed,syshdr) |
| 44 | |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 45 | $(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 Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 50 | uapisyshdr-y += unistd_32.h unistd_64.h unistd_x32.h |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 51 | syshdr-y += syscalls_32.h |
H. Peter Anvin | ea499fe | 2012-02-14 14:46:23 -0800 | [diff] [blame] | 52 | syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 53 | syshdr-$(CONFIG_X86_64) += syscalls_64.h |
| 54 | |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 55 | targets += $(uapisyshdr-y) $(syshdr-y) |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 56 | |
David Howells | ec28b7f | 2012-10-02 18:01:56 +0100 | [diff] [blame^] | 57 | all: $(addprefix $(uapi)/,$(uapisyshdr-y)) |
| 58 | all: $(addprefix $(out)/,$(syshdr-y)) |