blob: bf52e540518e1d05d22249a4d7ec46b4b86d2825 [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
Marek BehĂșnc1094982021-05-20 13:24:03 +020013CFLAGS_REMOVE_asm-offsets.o := $(LTO_CFLAGS)
14
Masahiro Yamadaf34d0ad2020-04-17 16:21:37 +090015$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
Michal Marek3a4f6b62015-03-27 10:59:03 +090016 $(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)
Masahiro Yamada6a44d802014-02-24 11:12:11 +090017
18#####
Masahiro Yamadab5a20462020-04-17 16:21:36 +090019# Generate asm-offsets.h
Masahiro Yamada6a44d802014-02-24 11:12:11 +090020
Masahiro Yamada254d68b2014-03-18 16:38:13 +090021ifneq ($(wildcard $(srctree)/arch/$(ARCH)/lib/asm-offsets.c),)
Masahiro Yamada6a44d802014-02-24 11:12:11 +090022offsets-file := include/generated/asm-offsets.h
23endif
24
25always += $(offsets-file)
Masahiro Yamada254d68b2014-03-18 16:38:13 +090026targets += arch/$(ARCH)/lib/asm-offsets.s
Masahiro Yamada6a44d802014-02-24 11:12:11 +090027
Masahiro Yamada6a44d802014-02-24 11:12:11 +090028CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY
29
Masahiro Yamadaf34d0ad2020-04-17 16:21:37 +090030$(obj)/$(offsets-file): $(obj)/arch/$(ARCH)/lib/asm-offsets.s FORCE
Michal Marek3a4f6b62015-03-27 10:59:03 +090031 $(call filechk,offsets,__ASM_OFFSETS_H__)