rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | # |
| 3 | # linux/arch/arm/tools/Makefile |
| 4 | # |
| 5 | # Copyright (C) 2001 Russell King |
| 6 | # |
| 7 | |
| 8 | gen := arch/$(ARCH)/include/generated |
| 9 | kapi := $(gen)/asm |
| 10 | uapi := $(gen)/uapi/asm |
| 11 | syshdr := $(srctree)/$(src)/syscallhdr.sh |
| 12 | sysnr := $(srctree)/$(src)/syscallnr.sh |
| 13 | systbl := $(srctree)/$(src)/syscalltbl.sh |
| 14 | syscall := $(srctree)/$(src)/syscall.tbl |
| 15 | |
| 16 | gen-y := $(gen)/calls-oabi.S |
| 17 | gen-y += $(gen)/calls-eabi.S |
| 18 | kapi-hdrs-y := $(kapi)/unistd-nr.h |
| 19 | kapi-hdrs-y += $(kapi)/mach-types.h |
| 20 | uapi-hdrs-y := $(uapi)/unistd-common.h |
| 21 | uapi-hdrs-y += $(uapi)/unistd-oabi.h |
| 22 | uapi-hdrs-y += $(uapi)/unistd-eabi.h |
| 23 | |
| 24 | targets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y)) |
| 25 | |
| 26 | PHONY += kapi uapi |
| 27 | |
| 28 | kapi: $(kapi-hdrs-y) $(gen-y) |
| 29 | |
| 30 | uapi: $(uapi-hdrs-y) |
| 31 | |
| 32 | # Create output directory if not already present |
| 33 | _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \ |
| 34 | $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') |
| 35 | |
| 36 | quiet_cmd_gen_mach = GEN $@ |
| 37 | cmd_gen_mach = mkdir -p $(dir $@) && \ |
| 38 | $(AWK) -f $(filter-out $(PHONY),$^) > $@ || \ |
| 39 | { rm -f $@; /bin/false; } |
| 40 | |
| 41 | $(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE |
| 42 | $(call if_changed,gen_mach) |
| 43 | |
| 44 | quiet_cmd_syshdr = SYSHDR $@ |
| 45 | cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ |
| 46 | '$(syshdr_abi_$(basetarget))' \ |
| 47 | '$(syshdr_pfx_$(basetarget))' \ |
| 48 | '__NR_SYSCALL_BASE' |
| 49 | |
| 50 | quiet_cmd_systbl = SYSTBL $@ |
| 51 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \ |
| 52 | '$(systbl_abi_$(basetarget))' |
| 53 | |
| 54 | quiet_cmd_sysnr = SYSNR $@ |
| 55 | cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \ |
| 56 | '$(syshdr_abi_$(basetarget))' |
| 57 | |
| 58 | syshdr_abi_unistd-common := common |
| 59 | $(uapi)/unistd-common.h: $(syscall) $(syshdr) FORCE |
| 60 | $(call if_changed,syshdr) |
| 61 | |
| 62 | syshdr_abi_unistd-oabi := oabi |
| 63 | $(uapi)/unistd-oabi.h: $(syscall) $(syshdr) FORCE |
| 64 | $(call if_changed,syshdr) |
| 65 | |
| 66 | syshdr_abi_unistd-eabi := eabi |
| 67 | $(uapi)/unistd-eabi.h: $(syscall) $(syshdr) FORCE |
| 68 | $(call if_changed,syshdr) |
| 69 | |
| 70 | sysnr_abi_unistd-nr := common,oabi,eabi,compat |
| 71 | $(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE |
| 72 | $(call if_changed,sysnr) |
| 73 | |
| 74 | systbl_abi_calls-oabi := common,oabi |
| 75 | $(gen)/calls-oabi.S: $(syscall) $(systbl) FORCE |
| 76 | $(call if_changed,systbl) |
| 77 | |
| 78 | systbl_abi_calls-eabi := common,eabi |
| 79 | $(gen)/calls-eabi.S: $(syscall) $(systbl) FORCE |
| 80 | $(call if_changed,systbl) |