diff options
Diffstat (limited to 'Kbuild')
-rw-r--r-- | Kbuild | 28 |
1 files changed, 12 insertions, 16 deletions
@@ -1,14 +1,15 @@ -##### -# 1) Generate asm-offsets.h +# SPDX-License-Identifier: GPL-2.0 # +# Kbuild for top-level directory of Barebox + +##### +# Generate asm-offsets.h offsets-file := include/generated/asm-offsets.h -always += $(offsets-file) -targets += $(offsets-file) +always-y += $(offsets-file) targets += arch/$(SRCARCH)/lib/asm-offsets.s - # Default sed regexp - multiline due to syntax constraints define sed-y "/^->/{s:->#\(.*\):/* \1 */:; \ @@ -17,9 +18,9 @@ define sed-y s:->::; p;}" endef -quiet_cmd_offsets = GEN $@ -define cmd_offsets - (set -e; \ +# Use filechk to avoid rebuilds when a header changes, but the resulting file +# does not +define filechk_offsets echo "#ifndef __ASM_OFFSETS_H__"; \ echo "#define __ASM_OFFSETS_H__"; \ echo "/*"; \ @@ -31,13 +32,8 @@ define cmd_offsets echo ""; \ sed -ne $(sed-y) $<; \ echo ""; \ - echo "#endif" ) > $@ + echo "#endif" endef -# We use internal kbuild rules to avoid the "is up to date" message from make -arch/$(SRCARCH)/lib/asm-offsets.s: arch/$(SRCARCH)/lib/asm-offsets.c FORCE - $(Q)mkdir -p $(dir $@) - $(call if_changed_dep,cc_s_c) - -$(obj)/$(offsets-file): arch/$(SRCARCH)/lib/asm-offsets.s Kbuild - $(call cmd,offsets) +$(offsets-file): arch/$(SRCARCH)/lib/asm-offsets.s FORCE + $(call filechk,offsets) |