add Makefile and build directory
This commit is contained in:
parent
c799a4d495
commit
4a0f5de37f
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1 @@
|
||||||
*.svg
|
build/
|
||||||
*.png
|
|
14
Makefile
Normal file
14
Makefile
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
suits := puppets bread wheels blades chairs cards
|
||||||
|
values := 1 2 3 4 5 6 traveler knight wizard noble
|
||||||
|
cards := $(foreach suit,$(suits),$(foreach value,$(values),$(value)-$(suit)))
|
||||||
|
|
||||||
|
svgdeck: $(foreach card,$(cards),build/$(card).svg)
|
||||||
|
|
||||||
|
pngdeck: $(foreach card,$(cards),build/$(card).png)
|
||||||
|
|
||||||
|
build/%.svg: deck.asy cards.asy numerals.asy $(foreach suit,$(suits),$(suit).asy)
|
||||||
|
mkdir -p build
|
||||||
|
sh -c "buf_size=5000000 asy -globalwrite deck.asy"
|
||||||
|
|
||||||
|
build/%.png: build/%.svg
|
||||||
|
convert -density 512 -background transparent $< $@
|
2
deck.asy
2
deck.asy
|
@ -28,6 +28,6 @@ for (int suit = 0; suit <= 5; ++suit) {
|
||||||
else if (value == WIZARD) { value_str = "wizard"; }
|
else if (value == WIZARD) { value_str = "wizard"; }
|
||||||
else if (value == NOBLE) { value_str = "noble"; }
|
else if (value == NOBLE) { value_str = "noble"; }
|
||||||
else { value_str = format("%d", value); }
|
else { value_str = format("%d", value); }
|
||||||
shipout(value_str+"-"+suit_str, "svg");
|
shipout("build/"+value_str+"-"+suit_str, "svg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue