start makefile
This commit is contained in:
parent
4e605b69a1
commit
b4a939f364
1 changed files with 34 additions and 0 deletions
34
Makefile
Normal file
34
Makefile
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
DATADIR = data
|
||||||
|
TMPDIR = _tmp
|
||||||
|
BUILDDIR = _build
|
||||||
|
|
||||||
|
# SMALL = thumbnails, MED = single pages (link to full size)
|
||||||
|
SMALL := 200
|
||||||
|
MED := 1200
|
||||||
|
|
||||||
|
MAKEPAGES = cabal -v0 run -- make-pages
|
||||||
|
|
||||||
|
ifneq ($(BUILDDIR),$(DATADIR))
|
||||||
|
$(BUILDDIR)/%: $(DATADIR)/%
|
||||||
|
cp $< $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(BUILDDIR)/%_small.png: $(DATADIR)/%.png
|
||||||
|
mkdir -p $(dir $@)
|
||||||
|
convert -resize "$(SMALL)x$(SMALL)^" -gravity center -crop 1:1+0 $< $@
|
||||||
|
|
||||||
|
$(BUILDDIR)/%_med.png: $(DATADIR)/%.png
|
||||||
|
mkdir -p $(dir $@)
|
||||||
|
convert -resize "$(MED)x$(MED)>" $< $@
|
||||||
|
|
||||||
|
$(BUILDDIR)/%/index.html: $(DATADIR)/%/info.yaml
|
||||||
|
mkdir -p $(dir $@)
|
||||||
|
$(MAKEPAGES) single $< -o $@
|
||||||
|
|
||||||
|
$(BUILDDIR)/nsfw/%/index.html: $(DATADIR)/%/info.yaml
|
||||||
|
mkdir -p $(dir $@)
|
||||||
|
$(MAKEPAGES) single $< -o $@ -n
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
$(RM) -r $(BUILDDIR)
|
Loading…
Reference in a new issue