Find wsds recursively + allow more than one format at a time

This commit is contained in:
Andrey Mayorov 2016-02-04 19:32:19 +03:00
parent e1913e1c1f
commit d9ec8bca53
2 changed files with 7 additions and 4 deletions

View File

@ -18,12 +18,15 @@ include plantuml-toolset/wsd.mk
After that you can invoke it in a number of ways: After that you can invoke it in a number of ways:
```shell ```shell
# Find all *.wsd in the current directory and make svg's out of them # Find all *.wsd in the current directory recursively and make svg's out of them
$ make $ make
# Same but make png's # Same but make png's
$ make FORMAT=png $ make FORMAT=png
# Same but make both png's and svg's
$ make FORMAT="png svg"
# Make examples/conversation.png # Make examples/conversation.png
$ make FORMAT=png examples/conversation.wsd $ make FORMAT=png examples/conversation.wsd
``` ```

6
wsd.mk
View File

@ -1,9 +1,9 @@
FORMAT ?= svg FORMAT ?= svg
SOURCES = $(wildcard ./*.wsd) SOURCES = $(wildcard *.wsd **/*.wsd)
TARGETS = $(patsubst %.wsd,%.$(FORMAT),$(SOURCES)) TARGETS = $(foreach fmt, $(FORMAT), $(patsubst %.wsd,%.$(fmt),$(SOURCES)))
STYLE ?= style.isvg STYLE ?= style.isvg
.PHONY: all clean toolset force .PHONY: all clean install-toolset force
validate = test -s $@ || { rm $@; exit 1; } validate = test -s $@ || { rm $@; exit 1; }