Kbuild: Check if offsets.h was updated
Do not rebuild offsets.h if it was not changed. Change-Id: Idd7a4c0f1dad0575f09b84de1f47a92d20c05e70 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
fbed1e4bcd
commit
bdcf909978
1 changed files with 18 additions and 3 deletions
21
Kbuild
21
Kbuild
|
@ -92,8 +92,23 @@ cmd_cc_o_c_1 = $(CC) $(KBUILD_CFLAGS) $(OFFSETS_INCLUDE) -c -o $@ $<
|
|||
|
||||
arch/$(SRCARCH)/core/offsets/offsets.o: arch/$(SRCARCH)/core/offsets/offsets.c
|
||||
$(Q)mkdir -p $(dir $@)
|
||||
$(call if_changed_rule,cc_o_c_1)
|
||||
$(call if_changed,cc_o_c_1)
|
||||
|
||||
$(obj)/include/generated/offsets.h: $(GENOFFSET_H) arch/$(SRCARCH)/core/offsets/offsets.o include/config/auto.conf FORCE
|
||||
$(Q)$(GENOFFSET_H) -i arch/$(SRCARCH)/core/offsets/offsets.o -o $@
|
||||
|
||||
define offsetchk
|
||||
$(Q)set -e; \
|
||||
$(kecho) ' CHK $@'; \
|
||||
mkdir -p $(dir $@); \
|
||||
$(GENOFFSET_H) -i $(1) -o $@.tmp; \
|
||||
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
|
||||
rm -f $@.tmp; \
|
||||
else \
|
||||
$(kecho) ' UPD $@'; \
|
||||
mv -f $@.tmp $@; \
|
||||
fi
|
||||
endef
|
||||
|
||||
include/generated/offsets.h: $(GENOFFSET_H) arch/$(SRCARCH)/core/offsets/offsets.o \
|
||||
include/config/auto.conf FORCE
|
||||
$(call offsetchk,arch/$(SRCARCH)/core/offsets/offsets.o)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue