summaryrefslogtreecommitdiff
path: root/Kbuild
blob: 4a7f7f2d92a957d34b6ebdad8c3a030cfd7da79d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# SPDX-License-Identifier: GPL-2.0
#
# Kbuild for top-level directory of U-Boot

#####
# Generate generic-asm-offsets.h

generic-offsets-file := include/generated/generic-asm-offsets.h

always-y  := $(generic-offsets-file)
targets := lib/asm-offsets.s

CFLAGS_REMOVE_lib/asm-offsets.o := $(LTO_CFLAGS)
CFLAGS_REMOVE_arch/$(ARCH)/lib/asm-offsets.o := $(LTO_CFLAGS)

$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
	$(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)

#####
# Generate asm-offsets.h

ifneq ($(wildcard $(srctree)/arch/$(ARCH)/lib/asm-offsets.c),)
offsets-file := include/generated/asm-offsets.h
endif

always-y  += $(offsets-file)
targets += arch/$(ARCH)/lib/asm-offsets.s

CFLAGS_lib/asm-offsets.o := -DDO_DEPS_ONLY
CFLAGS_arch/$(ARCH)/lib/asm-offsets.o := -DDO_DEPS_ONLY

$(obj)/$(offsets-file): $(obj)/arch/$(ARCH)/lib/asm-offsets.s FORCE
	$(call filechk,offsets,__ASM_OFFSETS_H__)