2016-10-16 06:14:50 +00:00
|
|
|
.PHONY: tree-clean-p
|
|
|
|
|
|
|
|
READMES:=\
|
|
|
|
AUTHORS\
|
|
|
|
COPYING\
|
|
|
|
HACKING\
|
2017-04-02 16:50:07 +00:00
|
|
|
INSTALL\
|
2016-10-16 06:14:50 +00:00
|
|
|
NEWS\
|
2017-04-02 16:50:07 +00:00
|
|
|
README\
|
2016-10-16 06:14:50 +00:00
|
|
|
#
|
|
|
|
|
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
|
2017-04-02 16:50:07 +00:00
|
|
|
ifeq ($(wildcard .git/HEAD),)
|
2016-10-15 22:34:23 +00:00
|
|
|
GIT_ARCHIVE_HEAD:=tar -cf-
|
|
|
|
GIT_LS_FILES:=find
|
|
|
|
endif
|
|
|
|
|
2017-04-02 16:50:07 +00:00
|
|
|
ifeq ($(GUIX),)
|
|
|
|
DATADIR:=$(PREFIX)/share/mes
|
|
|
|
DOCDIR:=$(DATADIR)/doc/mes
|
|
|
|
else
|
|
|
|
DATADIR:=$(PREFIX)/share
|
|
|
|
DOCDIR:=$(DATADIR)/doc
|
|
|
|
endif
|
2017-04-12 19:27:59 +00:00
|
|
|
LIBDIR:=$(PREFIX)/lib
|
2017-05-05 20:13:01 +00:00
|
|
|
|
2017-04-12 19:27:59 +00:00
|
|
|
GODIR:=$(LIBDIR)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
|
2017-05-05 20:13:01 +00:00
|
|
|
GUILEDIR:=$(PREFIX)/share/guile/site/$(GUILE_EFFECTIVE_VERSION)
|
|
|
|
MODULEDIR:=$(DATADIR)/module
|
2017-04-02 16:50:07 +00:00
|
|
|
|
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 > $@
|
|
|
|
|
2017-04-12 19:27:59 +00:00
|
|
|
|
|
|
|
#FIXME: INSTALL like CLEAN
|
|
|
|
INSTALL_SCM_FILES:=
|
|
|
|
INSTALL_GO_FILES:=
|
|
|
|
install: $(CLEAN) ChangeLog
|
2016-10-16 06:14:50 +00:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
2017-04-12 19:27:59 +00:00
|
|
|
install $(OUT)/mes $(DESTDIR)$(PREFIX)/bin/mes
|
2017-05-28 16:32:53 +00:00
|
|
|
ifneq ($(MES_BOOTSTRAP),)
|
core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
(mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
[!MES_FULL]: Include reader.c.
(main) [!MES_FULL]: By default call load_env, only call bload_env
when --load is supplied. WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
(dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
module/mes/tiny-0-32.mo): Remove targets.
(CLEAN): Do not add them. Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 14:03:45 +00:00
|
|
|
install $(OUT)/mes.mes $(DESTDIR)$(PREFIX)/bin/mes.mes
|
|
|
|
endif
|
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
|
2017-04-02 16:50:07 +00:00
|
|
|
install guile/mescc.scm $(DESTDIR)$(PREFIX)/bin/mescc.scm
|
|
|
|
mkdir -p $(DESTDIR)$(DATADIR)
|
2016-10-15 22:34:23 +00:00
|
|
|
$(GIT_ARCHIVE_HEAD) module\
|
2017-04-02 16:50:07 +00:00
|
|
|
| tar -C $(DESTDIR)$(DATADIR) -xf-
|
|
|
|
$(GIT_ARCHIVE_HEAD) guile\
|
|
|
|
| tar -C $(DESTDIR)$(DATADIR) -xf-
|
|
|
|
sed -i \
|
|
|
|
-e 's,module/,$(DATADIR)/module/,' \
|
|
|
|
-e 's,@DATADIR@,$(DATADIR)/,g' \
|
|
|
|
-e 's,@DOCDIR@,$(DOCDIR)/,g' \
|
2017-04-12 19:27:59 +00:00
|
|
|
-e 's,@GODIR@,$(GODIR)/,g' \
|
2017-05-05 20:13:01 +00:00
|
|
|
-e 's,@GUILEDIR@,$(GUILEDIR)/,g' \
|
2017-04-12 19:27:59 +00:00
|
|
|
-e 's,@MODULEDIR@,$(MODULEDIR)/,g' \
|
2017-04-02 16:50:07 +00:00
|
|
|
-e 's,@PREFIX@,$(PREFIX)/,g' \
|
|
|
|
-e 's,@VERSION@,$(VERSION),g' \
|
|
|
|
$(DESTDIR)$(DATADIR)/module/mes/base-0.mes \
|
2017-04-12 19:27:59 +00:00
|
|
|
$(DESTDIR)$(DATADIR)/module/language/c99/compiler.mes \
|
2016-12-07 19:26:41 +00:00
|
|
|
$(DESTDIR)$(PREFIX)/bin/mescc.mes \
|
2017-04-02 16:50:07 +00:00
|
|
|
$(DESTDIR)$(PREFIX)/bin/mescc.scm \
|
|
|
|
$(DESTDIR)$(PREFIX)/bin/repl.mes
|
|
|
|
mkdir -p $(DESTDIR)$(DOCDIR)
|
2016-10-16 06:14:50 +00:00
|
|
|
$(GIT_ARCHIVE_HEAD) $(READMES) \
|
2017-04-02 16:50:07 +00:00
|
|
|
| tar -C $(DESTDIR)$(DOCDIR) -xf-
|
2016-10-16 06:14:50 +00:00
|
|
|
$(GIT_ARCHIVE_HEAD) doc \
|
2017-04-02 16:50:07 +00:00
|
|
|
| tar -C $(DESTDIR)$(DOCDIR) --strip=1 -xf-
|
|
|
|
cp ChangeLog $(DESTDIR)$(DOCDIR)
|
2017-05-05 20:13:01 +00:00
|
|
|
mkdir -p $(DESTDIR)$(GUILEDIR)
|
2017-04-12 19:27:59 +00:00
|
|
|
tar -cf- -C module $(INSTALL_SCM_FILES:module/%=%)\
|
2017-05-05 20:13:01 +00:00
|
|
|
| tar -C $(DESTDIR)$(GUILEDIR) -xf-
|
2017-04-12 19:27:59 +00:00
|
|
|
mkdir -p $(DESTDIR)$(GODIR)
|
|
|
|
tar -cf- -C module $(INSTALL_GO_FILES:module/%=%)\
|
|
|
|
| tar -C $(DESTDIR)$(GODIR) -xf-
|
2017-05-23 05:16:08 +00:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/lib
|
2017-06-03 10:11:57 +00:00
|
|
|
$(GIT_ARCHIVE_HEAD) mlibc/include \
|
|
|
|
| tar -C $(DESTDIR)$(PREFIX)/share -xf-
|
|
|
|
cp out/mlibc/libc-mes.guile-o $(DESTDIR)$(PREFIX)/lib/libc-mes.o
|
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)"),'\
|
2017-05-02 14:58:56 +00:00
|
|
|
-e 's,(version "[^g][^"]*"),(version "$(VERSION)"),'\
|
2016-10-18 21:50:09 +00:00
|
|
|
guix.scm
|
|
|
|
! git diff --exit-code
|
|
|
|
git commit -m 'guix hash: $(shell cat $<)' guix.scm
|
|
|
|
|