1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 21da177e4SLinus Torvalds# 31da177e4SLinus Torvalds# linux/arch/arm/tools/Makefile 41da177e4SLinus Torvalds# 51da177e4SLinus Torvalds# Copyright (C) 2001 Russell King 61da177e4SLinus Torvalds# 71da177e4SLinus Torvalds 84e2648dbSRussell Kinggen := arch/$(ARCH)/include/generated 94e2648dbSRussell Kingkapi := $(gen)/asm 1096a8fae0SRussell Kinguapi := $(gen)/uapi/asm 1196a8fae0SRussell Kingsyshdr := $(srctree)/$(src)/syscallhdr.sh 1296a8fae0SRussell Kingsysnr := $(srctree)/$(src)/syscallnr.sh 13*0047eb9fSMasahiro Yamadasystbl := $(srctree)/scripts/syscalltbl.sh 1429c5c3acSMasahiro Yamadasyscall := $(src)/syscall.tbl 154e2648dbSRussell King 1696a8fae0SRussell Kinggen-y := $(gen)/calls-oabi.S 1796a8fae0SRussell Kinggen-y += $(gen)/calls-eabi.S 1896a8fae0SRussell Kingkapi-hdrs-y := $(kapi)/unistd-nr.h 1996a8fae0SRussell Kingkapi-hdrs-y += $(kapi)/mach-types.h 2096a8fae0SRussell Kinguapi-hdrs-y := $(uapi)/unistd-common.h 2196a8fae0SRussell Kinguapi-hdrs-y += $(uapi)/unistd-oabi.h 2296a8fae0SRussell Kinguapi-hdrs-y += $(uapi)/unistd-eabi.h 234e2648dbSRussell King 2496a8fae0SRussell Kingtargets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y)) 254e2648dbSRussell King 2696a8fae0SRussell KingPHONY += kapi uapi 274e2648dbSRussell King 2896a8fae0SRussell Kingkapi: $(kapi-hdrs-y) $(gen-y) 2996a8fae0SRussell King 3096a8fae0SRussell Kinguapi: $(uapi-hdrs-y) 314e2648dbSRussell King 324e2648dbSRussell King# Create output directory if not already present 3396a8fae0SRussell King_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \ 3496a8fae0SRussell King $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') 354e2648dbSRussell King 366e8ac724SMasahiro Yamadaquiet_cmd_gen_mach = GEN $@ 376e8ac724SMasahiro Yamada cmd_gen_mach = mkdir -p $(dir $@) && \ 38172caf19SMasahiro Yamada $(AWK) -f $(filter-out $(PHONY),$^) > $@ 396e8ac724SMasahiro Yamada 404e2648dbSRussell King$(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE 416e8ac724SMasahiro Yamada $(call if_changed,gen_mach) 4296a8fae0SRussell King 4396a8fae0SRussell Kingquiet_cmd_syshdr = SYSHDR $@ 4496a8fae0SRussell King cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ 4596a8fae0SRussell King '$(syshdr_abi_$(basetarget))' \ 4696a8fae0SRussell King '$(syshdr_pfx_$(basetarget))' \ 4796a8fae0SRussell King '__NR_SYSCALL_BASE' 4896a8fae0SRussell King 4996a8fae0SRussell Kingquiet_cmd_systbl = SYSTBL $@ 50*0047eb9fSMasahiro Yamada cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@ 5196a8fae0SRussell King 5296a8fae0SRussell Kingquiet_cmd_sysnr = SYSNR $@ 5396a8fae0SRussell King cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \ 5496a8fae0SRussell King '$(syshdr_abi_$(basetarget))' 5596a8fae0SRussell King 5696a8fae0SRussell Kingsyshdr_abi_unistd-common := common 5796a8fae0SRussell King$(uapi)/unistd-common.h: $(syscall) $(syshdr) FORCE 5896a8fae0SRussell King $(call if_changed,syshdr) 5996a8fae0SRussell King 6096a8fae0SRussell Kingsyshdr_abi_unistd-oabi := oabi 6196a8fae0SRussell King$(uapi)/unistd-oabi.h: $(syscall) $(syshdr) FORCE 6296a8fae0SRussell King $(call if_changed,syshdr) 6396a8fae0SRussell King 6496a8fae0SRussell Kingsyshdr_abi_unistd-eabi := eabi 6596a8fae0SRussell King$(uapi)/unistd-eabi.h: $(syscall) $(syshdr) FORCE 6696a8fae0SRussell King $(call if_changed,syshdr) 6796a8fae0SRussell King 6896a8fae0SRussell Kingsysnr_abi_unistd-nr := common,oabi,eabi,compat 6996a8fae0SRussell King$(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE 7096a8fae0SRussell King $(call if_changed,sysnr) 7196a8fae0SRussell King 72*0047eb9fSMasahiro Yamada$(gen)/calls-oabi.S: abis := common,oabi 7396a8fae0SRussell King$(gen)/calls-oabi.S: $(syscall) $(systbl) FORCE 7496a8fae0SRussell King $(call if_changed,systbl) 7596a8fae0SRussell King 76*0047eb9fSMasahiro Yamada$(gen)/calls-eabi.S: abis := common,eabi 7796a8fae0SRussell King$(gen)/calls-eabi.S: $(syscall) $(systbl) FORCE 7896a8fae0SRussell King $(call if_changed,systbl) 79