# Requires GNU Make export LC_ALL = C.UTF-8 QUILT ::= quilt --quiltrc ../quiltrc # redefine via `make YARN=yarn` if named differently YARN ::= yarnpkg SUBMODULE_NAME ::= akkoma-fe .PHONY: build build: patch.stamp cd $(SUBMODULE_NAME) && \ $(YARN) && \ $(YARN) build wf_akkoma-fe.zip: build rm -f $@ cd $(SUBMODULE_NAME) && \ zip -r ../$@ dist submodule.stamp: @echo "Ensure submodule is up-to-date" @if [ ! -f $(SUBMODULE_NAME)/.git ] || \ [ ! -f $@ ] || \ git submodule status $(SUBMODULE_NAME) | grep -qE '^\+' ; then \ git submodule sync && \ git submodule update --init && \ touch $@ ; \ fi .PHONY: patch patch: patch.stamp patch.stamp: submodule.stamp patches/series $(wildcard patches/*.patch) @echo "Applying patches" @# `pop -a` return 2 if currently no patches applied, thus ignore exit code @cd $(SUBMODULE_NAME) && \ $(QUILT) pop -qfa; \ $(QUILT) push -a @touch $@ # cleaning .PHONY: clean clean: rm -f *.stamp .PHONY: reset reset: clean rm -fr $(SUBMODULE_NAME)/