Makefile.gdoci   [plain text]


# -*- makefile -*-
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Simon Josefsson.
#
# This file is part of GNU Libidn.
#
# GNU Libidn is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# GNU Libidn is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with GNU Libidn; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

BUILT_SOURCES = Makefile.gdoc

Makefile.gdoc: $(top_builddir)/configure Makefile.am Makefile.gdoci $(GDOC_SRC)
	echo '# This file is automatically generated.  DO NOT EDIT!          -*- makefile -*-' > Makefile.gdoc
	echo >> Makefile.gdoc
	echo 'gdoc_TEXINFOS =' >> Makefile.gdoc
	echo 'gdoc_MANS =' >> Makefile.gdoc
	echo >> Makefile.gdoc
	for file in $(GDOC_SRC); do \
	  shortfile=`basename $$file`; \
	  echo "#" >> Makefile.gdoc; \
	  echo "### $$shortfile" >> Makefile.gdoc; \
	  echo "#" >> Makefile.gdoc; \
	  echo "gdoc_TEXINFOS += $(GDOC_TEXI_PREFIX)$$shortfile.texi" >> Makefile.gdoc; \
	  echo "$(GDOC_TEXI_PREFIX)$$shortfile.texi: $$file" >> Makefile.gdoc; \
	  echo 'TABmkdir -p `dirname $$@`' | sed "s/TAB/	/" >> Makefile.gdoc; \
	  echo 'TAB$$(PERL) $$(top_srcdir)/doc/gdoc -texinfo $$(GDOC_TEXI_EXTRA_ARGS) $$< > $$@' | sed "s/TAB/	/" >> Makefile.gdoc; \
	  echo >> Makefile.gdoc; \
	  functions=`$(PERL) $(srcdir)/gdoc -listfunc $$file`; \
	  for function in $$functions; do \
	    echo "# $$shortfile: $$function" >> Makefile.gdoc; \
	    echo "gdoc_TEXINFOS += $(GDOC_TEXI_PREFIX)$$function.texi" >> Makefile.gdoc; \
	    echo "$(GDOC_TEXI_PREFIX)$$function.texi: $$file" >> Makefile.gdoc; \
	    echo 'TABmkdir -p `dirname $$@`' | sed "s/TAB/	/" >> Makefile.gdoc; \
	    echo 'TAB$$(PERL) $$(top_srcdir)/doc/gdoc -texinfo $$(GDOC_TEXI_EXTRA_ARGS) -function'" $$function"' $$< > $$@' | sed "s/TAB/	/" >> Makefile.gdoc; \
	    echo >> Makefile.gdoc; \
	    echo "gdoc_MANS += $(GDOC_MAN_PREFIX)$$function.3" >> Makefile.gdoc; \
	    echo "$(GDOC_MAN_PREFIX)$$function.3: $$file" >> Makefile.gdoc; \
	    echo 'TABmkdir -p `dirname $$@`' | sed "s/TAB/	/" >> Makefile.gdoc; \
	    echo 'TAB$$(PERL) $$(top_srcdir)/doc/gdoc -man $$(GDOC_MAN_EXTRA_ARGS) -function'" $$function"' $$< > $$@' | sed "s/TAB/	/" >> Makefile.gdoc; \
	    echo >> Makefile.gdoc; \
	  done; \
	  echo >> Makefile.gdoc; \
	done
	$(MAKE) Makefile

include Makefile.gdoc