# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
-SHUSHE := .shushe
-SHUSHE_OPTIONS := INCLUDEDIR='sources/INCLUDE' TRANSFORMS='$(wildcard transforms/*.xslt) $(wildcard $(SHUSHE)/transforms/*.xslt)'
+SRCDIR := sources
+BUILDDIR := build
+BUILDTARGET := .grass
+DESTDIR := public
-YSEME := .yseme
-YSEME_OPTIONS := DESTDIR=public SERVERPATH=lady/www
+SHUSHE := .β©π°
+SHUSHEOPTS := SRCDIR='$(SRCDIR)' INCLUDEDIR='$(SRCDIR)/{include}' EXTRAPARSERS='$(wildcard parsers/*.xslt)' EXTRATRANSFORMS='$(wildcard transforms/*.xslt)'
-build: $(SHUSHE)/GNUmakefile
- rm -rf ./public
- @$(MAKE) -f $< install $(SHUSHE_OPTIONS)
- touch .grass
+YSEME := .π₯π€
+YSEMEOPTS := BUILDTARGET='.grass' DESTDIR='$(DESTDIR)' SERVERPATH='lady/www'
-list: $(SHUSHE)/GNUmakefile
- @$(MAKE) -f $< $@ $(SHUSHE_OPTIONS)
+# β Β§ Call out to β©π° δΉ¦η€Ύ ββββββββββββββββββββββββββββββββββββββββββ
-$(SHUSHE)/GNUmakefile $(YSEME)/GNUmakefile: %/GNUmakefile:
- git submodule update --init $*
+build : $(SHUSHE)/GNUmakefile prebuild
+ @for publicfile in $(patsubst %,"%",$(wildcard $(DESTDIR)/*)); do if git check-ignore -q "$$publicfile"; then rm -rf "$$publicfile"; fi; done
+ @$(MAKE) -f '$<' install $(SHUSHEOPTS)
+ @touch '$(BUILDTARGET)'
-GNUmakefile: $(SHUSHE)/GNUmakefile $(YSEME)/GNUmakefile
- touch GNUmakefile
+prebuild : $(SHUSHE)/GNUmakefile
+ @$(MAKE) -f '$<' $(SHUSHEOPTS)
-ifneq ($(wildcard $(YSEME)/GNUmakefile),)
-YSEME_TARGETS := $(shell sed '/^\.PHONY[ :]/!d;/^\.PHONY[ :]/s/ *;.*//;/^\.PHONY[ :]/s/\.PHONY.*: *//' < $(YSEME)/GNUmakefile)
+list : $(SHUSHE)/GNUmakefile
+ @$(MAKE) -f '$<' $@ $(SHUSHEOPTS)
-$(YSEME_TARGETS): $(YSEME)/GNUmakefile
- @$(MAKE) -f $< $@ $(YSEME_OPTIONS)
-endif
+$(BUILDDIR)/% $(DESTDIR)/% : $(SHUSHE)/GNUmakefile
+ @$(MAKE) -f '$<' $@ $(SHUSHEOPTS)
-.PHONY: build list $(YSEME_TARGETS);
+# β Β§ Call out to π₯π€ Yseme βββββββββββββββββββββββββββββββββββββββββ
+
+dry-sync sync : $(YSEME)/GNUmakefile
+ $(MAKE) -f '$<' $@ $(YSEMEOPTS)
+
+# β Β§ Special targets βββββββββββββββββββββββββββββββββββββββββββββββββ
+
+gone :
+ @for publicfile in $(patsubst %,"%",$(wildcard $(DESTDIR)/*)); do if git check-ignore -q "$$publicfile"; then rm -rf "$$publicfile"; fi; done
+
+FORCE : ;
+
+.PHONY : FORCE build dry-sync gone list prebuild sync ;
+
+# β Β§ MakeΒ·file targets βββββββββββββββββββββββββββββββββββββββββββββββ
+
+$(SHUSHE)/GNUmakefile $(YSEME)/GNUmakefile : %/GNUmakefile : FORCE
+ git submodule update --init '$*'