# vim:ts=2
# makefile for realpath

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)
	po4a  $(XGETTEXT_COMMON_OPTIONS)          \
	      --previous                          \
	      -v                                  \
	      --variable srcdir=../..             \
	      --variable builddir=$(bdir)         \
	      po4a.cfg
	$(AT) touch "$@"

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


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


.PHONY: update-po
