#
# Makefile for the po directory of the Red Hat install program
#

ALLSOURCES = $(wildcard ../*.c)
POFILES	   = $(wildcard *.po)
NLSPACKAGE = rhinstall
MAINPOT	   = $(NLSPACKAGE).pot

all: $(NLSPACKAGE).pot

clean:

update-po: $(MAINPOT)
	@for n in $(POFILES); do \
	    echo "msgmerge $$n $(MAINPOT)" ;\
	    msgmerge $$n $(MAINPOT) > $$n.t && \
	    mv -f $$n.t $$n ;\
	done

refresh-po:
	@for n in $(POFILES); do \
	    echo "msgmerge $$n $(MAINPOT)" ;\
	    msgmerge $$n $(MAINPOT) > $$n.t && \
	    mv -f $$n.t $$n ;\
	done

$(MAINPOT): $(ALLSOURCES)
	xgettext --default-domain=$(NLSPACKAGE) --add-comments \
	         --keyword=_ --keyword=N_ $(ALLSOURCES)
	if cmp -s $(NLSPACKAGE).po $(MAINPOT); then \
	    rm -f $(NLSPACKAGE).po; \
	else \
	    mv $(NLSPACKAGE).po $(MAINPOT) ; \
	fi

check-po: $(POFILES)
	@for n in $(POFILES); do \
	    echo Checking $$n... ; \
	    msgfmt -v $$n -o /dev/null ; \
	    echo ; \
	done 
