2016-10-16 06:14:50 +00:00
|
|
|
.PHONY: tree-clean-p
|
|
|
|
|
|
|
|
READMES:=\
|
|
|
|
ANNOUNCE\
|
|
|
|
ANNOUNCE-2\
|
|
|
|
AUTHORS\
|
|
|
|
COPYING\
|
|
|
|
HACKING\
|
|
|
|
NEWS\
|
|
|
|
#
|
|
|
|
|
2016-10-15 22:34:23 +00:00
|
|
|
COMMIT:=$(shell test -d .git && (git show 2>/dev/null | head -1 | cut -d' ' -f 2) || cat .tarball-version)
|
2016-10-18 21:50:09 +00:00
|
|
|
GUIX-HASH:=out/guix-hash
|
2016-10-15 22:34:23 +00:00
|
|
|
TARBALL_DIR:=$(PACKAGE)-$(VERSION)
|
|
|
|
TARBALL:=$(OUT)/$(TARBALL_DIR).tar.gz
|
|
|
|
|
|
|
|
OPT_CLEAN:=$(OPT_CLEAN) $(TARBALL) .tarball-version
|
|
|
|
|
|
|
|
GIT_ARCHIVE_HEAD:=git archive HEAD --
|
|
|
|
GIT_LS_FILES:=git ls-files
|
|
|
|
ifeq ($(wildcard .git),)
|
|
|
|
GIT_ARCHIVE_HEAD:=tar -cf-
|
|
|
|
GIT_LS_FILES:=find
|
|
|
|
endif
|
|
|
|
|
2016-10-18 21:50:09 +00:00
|
|
|
.tarball-version: tree-clean-p
|
2016-10-15 22:34:23 +00:00
|
|
|
echo $(COMMIT) > $@
|
|
|
|
|
|
|
|
dist: $(TARBALL)
|
|
|
|
|
|
|
|
tree-clean-p:
|
|
|
|
test ! -d .git || git diff --exit-code > /dev/null
|
|
|
|
test ! -d .git || git diff --cached --exit-code > /dev/null
|
|
|
|
@echo commit:$(COMMIT)
|
|
|
|
|
|
|
|
$(TARBALL): tree-clean-p .tarball-version ChangeLog
|
|
|
|
mkdir -p $(OUT)
|
|
|
|
($(GIT_LS_FILES) --exclude=$(OUT);\
|
|
|
|
echo $^ | tr ' ' '\n' | grep -Ev 'tree-clean-p')\
|
|
|
|
| tar --transform=s,^,$(TARBALL_DIR)/,S -T- -czf $@
|
|
|
|
|
2016-10-16 06:14:50 +00:00
|
|
|
ChangeLog:
|
2016-10-15 22:34:23 +00:00
|
|
|
build-aux/gitlog-to-changelog > $@
|
|
|
|
|
2016-10-16 06:14:50 +00:00
|
|
|
install: all ChangeLog
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
2016-10-15 22:34:23 +00:00
|
|
|
install mes $(DESTDIR)$(PREFIX)/bin/mes
|
|
|
|
install scripts/elf.mes $(DESTDIR)$(PREFIX)/bin/elf.mes
|
2016-10-16 06:14:50 +00:00
|
|
|
install scripts/include.mes $(DESTDIR)$(PREFIX)/bin/include.mes
|
2016-10-15 22:34:23 +00:00
|
|
|
install scripts/mescc.mes $(DESTDIR)$(PREFIX)/bin/mescc.mes
|
|
|
|
install scripts/repl.mes $(DESTDIR)$(PREFIX)/bin/repl.mes
|
|
|
|
install scripts/paren.mes $(DESTDIR)$(PREFIX)/bin/paren.mes
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/mes
|
|
|
|
$(GIT_ARCHIVE_HEAD) module\
|
|
|
|
| tar -C $(DESTDIR)$(PREFIX)/share/mes -xf-
|
2016-12-07 19:26:41 +00:00
|
|
|
cp module/mes/read-0.mo $(DESTDIR)$(PREFIX)/share/mes/module/mes
|
|
|
|
sed -i -e 's@module/@$(PREFIX)/share/mes/module/@' \
|
|
|
|
$(DESTDIR)$(PREFIX)/share/mes/module/mes/base-0.mes \
|
|
|
|
$(DESTDIR)$(PREFIX)/bin/elf.mes \
|
|
|
|
$(DESTDIR)$(PREFIX)/bin/mescc.mes \
|
|
|
|
$(DESTDIR)$(PREFIX)/bin/repl.mes \
|
|
|
|
$(DESTDIR)$(PREFIX)/bin/paren.mes
|
2016-10-16 06:14:50 +00:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/doc/mes
|
|
|
|
$(GIT_ARCHIVE_HEAD) $(READMES) \
|
|
|
|
| tar -C $(DESTDIR)$(PREFIX)/share/doc/mes -xf-
|
|
|
|
$(GIT_ARCHIVE_HEAD) doc \
|
|
|
|
| tar -C $(DESTDIR)$(PREFIX)/share/doc/mes --strip=1 -xf-
|
|
|
|
cp ChangeLog $(DESTDIR)$(PREFIX)/share/doc/mes
|
2016-10-15 22:34:23 +00:00
|
|
|
|
|
|
|
release: tree-clean-p check dist
|
|
|
|
git tag v$(VERSION)
|
|
|
|
git push --tags origin master
|
|
|
|
git push origin master
|
2016-10-18 21:50:09 +00:00
|
|
|
|
|
|
|
$(GUIX-HASH): tree-clean-p
|
|
|
|
rm -rf out/mes && mkdir -p out && git clone . out/mes && guix hash -rx out/mes > $@
|
|
|
|
|
|
|
|
update-hash: $(GUIX-HASH) .tarball-version
|
|
|
|
@echo -n hash:
|
|
|
|
cat $^
|
|
|
|
sed -i \
|
|
|
|
-e 's,(base32 "[^"]*"),(base32 "$(shell cat $<)"),'\
|
|
|
|
-e 's,(commit "[^"]*"),(commit "$(shell cat .tarball-version)"),'\
|
|
|
|
-e 's,(version "[^"]*"),(version "$(VERSION).$(shell cut -b1-8 .tarball-version)"),'\
|
|
|
|
guix.scm
|
|
|
|
! git diff --exit-code
|
|
|
|
git commit -m 'guix hash: $(shell cat $<)' guix.scm
|
|
|
|
|