wf_akkoma-fe/Makefile
2024-10-03 19:08:38 +02:00

51 lines
1,015 B
Makefile

# 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)/