From: adrianna Date: Wed, 2 Mar 2016 18:57:27 +0000 (+0200) Subject: less disgusting makefile X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=d048987fc48fde78cef70d598c84c5d0269288d1;p=koperkapel.git less disgusting makefile --- diff --git a/koperkapel/images/Makefile b/koperkapel/images/Makefile index 1d584a1..771d8e8 100644 --- a/koperkapel/images/Makefile +++ b/koperkapel/images/Makefile @@ -2,12 +2,14 @@ VPATH=../../sources/vector SVGS=$(shell find $(VPATH) -name "*.svg") PNGS=$(patsubst $(VPATH)/%.svg, %.png, $(SVGS)) -ROACH=$(filter roach, $(PNGS)) +ROACH=$(filter roach/%, $(PNGS)) -ROACH_32=$(subst roach, roach_32, $(ROACH)) -ROACH_21=$(subst roach, roach_21, $(ROACH)) +ROACH_32=$(patsubst roach/%, roach_32/%, $(ROACH)) +ROACH_21=$(patsubst roach/%, roach_21/%, $(ROACH)) +ROACH_QUARTET=$(patsubst roach/%, roach_quartet/%, $(ROACH)) +ROACH_NONET=$(patsubst roach/%, roach_nonet/%, $(ROACH)) -all: $(PNGS) $(ROACH_32) $(ROACH_21) roach_quartet roach_nonet +all: $(PNGS) $(ROACH_32) $(ROACH_21) $(ROACH_QUARTET) $(ROACH_NONET) # Default rule @@ -27,27 +29,22 @@ roach_21/%.png: roach/%.svg # Roach quartet -roach_quartet: $(ROACH_32) +roach_quartet/roach_%.png: roach_32/roach_*.png @mkdir -p roach_quartet - @montage $(foreach i, 1 2 3 4, roach_32/roach_$(i).png) -geometry +0+0 -background none roach_quartet/roach_1.png - @montage $(foreach i, 2 3 4 1, roach_32/roach_$(i).png) -geometry +0+0 -background none roach_quartet/roach_2.png - @montage $(foreach i, 3 4 1 2, roach_32/roach_$(i).png) -geometry +0+0 -background none roach_quartet/roach_3.png - @montage $(foreach i, 4 1 2 3, roach_32/roach_$(i).png) -geometry +0+0 -background none roach_quartet/roach_4.png - @montage $(foreach i, 1 2 3 4, roach_32/eyes_$(i).png) -geometry +0+0 -background none roach_quartet/eyes_1.png - @montage $(foreach i, 2 3 4 1, roach_32/eyes_$(i).png) -geometry +0+0 -background none roach_quartet/eyes_2.png - @montage $(foreach i, 3 4 1 2, roach_32/eyes_$(i).png) -geometry +0+0 -background none roach_quartet/eyes_3.png - @montage $(foreach i, 4 1 2 3, roach_32/eyes_$(i).png) -geometry +0+0 -background none roach_quartet/eyes_4.png + @montage $(foreach i, -1 0 1 2 , roach_32/roach_$$(( ( $(i) + $(patsubst roach_quartet/roach_%.png,%, $@) ) % 4 + 1 )).png) -geometry +0+0 -background none $@ + +roach_quartet/eyes_%.png: roach_32/eyes_*.png + @mkdir -p roach_quartet + @montage $(foreach i, -1 0 1 2 , roach_32/eyes_$$(( ( $(i) + $(patsubst roach_quartet/eyes_%.png,%, $@) ) % 4 + 1 )).png) -geometry +0+0 -background none $@ # Roach nonet -roach_nonet: $(ROACH_21) +roach_nonet/roach_%.png: roach_21/roach_*.png @mkdir -p roach_nonet - @montage $(foreach i, 1 2 3 4 1 2 3 4 1, roach_21/roach_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/roach_1.png - @montage $(foreach i, 2 3 4 1 2 3 4 1 2, roach_21/roach_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/roach_2.png - @montage $(foreach i, 3 4 1 2 3 4 1 2 3, roach_21/roach_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/roach_3.png - @montage $(foreach i, 4 1 2 3 4 1 2 3 4, roach_21/roach_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/roach_4.png - @montage $(foreach i, 1 2 3 4 1 2 3 4 1, roach_21/eyes_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/eyes_1.png - @montage $(foreach i, 2 3 4 1 2 3 4 1 2, roach_21/eyes_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/eyes_2.png - @montage $(foreach i, 3 4 1 2 3 4 1 2 3, roach_21/eyes_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/eyes_3.png - @montage $(foreach i, 4 1 2 3 4 1 2 3 4, roach_21/eyes_$(i).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 roach_nonet/eyes_4.png + @montage $(foreach i, -1 0 1 2 3 4 5 6 7 , roach_21/roach_$$(( ( $(i) + $(patsubst roach_nonet/roach_%.png,%, $@) ) % 4 + 1 )).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 $@ + +roach_nonet/eyes_%.png: roach_21/eyes_*.png + @mkdir -p roach_nonet + @montage $(foreach i, -1 0 1 2 3 4 5 6 7 , roach_21/eyes_$$(( ( $(i) + $(patsubst roach_nonet/eyes_%.png,%, $@) ) % 4 + 1 )).png) -geometry +0+0 -background none - | convert - -background none -gravity southeast -splice 1x1 $@ +