2018-11-26 08:46:50 -08:00
|
|
|
BOB_SRCS=$(wildcard art/*.bob)
|
2019-05-28 14:02:04 -07:00
|
|
|
MSC_SRCS=$(wildcard art/*.msc)
|
2018-11-26 08:46:50 -08:00
|
|
|
MD_SRCS=$(wildcard src/*.md)
|
|
|
|
|
2019-05-28 14:02:04 -07:00
|
|
|
SVG_IMGS=$(BOB_SRCS:art/%.bob=src/img/%.svg) $(MSC_SRCS:art/%.msc=src/img/%.svg)
|
2018-11-26 08:46:50 -08:00
|
|
|
|
2019-06-27 15:20:37 -07:00
|
|
|
TARGET=html/index.html
|
|
|
|
TEST_STAMP=src/tests.ok
|
2018-11-26 08:46:50 -08:00
|
|
|
|
2019-06-27 15:20:37 -07:00
|
|
|
all: $(TARGET)
|
2018-11-26 08:46:50 -08:00
|
|
|
|
2019-09-21 07:59:36 -07:00
|
|
|
svg: $(SVG_IMGS)
|
|
|
|
|
2019-06-27 15:20:37 -07:00
|
|
|
test: $(TEST_STAMP)
|
|
|
|
|
|
|
|
open: $(TEST_STAMP)
|
2018-11-26 08:46:50 -08:00
|
|
|
mdbook build --open
|
|
|
|
|
|
|
|
watch: $(SVG_IMGS)
|
|
|
|
mdbook watch
|
|
|
|
|
|
|
|
src/img/%.svg: art/%.bob
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
svgbob < $< > $@
|
|
|
|
|
2019-05-28 14:02:04 -07:00
|
|
|
src/img/%.svg: art/%.msc
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
mscgen -T svg -i $< -o $@
|
|
|
|
|
2018-11-26 08:46:50 -08:00
|
|
|
src/%.md: %.md
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
@cp $< $@
|
|
|
|
|
2019-06-27 15:20:37 -07:00
|
|
|
$(TEST_STAMP): $(TARGET)
|
2018-11-26 08:46:50 -08:00
|
|
|
mdbook test
|
|
|
|
touch $@
|
|
|
|
|
2019-06-27 15:20:37 -07:00
|
|
|
$(TARGET): $(SVG_IMGS) $(MD_SRCS)
|
2018-11-26 08:46:50 -08:00
|
|
|
mdbook build
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(SVG_IMGS) src/tests.ok
|
|
|
|
rm -rf html
|