From d73f8bba14816990072cd219147d2dc9a498d614 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 20 Oct 2013 22:07:19 +0200 Subject: [PATCH] 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. --- Makefile.in | 34 ++++++++++++++++++---------------- configure.ac | 1 + doc/Makefile | 45 --------------------------------------------- doc/Makefile.in | 46 ++++++++++++++++++++++++++++++++++++++++++++++ gnushogi/Makefile.in | 2 +- 5 files changed, 66 insertions(+), 62 deletions(-) delete mode 100644 doc/Makefile create mode 100644 doc/Makefile.in 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 deleted file mode 100644 index 8b93ab6..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -MAINTAINERCLEANFILES = *.info* -DISTCLEANFILES = *.ps *.html -CLEANFILES = *.log *.dvi *.aux *.dlog \ - *.cp *.cps *.fn *.ky *.pg *.toc *.tp *.vr - - -info: - makeinfo gnushogi.texinfo - -dvi: - texi2dvi gnushogi.texinfo - -pdf: - texi2pdf gnushogi.texinfo - -# I do some egregious hacks to get around limitations of -# texi2html. - -html: - texi2html -split_node gnushogi.texinfo - -ps: dvi - dvips -t letter gnushogi.dvi -o gnushogi.ps - -ps2: dvi - dvi2ps gnushogi.dvi > gnushogi.ps - -spell: - tr '[A-Z]' '[a-z]' < gnushogi.texinfo | tr -cd '[A-Za-z0-9_ \012]' | \ - tr -s '[ ]' '\012' | sort | uniq -c | sort -nr | spell | sort | uniq - -clean: - @for file in $(CLEANFILES); \ - do if [ -f $$file ]; then rm $$file; fi; \ - done - -distclean: clean - @for file in $(DISTCLEANFILES); \ - do if [ -f $$file ]; then rm $$file; fi; \ - done - -maintainerclean: distclean - @for file in $(MAINTAINERCLEANFILES); \ - do if [ -f $$file ]; then rm $$file; fi; \ - done diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..7fd7993 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,46 @@ +MAINTAINERCLEANFILES = *.info* +DISTCLEANFILES = *.ps *.html +CLEANFILES = *.log *.dvi *.aux *.dlog \ + *.cp *.cps *.fn *.ky *.pg *.toc *.tp *.vr + +SRCDIR = @srcdir@ + +info: + makeinfo $(SRCDIR)/gnushogi.texinfo + +dvi: + texi2dvi $(SRCDIR)/gnushogi.texinfo + +pdf: + texi2pdf $(SRCDIR)/gnushogi.texinfo + +# I do some egregious hacks to get around limitations of +# texi2html. + +html: + texi2html -split_node $(SRCDIR)/gnushogi.texinfo + +ps: dvi + dvips -t letter gnushogi.dvi -o gnushogi.ps + +ps2: dvi + dvi2ps gnushogi.dvi > gnushogi.ps + +spell: + 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: + @for file in $(CLEANFILES); \ + do if [ -f $$file ]; then rm $$file; fi; \ + done + +distclean: clean + @for file in $(DISTCLEANFILES); \ + do if [ -f $$file ]; then rm $$file; fi; \ + done + +maintainerclean: distclean + @for file in $(MAINTAINERCLEANFILES); \ + do if [ -f $$file ]; then rm $$file; fi; \ + done 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: -- 1.7.0.4