Skip to content

Commit

Permalink
images: fix force rebuild of piggy.o
Browse files Browse the repository at this point in the history
piggy.o would be build for every time barebox was built
This had the sideeffect that the image(s) would
always be rebuilt despite no changes

Fix this by adding piggy.o to targets
and avoid an extra command in the rule to create .pblb files

The patch includes the removal of a stray assignment

Fixes: 5a1a5ed ("ARM: images: use piggydata")
Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
sravnborg authored and saschahauer committed Jan 3, 2019
1 parent 3abeee3 commit 64fc4ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
#

quiet_cmd_objcopy_bin = OBJCOPYB $@
cmd_objcopy_bin = $(OBJCOPY) -O binary $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
cmd_objcopy_bin = \
$(OBJCOPY) -O binary $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ && \
$(objtree)/scripts/fix_size -f $@

pbl-lds := $(obj)/pbl.lds
extra-y += $(pbl-lds)
Expand All @@ -59,14 +61,11 @@ quiet_cmd_elf__ ?= LD $@

PBL_CPPFLAGS += -fdata-sections -ffunction-sections

piggy_o := piggy.$(suffix_y).o

$(obj)/%.pbl: $(pbl-lds) $(barebox-pbl-common) $(obj)/piggy.o FORCE
$(call if_changed,elf__,$(*F))

$(obj)/%.pblb: $(obj)/%.pbl FORCE
$(call if_changed,objcopy_bin,$(*F))
$(Q)$(objtree)/scripts/fix_size -f $@

$(obj)/%.s: $(obj)/% FORCE
$(call if_changed,disasm)
Expand Down Expand Up @@ -106,7 +105,7 @@ include $(srctree)/images/Makefile.tegra
include $(srctree)/images/Makefile.vexpress
include $(srctree)/images/Makefile.at91

targets += $(image-y) pbl.lds barebox.x barebox.z
targets += $(image-y) pbl.lds barebox.x barebox.z piggy.o
targets += $(patsubst %,%.pblb,$(pblb-y))
targets += $(patsubst %,%.pbl,$(pblb-y))
targets += $(patsubst %,%.s,$(pblb-y))
Expand Down

0 comments on commit 64fc4ac

Please sign in to comment.