blob: 1eac09159476b6022aa4abf37faaccde36f13dec [file] [log] [blame]
Masahiro Yamadab5a20462020-04-17 16:21:36 +09001# SPDX-License-Identifier: GPL-2.0
Masahiro Yamada6a44d802014-02-24 11:12:11 +09002#
3# Kbuild for top-level directory of U-Boot
Masahiro Yamada6a44d802014-02-24 11:12:11 +09004
Masahiro Yamada490cf5f2015-03-27 10:59:01 +09005#####
Masahiro Yamadab5a20462020-04-17 16:21:36 +09006# Generate generic-asm-offsets.h
Masahiro Yamada490cf5f2015-03-27 10:59:01 +09007
8generic-offsets-file := include/generated/generic-asm-offsets.h
9
10always := $(generic-offsets-file)
Masahiro Yamadaba84de92015-07-05 01:56:56 +090011targets := lib/asm-offsets.s
Masahiro Yamada490cf5f2015-03-27 10:59:01 +090012
Masahiro Yamadaf34d0ad2020-04-17 16:21:37 +090013$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
Michal Marek3a4f6b62015-03-27 10:59:03 +090014 $(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)
Masahiro Yamada6a44d802014-02-24 11:12:11 +090015
16#####
Masahiro Yamadab5a20462020-04-17 16:21:36 +090017# Generate asm-offsets.h
Masahiro Yamada6a44d802014-02-24 11:12:11 +090018
Masahiro Yamada254d68b2014-03-18 16:38:13 +090019ifneq ($(wildcard $(srctree)/arch/$(ARCH)/lib/asm-offsets.c),)
Masahiro Yamada6a44d802014-02-24 11:12:11 +090020offsets-file := include/generated/asm-offsets.h
21endif
22
23always += $(offsets-file)
Masahiro Yamada254d68b2014-03-18 16:38:13 +090024targets += arch/$(ARCH)/lib/asm-offsets.s
Masahiro Yamada6a44d802014-02-24 11:12:11 +090025
Masahiro Yamada6a44d802014-02-24 11:12:11 +090026CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY
27
Masahiro Yamadaf34d0ad2020-04-17 16:21:37 +090028$(obj)/$(offsets-file): $(obj)/arch/$(ARCH)/lib/asm-offsets.s FORCE
Michal Marek3a4f6b62015-03-27 10:59:03 +090029 $(call filechk,offsets,__ASM_OFFSETS_H__)