gallery/Makefile

45 lines
964 B
Makefile
Raw Normal View History

2020-07-14 01:10:33 -04:00
DATADIR = data
TMPDIR = _tmp
BUILDDIR = _build
2020-07-16 10:07:28 -04:00
INFONAME = info.yaml
2020-07-14 01:10:33 -04:00
# SMALL = thumbnails, MED = single pages (link to full size)
SMALL := 200
MED := 1200
2020-07-16 10:07:28 -04:00
MAKEPAGES = $(TMPDIR)/make-pages
2020-07-14 01:10:33 -04:00
2020-07-15 05:58:44 -04:00
YAMLS != find $(DATADIR) -iname "*.yaml"
2020-07-16 10:07:28 -04:00
all: make-pages $(BUILDDIR)/index.html
2020-07-15 05:58:44 -04:00
2020-07-16 10:29:32 -04:00
$(BUILDDIR)/index.html: $(DATADIR)/galleries.yaml $(MAKEPAGES)
2020-07-16 10:07:28 -04:00
echo "[index]"
mkdir -p $(dir $@)
2020-07-16 10:29:32 -04:00
$(MAKEPAGES) index $< -o $@
2020-07-15 14:09:40 -04:00
2020-07-16 10:07:28 -04:00
$(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 {} $@ \;
2020-07-14 01:10:33 -04:00
2020-07-16 10:07:28 -04:00
$(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)
2020-07-15 14:09:40 -04:00
2020-07-16 10:07:28 -04:00
-include $(TMPDIR)/galleries.d
2020-07-15 05:58:58 -04:00
2020-07-15 05:58:44 -04:00
.PHONY: clean distclean
2020-07-14 01:10:33 -04:00
clean:
2020-07-16 10:07:28 -04:00
echo "[clean]"
2020-07-15 05:58:44 -04:00
rm -rf $(BUILDDIR) $(TMPDIR)
distclean: clean
2020-07-16 10:07:28 -04:00
echo "[distclean]"
2020-07-15 05:58:44 -04:00
rm -rf dist-newstyle
2020-07-16 10:07:28 -04:00
.SILENT: