build: Support all `Standard targets' for users.

* GNUmakefile (distclean mostlyclean, maintainer-clean, html, dvi, ps,
  install-dvi, install-ps, install-html, installcheck): New target.
  (install-info): Remove fake target.
* configure (parse-opts): Add --srcdir.

xx
This commit is contained in:
Jan Nieuwenhuizen 2018-07-23 20:03:57 +02:00
parent 84a3e2e1fe
commit 3140b0ed44
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
3 changed files with 142 additions and 14 deletions

View file

@ -18,9 +18,9 @@
GUILE_FLAGS:=--no-auto-compile -L . -L module -C . -C module GUILE_FLAGS:=--no-auto-compile -L . -L module -C . -C module
cleaning_p:=$(filter clean%, $(MAKECMDGOALS)) cleaning-p:=$(filter clean%, $(MAKECMDGOALS))$(filter %clean, $(MAKECMDGOALS))
ifndef cleaning_p ifndef cleaning-p
ifndef config.make ifndef config.make
config.make:=.config.make config.make:=.config.make
include $(config.make) include $(config.make)
@ -29,9 +29,43 @@ $(config.make):
endif endif
endif endif
PHONY_TARGETS:= all all-go build check clean clean-go default dist doc help install\ PHONY_TARGETS:=\
install-info man gcc mes ${top_builddest}src/mes mes-gcc mes-tcc generate-ChangeLog\ ${top_builddest}src/mes\
uninstall TAGS\
all-go\
all\
build\
check\
clean-go\
clean\
default\
dist\
distclean\
doc\
dvi\
gcc\
generate-ChangeLog\
help\
html\
info\
install-dvi\
install-html\
install-pdf\
install-ps\
install-strip\
install\
installcheck\
installdirs\
maintainer-clean\
man\
mes-gcc\
mes-tcc\
mes\
mostlyclean\
pdf\
ps\
uninstall\
#
.PHONY: $(PHONY_TARGETS) .PHONY: $(PHONY_TARGETS)
@ -62,6 +96,14 @@ mes:
clean: clean:
git clean -dfx git clean -dfx
# Mes does not cache anything on the file system; therefore clean
distclean: clean
mostlyclean: clean
maintainer-clean: clean
TAGS:
etags lib/*.c lib/*/*.c src/*.c include/*.h include/sys/*.h
all-go: all-go:
build-aux/build-guile.sh build-aux/build-guile.sh
@ -71,6 +113,10 @@ clean-go:
check: check:
./check.sh ./check.sh
# Mes does not feature post-install checks yet, so we're great!
installcheck:
true
install: ${top_builddest}src/mes install: ${top_builddest}src/mes
./install.sh ./install.sh
@ -130,8 +176,6 @@ else
$(warning info: graphvis missing: no images) $(warning info: graphvis missing: no images)
endif endif
install-info: info
man: ${top_builddest}doc/mes.1 ${top_builddest}doc/mescc.1 man: ${top_builddest}doc/mes.1 ${top_builddest}doc/mescc.1
${top_builddest}src/mes: build ${top_builddest}src/mes: build
@ -142,15 +186,25 @@ ${top_builddest}doc/mes.1: ${top_builddest}src/mes
${top_builddest}doc/mescc.1: ${top_builddest}src/mes ${top_builddest}scripts/mescc ${top_builddest}doc/mescc.1: ${top_builddest}src/mes ${top_builddest}scripts/mescc
MES_ARENA=10000000 ${top_builddir}/pre-inst-env $(HELP2MAN) $(<F) > $@ MES_ARENA=10000000 ${top_builddir}/pre-inst-env $(HELP2MAN) $(<F) > $@
html: ${top_builddest}mes/index.html html: ${top_builddest}doc/html/index.html
${top_builddest}mes/index.html: doc/mes.texi ${top_builddest}doc/images/gcc-mesboot-graph.png ${top_builddest}doc/html/index.html: doc/mes.texi ${top_builddest}doc/version.texi ${top_builddest}doc/images/gcc-mesboot-graph.png
$(MAKEINFO) --html -o ${top_builddest}doc/mes $< $(MAKEINFO) --html -o $(@D) -I ${top_builddest}doc -I doc $<
dvi: ${top_builddest}doc/mes.dvi
${top_builddest}doc/mes.dvi: doc/mes.texi
$(MAKEINFO) --dvi -I ${top_builddest}/doc -I doc -o doc/mes.dvi $<
pdf: ${top_builddest}doc/mes.pdf pdf: ${top_builddest}doc/mes.pdf
${top_builddest}doc/mes.pdf: doc/mes.texi ${top_builddest}doc/mes.pdf: doc/mes.texi
$(MAKEINFO) --pdf -I ${top_builddest}/doc -o doc/mes.pdf $< $(MAKEINFO) --pdf -I ${top_builddest}/doc -I doc -o doc/mes.pdf $<
ps: ${top_builddest}doc/mes.ps
${top_builddest}doc/mes.ps: doc/mes.texi
$(MAKEINFO) --ps -I ${top_builddest}/doc -I doc -o doc/mes.ps $<
### dist ### dist
COMMIT=$(shell test -d .git && (git describe --dirty 2>/dev/null) || cat .tarball-version) COMMIT=$(shell test -d .git && (git describe --dirty 2>/dev/null) || cat .tarball-version)
@ -198,10 +252,38 @@ endif
release: update-hash release: update-hash
./pre-inst-env $(GUIX) build mes@$(VERSION) --with-source=$(TARBALL) ./pre-inst-env $(GUIX) build mes@$(VERSION) --with-source=$(TARBALL)
installdirs: mkinstalldirs
mkdir -p\
$(DESTDIR)$(bindir)\
$(DESTDIR)$(datadir)\
$(DESTDIR)$(libdir)\
$(DESTDIR)$(infodir)\
$(DESTDIR)$(mandir)
install-dvi: dvi
mkdir -p $(DESTDIR)${docdir}
cp ${top_builddest}doc/mes.dvi $(DESTDIR)${docdir}
install-html: html
mkdir -p $(DESTDIR)${docdir}
tar -cf- -C ${top_builddest}doc html | tar -xf- -C $(DESTDIR)${docdir}
install-pdf: pdf
mkdir -p $(DESTDIR)${docdir}
cp ${top_builddest}doc/mes.pdf $(DESTDIR)${docdir}
install-ps: ps
mkdir -p $(DESTDIR)${docdir}
cp ${top_builddest}doc/mes.ps $(DESTDIR)${docdir}
# We do not strip binaries, binutils' strip corrupts M1+hex2-generated ELFs
install-strip: install
define HELP_TOP define HELP_TOP
Usage: make [OPTION]... [TARGET]... Usage: make [OPTION]... [TARGET]...
Targets: Main and non-standard targets:
all update everything all update everything
all-go update .go files all-go update .go files
gcc update src/mes.gcc-out gcc update src/mes.gcc-out
@ -216,6 +298,7 @@ Targets:
info update info documentation info update info documentation
install install in $(prefix) install install in $(prefix)
install-info install info docs in $(prefix)/share/info install-info install info docs in $(prefix)/share/info
release dist and tag
seed update mes-seed in $(MES_SEED) seed update mes-seed in $(MES_SEED)
uninstall uninstall from $(prefix) uninstall uninstall from $(prefix)
endef endef

View file

@ -16,14 +16,58 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. # along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
PHONY_TARGETS:= all all-go build check clean clean-go default dist doc help install\ PHONY_TARGETS:=\
install-info man gcc mes src/mes mes-gcc mes-tcc uninstall ${top_builddest}src/mes\
TAGS\
all-go\
all\
build\
check\
clean-go\
clean\
default\
dist\
distclean\
doc\
dvi\
gcc\
generate-ChangeLog\
help\
html\
info\
install-dvi\
install-html\
install-pdf\
install-ps\
install-strip\
install\
installcheck\
installdirs\
maintainer-clean\
man\
mes-gcc\
mes-tcc\
mes\
mostlyclean\
pdf\
ps\
uninstall\
#
.PHONY: $(PHONY_TARGETS) .PHONY: $(PHONY_TARGETS)
default: all default: all
cleaning-p:=$(filter clean%, $(MAKECMDGOALS))$(filter %clean, $(MAKECMDGOALS))
ifndef cleaning-p
$(PHONY_TARGETS): $(PHONY_TARGETS):
$(MAKE) -C $(srcdir) $@ $(MAKE) -C $(srcdir) $@
endif
clean:
git clean -dfx
include .config.make include .config.make
config.make:=$(PWD)/.config.make config.make:=$(PWD)/.config.make

1
configure vendored
View file

@ -216,6 +216,7 @@ exec ${guile} -L . --no-auto-compile -e '(configure)' -s "$0" ${1+"$@"}
(datadir (value #t)) (datadir (value #t))
(docdir (value #t)) (docdir (value #t))
(libdir (value #t)) (libdir (value #t))
(srcdir (value #t))
(sysconfdir (value #t)) (sysconfdir (value #t))
(verbose (single-char #\v)) (verbose (single-char #\v))
(with-courage) (with-courage)