*** ../gnome-doc-utils/gnome-doc-utils.make	Sat Feb 18 22:47:21 2006
--- ./gnome-doc-utils.make	Thu Feb 23 16:17:29 2006
***************
*** 128,133 ****
--- 128,134 ----
  _chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
  _credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
  _ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
+ _menusub ?= `$(PKG_CONFIG) --variable menusub gnome-doc-utils`
  
  _sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
  
***************
*** 342,347 ****
--- 343,352 ----
  ## The top-level documentation file in the C locale
  _DOC_C_MODULE = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml)
  
+ ## @ _DOC_C_MODULE_IN
+ ## The top-level input documentation file in the C locale
+ _DOC_C_MODULE_IN = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml.in)
+ 
  ## @ _DOC_C_ENTITIES
  ## Files included with a SYSTEM entity in the C locale
  _DOC_C_ENTITIES = $(foreach ent,$(DOC_ENTITIES),C/$(ent))
***************
*** 350,355 ****
--- 355,364 ----
  ## Files included with XInclude in the C locale
  _DOC_C_INCLUDES = $(foreach inc,$(DOC_INCLUDES),C/$(inc))
  
+ ## @ _DOC_C_INCLUDES_IN
+ ## Input Files included with a SYSTEM entity in the C locale
+ _DOC_C_INCLUDES_IN = $(foreach ent,$(DOC_INCLUDES),C/$(ent).in)
+ 
  ## @ _DOC_C_DOCS
  ## All documentation files in the C locale
  _DOC_C_DOCS =								\
***************
*** 357,362 ****
--- 366,381 ----
  	$(_RNGDOC_C_DOCS)	$(_XSLDOC_C_DOCS)			\
  	$(_DOC_C_MODULE)
  
+ ## @ _DOC_C_DOCS_IN
+ ## All documentation files in the C locale
+ _DOC_C_DOCS_IN =								\
+ 	$(_DOC_C_INCLUDES_IN)	$(_DOC_C_MODULE_IN)
+ 
+ ## @ _DOC_C_DOCS_XML
+ ## All xml documentation files in the C locale
+ _DOC_C_DOCS_XML =								\
+ 	$(_DOC_C_INCLUDES)	$(_DOC_C_MODULE)	C/menu-location.xml
+ 
  ## @ _DOC_C_DOCS_NOENT
  ## All documentation files in the C locale,
  ## except files included with a SYSTEM entity
***************
*** 434,440 ****
  	$(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(DOC_LINGUAS),	\
  		$(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) ))
  
! $(_DOC_POFILES):
  	@if ! test -d $(dir $@); then \
  	  echo "mkdir $(dir $@)"; \
  	  mkdir "$(dir $@)"; \
--- 453,459 ----
  	$(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(DOC_LINGUAS),	\
  		$(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) ))
  
! $(_DOC_POFILES): $(_DOC_C_DOCS)
  	@if ! test -d $(dir $@); then \
  	  echo "mkdir $(dir $@)"; \
  	  mkdir "$(dir $@)"; \
***************
*** 465,470 ****
--- 484,506 ----
  	    $(_xml2po) -e -u $(notdir $@) $$docs); \
  	fi
  
+ # Conversion of C/*.xml.in to C/*.xml
+ # DOC_DESKTOP_FILE Needs to be defined !
+ $(_DOC_C_DOCS) : $(_DOC_C_DOCS_IN)
+ 	@if ! test x$(DOC_DESKTOP_FILE) = x; then \
+ 		if ! test -f C/menu-location.xml; then \
+ 			get-menu-location $(DOC_DESKTOP_FILE) C/menu-location.xml; \
+ 		fi; \
+ 		sed -e "s/&/XXXAMPXXX/g" -e "s/^<!DOCTYPE /<!--DOCTYPE /" -e "s/^]>/]-->/" C/$(notdir $@).in > $$.tmp1; \
+ 		xsltproc -o $$.tmp2 --stringparam menu-location "`pwd`/C/menu-location.xml" $(_menusub) $$.tmp1;  \
+ 		sed -e "s/XXXAMPXXX/\&/g" -e "s/^<!--DOCTYPE /<!DOCTYPE /" -e "s/^]-->/]>/" $$.tmp2 > C/$(notdir $@); \
+ 		rm -f $$.tmp1 $$.tmp2; \
+ 	else \
+ 		if [ -f C/$(notdir $@).in ]; then \
+ 			cp -f C/$(notdir $@).in C/$(notdir $@); \
+ 		fi; \
+ 	fi
+ 	
  # FIXME: fix the dependancy
  # FIXME: hook xml2po up
  $(_DOC_LC_DOCS) : $(_DOC_POFILES)
***************
*** 510,521 ****
  endif
  
  all:							\
  	$(_DOC_C_DOCS)		$(_DOC_LC_DOCS)		\
  	$(_DOC_OMF_ALL)		$(_DOC_DSK_ALL)		\
  	$(_DOC_HTML_ALL)	$(_DOC_POFILES)
  
  
! .PHONY: clean-doc-rngdoc clean-doc-xsldoc clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
  
  clean-doc-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
  clean-doc-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
--- 546,558 ----
  endif
  
  all:							\
+ 	$(_DOC_C_DOCS_IN)	\
  	$(_DOC_C_DOCS)		$(_DOC_LC_DOCS)		\
  	$(_DOC_OMF_ALL)		$(_DOC_DSK_ALL)		\
  	$(_DOC_HTML_ALL)	$(_DOC_POFILES)
  
  
! .PHONY: clean-doc-rngdoc clean-doc-xsldoc clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir clean-doc-xml
  
  clean-doc-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
  clean-doc-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
***************
*** 535,540 ****
--- 572,579 ----
  	    rm -f "$$lc/.xml2po.mo"; \
  	  fi; \
  	done
+ clean-doc-xml:
+ 	rm -f $(_DOC_C_DOCS_XML)
  clean-doc-dir:
  	@for lc in C $(DOC_LINGUAS); do \
  	  for dir in `find $$lc -depth -type d`; do \
***************
*** 550,574 ****
  _clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
  _clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
  _clean_lc  = $(if $(DOC_LINGUAS),clean-doc-lc)
  _clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
  
  clean-local:						\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_dir)
  distclean-local:					\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_dir)
  mostlyclean-local:					\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_dir)
  maintainer-clean-local:					\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_dir)
! 
  
  .PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
  doc-dist-hook: 					\
--- 589,617 ----
  _clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
  _clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
  _clean_lc  = $(if $(DOC_LINGUAS),clean-doc-lc)
+ _clean_xml = $(if $(DOC_MODULE),clean-doc-xml)
  _clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
  
  clean-local:						\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_xml)		\
! 	$(_clean_dir)
  distclean-local:					\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_xml)		\
! 	$(_clean_dir)
  mostlyclean-local:					\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_xml)		\
! 	$(_clean_dir)
  maintainer-clean-local:					\
  	$(_clean_rngdoc)	$(_clean_xsldoc)	\
  	$(_clean_omf)		$(_clean_dsk)		\
! 	$(_clean_lc)		$(_clean_xml)		\
! 	$(_clean_dir)
  
  .PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
  doc-dist-hook: 					\
***************
*** 705,711 ****
  uninstall-local:					\
  	$(if $(DOC_MODULE),uninstall-doc-docs)		\
  	$(if $(_DOC_HTML_ALL),uninstall-doc-html)	\
! 	$(if $(_DOC_C_FIGURES),uninstall-doc-figs)	\
  	$(if $(_DOC_OMF_IN),uninstall-doc-omf)
  #	$(if $(_DOC_DSK_IN),uninstall-doc-dsk)
  
--- 748,754 ----
  uninstall-local:					\
  	$(if $(DOC_MODULE),uninstall-doc-docs)		\
  	$(if $(_DOC_HTML_ALL),uninstall-doc-html)	\
! 	$(if $(_DOC_FIGURES),uninstall-doc-figs)		\
  	$(if $(_DOC_OMF_IN),uninstall-doc-omf)
  #	$(if $(_DOC_DSK_IN),uninstall-doc-dsk)
  
