replace export.sh by Makefile
This commit is contained in:
parent
f403e0beb7
commit
7c1d2f4e32
2 changed files with 56 additions and 21 deletions
56
Makefile
Normal file
56
Makefile
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
##### Variables #####
|
||||
SVGs := $(shell find . -type f -name "*.svg" -not -path "./sources/*")
|
||||
# $(info SVGs: $(SVGs))
|
||||
|
||||
SIGHTS := $(SVGs:.svg=.png)
|
||||
|
||||
CARDS := $(foreach s,$(SVGs),\
|
||||
$(foreach i,1 2 3 4,\
|
||||
$(subst .svg,_card_$(i).png,$(s))))
|
||||
|
||||
|
||||
##### Generic targets #####
|
||||
all: sights cards galleries
|
||||
sights: $(SIGHTS)
|
||||
cards: $(CARDS)
|
||||
galleries: gallery_cards.png gallery_sights.png
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(SIGHTS)
|
||||
rm -f $(CARDS)
|
||||
rm gallery_cards.png gallery_sights.png
|
||||
|
||||
|
||||
#### Galleries #####
|
||||
gallery_sights.png: $(SIGHTS)
|
||||
montage $(SIGHTS) -geometry 512 -border 10 -frame 4 -mattecolor black -shadow $@
|
||||
|
||||
gallery_cards.png: $(CARDS)
|
||||
montage $(CARDS) -geometry 256 -border 10 -frame 4 -mattecolor black -shadow -tile 4x $@
|
||||
|
||||
|
||||
##### Sights #####
|
||||
define sight_template =
|
||||
$(1:.svg=.png): $(1)
|
||||
inkscape --without-gui --export-width=1024 --export-area-page --export-png=$(1:.svg=.png) $(1)
|
||||
endef
|
||||
|
||||
$(foreach s,$(SVGs),\
|
||||
$(eval $(call sight_template,$(s)))\
|
||||
)
|
||||
|
||||
|
||||
##### Cards #####
|
||||
define card_template =
|
||||
$(1:.svg=_card_$(2).png): $(1)
|
||||
inkscape --without-gui --export-height=800 --export-id=card_$(i) --export-png=$(1:.svg=_card_$(2).png) $(1)
|
||||
endef
|
||||
|
||||
$(foreach s,$(SVGs),\
|
||||
$(foreach i,1 2 3 4,\
|
||||
$(eval $(call card_template,$(s),$(i)))\
|
||||
)\
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue