Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: VPATH doc build fixes



Hello,

This is a small patch for the zsh Makefile system to allow building the
documentation in the current directory, not in the source directory.
I do almost all builds in a separate directory (VPATH builds) with a
readonly source directory, and zsh supports this, except for the
documentation-building process.

I thought it would be nice if zsh would also support a VPATH build where
it doesn't touch anything in the source directories.

The patch is against zsh-CVS 2002-01-09.

The change to zshconfig.ac is a hack to ensure that the Doc/Zsh directory
exists in the build directory.  There could be a cleaner way to do this,
but I didn't have the time to figure out something better.
I also noticed that the arguments of texi2html were messed up.
I tested the patch on a Linux-Mandrake 8.1 system.

This could be a ChangeLog entry:

	* zshconfig.ac: Ensure that $builddir/Doc/Zsh exists for building
	the documentation (a hack).
	* Doc/Makefile.in (TEXI2HTML): Fixed the arguments of texi2html.
	* Doc/Makefile.in: Build documentation in the build
	directory, not in the source directory.
	This allows readonly VPATH builds.


Best Regards,
Octavian Cerna
yLabs

---
zsh: The Emacs of all shells.
--- zshconfig.ac.orig	Wed Jan  9 01:51:49 2002
+++ zshconfig.ac	Wed Jan  9 01:55:50 2002
@@ -1966,6 +1966,9 @@
 AC_SUBST_FILE(DEFS_MK)dnl
 AC_SUBST_FILE(VERSION_MK)dnl
 
+# Ensure that $builddir/Doc/Zsh exists
+test -d Doc/Zsh || $SHELL $srcdir/mkinstalldirs Doc/Zsh
+
 AC_OUTPUT(Config/defs.mk Makefile Doc/Makefile Etc/Makefile Src/Makefile \
 Test/Makefile, \
 [test -z "$CONFIG_HEADERS" || echo > stamp-h])
--- Doc/Makefile.in.orig	Wed Jan  9 01:46:26 2002
+++ Doc/Makefile.in	Fri Jan 11 13:09:05 2002
@@ -40,7 +40,7 @@
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
 DVIPS = dvips
-TEXI2HTML = texi2html -expand info -split chapter
+TEXI2HTML = texi2html -expandinfo -split_chapter
 
 .SUFFIXES: .yo .1
 
@@ -83,31 +83,27 @@
 dvi: zsh.dvi
 .PHONY: dvi
 
-zsh.dvi: $(sdir)/zsh.texi
-	$(TEXI2DVI) $(sdir)/zsh.texi
+zsh.dvi: zsh.texi
+	$(TEXI2DVI) zsh.texi
 
-texi: $(sdir)/zsh.texi
+texi: zsh.texi
 .PHONY: texi
 
-$(sdir)/zsh.texi:
+zsh.texi:
 	$(YODL) -o $@ -I$(sdir) -w ztexi.yo version.yo zsh.yo; \
 	test -f $@
 
 info: zsh.info
 .PHONY: info
 
-zsh.info: $(sdir)/zsh.texi
-	$(MAKEINFO) $(sdir)/zsh.texi
+zsh.info: zsh.texi
+	$(MAKEINFO) zsh.texi
 
 .yo.1:
-	case $@ in \
-	  */*) target=$@ ;; \
-	  *) target=$(sdir)/$@ ;; \
-	esac; \
 	case '$(YODL)' in :*) ;; *) \
-	    $(YODL) -I$(sdir) -w zman.yo version.yo $< | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target \
+	    $(YODL) -I$(sdir) -w zman.yo version.yo $< | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $@ \
 	;; esac; \
-	test -f $$target
+	test -f $@
 
 ps: us_ps a4_ps
 .PHONY: ps
@@ -127,28 +123,24 @@
 html: zsh_toc.html
 .PHONY: html
 
-zsh_toc.html: $(sdir)/zsh.texi
-	$(TEXI2HTML) $(sdir)/zsh.texi
+zsh_toc.html: zsh.texi
+	$(TEXI2HTML) zsh.texi
 
 zshall.1: zsh.yo
-	case $@ in \
-	  */*) target=$@ ;; \
-	  *) target=$(sdir)/$@ ;; \
-	esac; \
 	case '$(YODL)' in :*) ;; *) \
-	    $(YODL) -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target \
+	    $(YODL) -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $@ \
 	;; esac; \
-	test -f $$target
+	test -f $@
 
 ../META-FAQ: META-FAQ.yo Zsh/metafaq.yo
 	case '$(YODL)' in :*) ;; *) \
-	    $(YODL) -I$(sdir) META-FAQ.yo | sed -e '/NEXTLINE/N' -e '/DELLINE/d' -e '/^SECTHEAD$$/{N;s/^SECTHEAD.//;h;s/./-/g;H;g;}' -e 's/  *$$//' > $(sdir_top)/META-FAQ \
+	    $(YODL) -I$(sdir) META-FAQ.yo | sed -e '/NEXTLINE/N' -e '/DELLINE/d' -e '/^SECTHEAD$$/{N;s/^SECTHEAD.//;h;s/./-/g;H;g;}' -e 's/  *$$//' > $@ \
 	;; esac
-	test -f $(sdir_top)/META-FAQ
+	test -f $@
 
 $(YODLDOC): version.yo
 
-$(sdir)/zsh.texi: $(YODLSRC)
+zsh.texi: $(YODLSRC)
 
 man: $(MAN)
 .PHONY: man
@@ -190,7 +182,7 @@
 	  echo 'def(version)(0)('$(VERSION)')'; \
 	  echo 'def(date)(0)('$(VERSION_DATE)')'; \
 	  echo 'ENDDEF()#' | tr '#' '\\'; \
-	) > $(sdir)/version.yo
+	) > $@
 
 Zsh/modlist.yo: $(MODDOCSRC)
 	( \
@@ -218,7 +210,7 @@
 		mod1=$$mod2; \
 		mod2=$$mod3; \
 	    done \
-	) > $(sdir)/Zsh/modlist.yo
+	) > $@
 
 Zsh/modmenu.yo: $(MODDOCSRC)
 	( \
@@ -228,7 +220,7 @@
 		    < $(sdir)/$$modfile; \
 	    done; \
 	    echo "endmenu()" \
-	) > $(sdir)/Zsh/modmenu.yo
+	) > $@
 
 Zsh/manmodmenu.yo: $(MODDOCSRC)
 	( \
@@ -236,7 +228,7 @@
 		sed -n '1{s|^COMMENT(!MOD!\(.*\)$$|menu(The \1 Module)|;p;q;}' \
 		    < $(sdir)/$$modfile; \
 	    done \
-	) > $(sdir)/Zsh/manmodmenu.yo
+	) > $@
 
 # ========== DEPENDENCIES FOR INSTALLING ==========
 
@@ -252,7 +244,7 @@
 install.man: man
 	${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(mandir)/man1
 	for file in $(MAN); do \
-	    $(INSTALL_DATA) $(sdir)/$$file $(DESTDIR)$(mandir)/man1/`echo $$file | sed 's|zsh|$(tzsh)|'` || exit 1; \
+	    $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man1/`echo $$file | sed 's|zsh|$(tzsh)|'` || exit 1; \
 	done
 .PHONY: install.man
 
@@ -263,7 +255,7 @@
 	mkdir infodir
 	if ( \
 	    sed '/^@setfilename/s|zsh|$(tzsh)|' \
-		< $(sdir)/zsh.texi > infodir/tzsh.texi && \
+		< zsh.texi > infodir/tzsh.texi && \
 	    (cd infodir && $(MAKEINFO) tzsh.texi) && \
 	    for file in infodir/$(tzsh).info*; do \
 		$(INSTALL_DATA) $$file $(DESTDIR)$(infodir) || exit 1; \
@@ -321,8 +313,8 @@
 .PHONY: distclean-here
 
 realclean-here: distclean-here
-	cd $(sdir) && rm -f Zsh/modlist.yo Zsh/modmenu.yo Zsh/manmodmenu.yo
-	cd $(sdir) && rm -f version.yo ../META-FAQ zsh.texi $(MAN)
+	rm -f Zsh/modlist.yo Zsh/modmenu.yo Zsh/manmodmenu.yo
+	rm -f version.yo ../META-FAQ zsh.texi $(MAN)
 .PHONY: realclean-here
 
 @CLEAN_MK@


Messages sorted by: Reverse Date, Date, Thread, Author