makefile tidying

This commit is contained in:
Rhiannon Morris 2020-07-15 11:58:44 +02:00
parent 070e2110c0
commit d8f37d5d80
2 changed files with 28 additions and 11 deletions

6
.gitattributes vendored
View file

@ -1 +1,7 @@
*.png filter=lfs diff=lfs merge=lfs -text
[attr]makefile whitespace=-tab-in-indent,trailing-space
makefile makefile
Makefile makefile
*.mk makefile
*.d makefile

View file

@ -8,27 +8,38 @@ MED := 1200
MAKEPAGES = cabal -v0 run -- make-pages
YAMLS != find $(DATADIR) -iname "*.yaml"
all:
ifneq ($(BUILDDIR),$(DATADIR))
$(BUILDDIR)/%: $(DATADIR)/%
cp $< $@
@echo "[copy] "$@
@cp $< $@
endif
$(BUILDDIR)/%_small.png: $(DATADIR)/%.png
mkdir -p $(dir $@)
convert -resize "$(SMALL)x$(SMALL)^" -gravity center -crop 1:1+0 $< $@
@echo "[resize] "$@
@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)>" $< $@
@echo "[resize] "$@
@mkdir -p $(dir $@)
@convert -resize "$(MED)x$(MED)>" $< $@
$(BUILDDIR)/%/index.html: $(DATADIR)/%/info.yaml
mkdir -p $(dir $@)
$(MAKEPAGES) single $< -o $@
@echo "[single] "$@
@mkdir -p $(dir $@)
@$(MAKEPAGES) single $< -o $@
$(BUILDDIR)/nsfw/%/index.html: $(DATADIR)/%/info.yaml
mkdir -p $(dir $@)
$(MAKEPAGES) single $< -o $@ -n
@echo "[single] "$@
@mkdir -p $(dir $@)
@$(MAKEPAGES) single $< -o $@ -n
.PHONY: clean
.PHONY: clean distclean
clean:
$(RM) -r $(BUILDDIR)
rm -rf $(BUILDDIR) $(TMPDIR)
distclean: clean
rm -rf dist-newstyle