Makefile 871 字节
Newer Older
1
# SPDX-License-Identifier: GPL-2.0
2 3 4 5
#
# Makefile for s390 specific build tools
#

6 7 8 9 10 11 12 13
kapi := arch/$(ARCH)/include/generated/asm
kapi-hdrs-y := $(kapi)/facility-defs.h $(kapi)/dis-defs.h

targets += $(addprefix ../../../,$(kapi-hdrs-y))
PHONY += kapi

kapi:	$(kapi-hdrs-y)

14
hostprogs-y		    += gen_facilities
15 16
hostprogs-y		    += gen_opcode_table

17
HOSTCFLAGS_gen_facilities.o += -Wall $(LINUXINCLUDE)
18
HOSTCFLAGS_gen_opcode_table.o += -Wall $(LINUXINCLUDE)
19

20 21 22 23
# Ensure output directory exists
_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')

define filechk_facility-defs.h
24 25 26
	$(obj)/gen_facilities
endef

27
define filechk_dis-defs.h
28
	$(obj)/gen_opcode_table < $(srctree)/arch/$(ARCH)/tools/opcodes.txt
29 30
endef

31 32
$(kapi)/facility-defs.h: $(obj)/gen_facilities FORCE
	$(call filechk,facility-defs.h)
33

34 35
$(kapi)/dis-defs.h: $(obj)/gen_opcode_table FORCE
	$(call filechk,dis-defs.h)