blob: bf52e540518e1d05d22249a4d7ec46b4b86d2825 [file] [log] [blame]
Masahiro Yamada77ddac82020-04-17 16:21:36 +09001# SPDX-License-Identifier: GPL-2.0
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +09002#
3# Kbuild for top-level directory of U-Boot
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +09004
Masahiro Yamada33ff3602015-03-27 10:59:01 +09005#####
Masahiro Yamada77ddac82020-04-17 16:21:36 +09006# Generate generic-asm-offsets.h
Masahiro Yamada33ff3602015-03-27 10:59:01 +09007
8generic-offsets-file := include/generated/generic-asm-offsets.h
9
10always := $(generic-offsets-file)
Masahiro Yamada1072aba2015-07-05 01:56:56 +090011targets := lib/asm-offsets.s
Masahiro Yamada33ff3602015-03-27 10:59:01 +090012
Marek BehĂșnd72a3b72021-05-20 13:24:03 +020013CFLAGS_REMOVE_asm-offsets.o := $(LTO_CFLAGS)
14
Masahiro Yamadadb4633e2020-04-17 16:21:37 +090015$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
Michal Mareke19b6e02015-03-27 10:59:03 +090016 $(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +090017
18#####
Masahiro Yamada77ddac82020-04-17 16:21:36 +090019# Generate asm-offsets.h
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +090020
Masahiro Yamada8226dfd2014-03-18 16:38:13 +090021ifneq ($(wildcard $(srctree)/arch/$(ARCH)/lib/asm-offsets.c),)
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +090022offsets-file := include/generated/asm-offsets.h
23endif
24
25always += $(offsets-file)
Masahiro Yamada8226dfd2014-03-18 16:38:13 +090026targets += arch/$(ARCH)/lib/asm-offsets.s
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +090027
Masahiro Yamada5aed6ed2014-02-24 11:12:11 +090028CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY
29
Masahiro Yamadadb4633e2020-04-17 16:21:37 +090030$(obj)/$(offsets-file): $(obj)/arch/$(ARCH)/lib/asm-offsets.s FORCE
Michal Mareke19b6e02015-03-27 10:59:03 +090031 $(call filechk,offsets,__ASM_OFFSETS_H__)