Skip to content

Commit 7f4b67f

Browse files
committed
makefile: Add image comparison targets
Add the `make compare`, `make update` targets to the Makefile (lifted from `Makefile.old`) Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
1 parent a539f14 commit 7f4b67f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,30 @@ $(CHUCK_GIT_H):
434434
@mkdir -p $(@D)
435435
$(PRINT_GENERATE) tools/generate-chuck.sh > $@
436436

437+
#------------------------------------------------------------------------------
438+
# Image comparison
439+
#------------------------------------------------------------------------------
440+
441+
IMAGES=$(COLOR:%=color-)images
442+
cmp-% compare-%:
443+
compare $(IMAGES)/$*.png $(IMAGES)/bad/$*.png -compose src $*.png || true
444+
open $*.png $(IMAGES)/bad/$*.png $(IMAGES)/$*.png
445+
echo mv -f $(IMAGES)/bad/$*.png $(IMAGES)/$*.png
446+
update-%:
447+
mv $(IMAGES)/bad/$*.png $(IMAGES)/$*.png
448+
rm -f $*.png
449+
updates-%:
450+
$(MAKE) update-$* color-update-$*
451+
cmps-% compares-%:
452+
$(MAKE) compare-$* color-compare-$*
453+
454+
BAD_IMAGES=$(wildcard $(IMAGES)/bad/*.png)
455+
compare: $(BAD_IMAGES:$(IMAGES)/bad/%.png=cmp-%)
456+
update: $(BAD_IMAGES:$(IMAGES)/bad/%.png=update-%)
457+
updates: update color-update
458+
compares: compare color-compare
459+
.PHONY: compare update
460+
437461
# ------------------------------------------------------------------------------
438462
# Help generation (lifted from Makefile)
439463
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)