gallery/Makefile

44 lines
914 B
Makefile

DATADIR = data
TMPDIR = _tmp
BUILDDIR = _build
INFONAME = info.yaml
# SMALL = thumbnails, MED = single pages (link to full size)
SMALL := 200
MED := 1200
MAKEPAGES = $(TMPDIR)/make-pages
YAMLS != find $(DATADIR) -iname "*.yaml"
all: make-pages $(BUILDDIR)/index.html
$(BUILDDIR)/index.html:
echo "[index]"
mkdir -p $(dir $@)
touch $@ # FIXME
$(MAKEPAGES): make-pages
echo "[make-pages]"
mkdir -p $(dir $@)
cabal v2-build all -O0
find dist-newstyle -name make-pages -executable -type f \
-exec cp {} $@ \;
$(TMPDIR)/galleries.d: $(DATADIR)/galleries.yaml $(MAKEPAGES)
echo "[gallery-deps] "$@
mkdir -p $(dir $@)
$(MAKEPAGES) depend-gallery $< -o $@ \
-B $(BUILDDIR) -D $(DATADIR) -T $(TMPDIR) -I $(INFONAME)
-include $(TMPDIR)/galleries.d
.PHONY: clean distclean
clean:
echo "[clean]"
rm -rf $(BUILDDIR) $(TMPDIR)
distclean: clean
echo "[distclean]"
rm -rf dist-newstyle
.SILENT: