# vim:ts=2
# makefile for realpath
# $Id: Makefile 229 2009-02-22 11:56:47Z robert $
#

ALL_TARGET=build-local
SUBDIRS=
include ../../common.mk

SOURCE_FILES=$(shell sed -ne 's/^\[type: man\] \$$(srcdir)\/\([^ ]*\)*.*$$/..\/..\/\1/p' < po4a.cfg)
build-local: $(bdir)/stamp-po4a
  
$(bdir)/stamp-po4a: po4a.cfg $(wildcard *.po) $(SOURCE_FILES) $(MAKEFILE_LIST)
	$(call msg,$@)
	po4a  $(XGETTEXT_COMMON_OPTIONS)          \
	      --previous                          \
	      -v                                  \
	      --variable srcdir=../..             \
	      --variable builddir=$(bdir)         \
	      po4a.cfg
	touch "$@"

install-local: $(bdir)/stamp-po4a
	$(call msg,$@)
	set -e; \
	cd $(bdir); \
	for file in */man*/*.[123456789]; do          \
	  basedir=`dirname $$file`;                   \
	  dir=$(mandir)/$$basedir;         						\
	  $(call install,$$dir,$$file,compress)       \
	done


update-po:
	$(call msg,$@)
	po4a  $(XGETTEXT_COMMON_OPTIONS)          \
	      --previous                          \
	      --force                             \
	      -v                                  \
	      --variable srcdir=../..             \
	      --variable builddir=$(bdir)         \
	      po4a.cfg


.PHONY: update-po
