From: Yann Dirson Date: Sun, 20 Oct 2013 20:07:19 +0000 (+0200) Subject: Fix various regression for building out of tree. X-Git-Url: http://winboard.nl/cgi-bin?p=gnushogi.git;a=commitdiff_plain;h=d73f8bba14816990072cd219147d2dc9a498d614 Fix various regression for building out of tree. Most notably, doc was never buildable out of tree, but the recent build enhancements did not take that into account. --- diff --git a/Makefile.in b/Makefile.in index a5694ce..93b5f1d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,8 +25,10 @@ # VERSION = 1.3.2 -GNUSHOGIDIR = ./gnushogi -XSHOGIDIR = ./xshogi +ROOT = @top_srcdir@ +BUILDROOT = @top_builddir@ +GNUSHOGIDIR = $(BUILDROOT)/gnushogi +XSHOGIDIR = $(BUILDROOT)/xshogi # # Default targets. @@ -40,19 +42,19 @@ all : gnushogi_compile pat2inc gnushogi.bbk @XSHOGI@ # gnushogi_compile: - -cd $(GNUSHOGIDIR); $(MAKE) gnushogi + -cd $(GNUSHOGIDIR) && $(MAKE) gnushogi pat2inc: - -cd $(GNUSHOGIDIR); $(MAKE) pat2inc + -cd $(GNUSHOGIDIR) && $(MAKE) pat2inc sizetest: - -cd $(GNUSHOGIDIR); $(MAKE) sizetest + -cd $(GNUSHOGIDIR) && $(MAKE) sizetest xshogi_compile: - -cd $(XSHOGIDIR); $(MAKE) + -cd $(XSHOGIDIR) && $(MAKE) gnushogi.bbk: - -cd $(GNUSHOGIDIR); $(MAKE) gnushogi.bbk + -cd $(GNUSHOGIDIR) && $(MAKE) gnushogi.bbk # @@ -62,10 +64,10 @@ gnushogi.bbk: install: gnushogi_install @XSHOGIINSTALL@ gnushogi_install: - -cd $(GNUSHOGIDIR); $(MAKE) install + -cd $(GNUSHOGIDIR) && $(MAKE) install xshogi_install: $(XSHOGIDIR)/xshogi - -cd $(XSHOGIDIR); $(MAKE) install + -cd $(XSHOGIDIR) && $(MAKE) install @@ -76,13 +78,13 @@ xshogi_install: $(XSHOGIDIR)/xshogi clean: gnushogi_clean @XSHOGICLEAN@ doc_clean gnushogi_clean: - cd $(GNUSHOGIDIR); $(MAKE) clean + cd $(GNUSHOGIDIR) && $(MAKE) clean xshogi_clean: - cd $(XSHOGIDIR); $(MAKE) clean + cd $(XSHOGIDIR) && $(MAKE) clean doc_clean: - cd doc; $(MAKE) clean + cd $(BUILDROOT)/doc && $(MAKE) clean # @@ -95,8 +97,8 @@ dist: $(MAKE) maintainerclean rm -rf $(DISTNAME) mkdir $(DISTNAME) - tar -cf - --exclude .git . | (cd $(DISTNAME) && tar -xf -) - cd $(DISTNAME) && ./autogen.sh && ./configure + tar -cf - --exclude .git $(ROOT) | (cd $(DISTNAME) && tar -xf -) + cd $(DISTNAME) && $(ROOT)/autogen.sh && $(ROOT)/configure cd $(DISTNAME)/doc && $(MAKE) info cd $(DISTNAME) && make distclean tar -zcf $(DISTNAME).tar.gz $(DISTNAME) @@ -112,7 +114,7 @@ DISTCLEANFILES = \ distclean: clean rm -rf $(DISTCLEANFILES) - cd doc; $(MAKE) distclean + cd $(BUILDROOT)/doc && $(MAKE) distclean # # Extra cleanup, for the maintainer only. @@ -122,4 +124,4 @@ MAINTAINERCLEANFILES = configure config.h.in maintainerclean: distclean rm -f $(MAINTAINERCLEANFILES) - cd doc; $(MAKE) maintainerclean + cd $(BUILDROOT)/doc && $(MAKE) maintainerclean diff --git a/configure.ac b/configure.ac index edd3168..2f21d60 100644 --- a/configure.ac +++ b/configure.ac @@ -186,5 +186,6 @@ AC_SUBST(XSHOGICLEAN) AC_CONFIG_FILES([Makefile gnushogi/Makefile gnushogi/Makefile.profile + doc/Makefile xshogi/Makefile]) AC_OUTPUT diff --git a/doc/Makefile b/doc/Makefile.in similarity index 75% rename from doc/Makefile rename to doc/Makefile.in index 8b93ab6..7fd7993 100644 --- a/doc/Makefile +++ b/doc/Makefile.in @@ -3,21 +3,22 @@ DISTCLEANFILES = *.ps *.html CLEANFILES = *.log *.dvi *.aux *.dlog \ *.cp *.cps *.fn *.ky *.pg *.toc *.tp *.vr +SRCDIR = @srcdir@ info: - makeinfo gnushogi.texinfo + makeinfo $(SRCDIR)/gnushogi.texinfo dvi: - texi2dvi gnushogi.texinfo + texi2dvi $(SRCDIR)/gnushogi.texinfo pdf: - texi2pdf gnushogi.texinfo + texi2pdf $(SRCDIR)/gnushogi.texinfo # I do some egregious hacks to get around limitations of # texi2html. html: - texi2html -split_node gnushogi.texinfo + texi2html -split_node $(SRCDIR)/gnushogi.texinfo ps: dvi dvips -t letter gnushogi.dvi -o gnushogi.ps @@ -26,7 +27,7 @@ ps2: dvi dvi2ps gnushogi.dvi > gnushogi.ps spell: - tr '[A-Z]' '[a-z]' < gnushogi.texinfo | tr -cd '[A-Za-z0-9_ \012]' | \ + tr '[A-Z]' '[a-z]' < $(SRCDIR)/gnushogi.texinfo | tr -cd '[A-Za-z0-9_ \012]' | \ tr -s '[ ]' '\012' | sort | uniq -c | sort -nr | spell | sort | uniq clean: diff --git a/gnushogi/Makefile.in b/gnushogi/Makefile.in index f48a1b0..1596717 100644 --- a/gnushogi/Makefile.in +++ b/gnushogi/Makefile.in @@ -91,7 +91,7 @@ BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnushogi.bbk\" # obtain such a pattern in the opening stage. Sequences of opening # patterns may be described in order to support the correct order of moves. -PATTERN = -DPATTERNFILE=\"../misc/gnushogi.pat\" +PATTERN = -DPATTERNFILE=\"$(ROOT)/misc/gnushogi.pat\" all: