From d8f37d5d80d0fb2e8b08c35129dd5cdf53179343 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Wed, 15 Jul 2020 11:58:44 +0200 Subject: [PATCH] makefile tidying --- .gitattributes | 6 ++++++ Makefile | 33 ++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.gitattributes b/.gitattributes index 24a8e87..6c1d669 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/Makefile b/Makefile index 3c87198..ffe3b36 100644 --- a/Makefile +++ b/Makefile @@ -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