1998-01-26 23:09:01 +01:00
|
|
|
# Makefile for program source directory in GNU NLS utilities package.
|
1998-02-26 17:56:31 +01:00
|
|
|
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
1998-01-26 23:09:01 +01:00
|
|
|
#
|
1998-09-14 17:48:36 +02:00
|
|
|
# This file file be copied and used freely without restrictions. It can
|
1998-02-26 17:56:31 +01:00
|
|
|
# be used in projects which are not available under the GNU Public License
|
|
|
|
# but which still want to provide support for the GNU gettext functionality.
|
|
|
|
# Please note that the actual code is *not* freely available.
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
PACKAGE = @PACKAGE@
|
|
|
|
VERSION = @VERSION@
|
|
|
|
|
|
|
|
SHELL = /bin/sh
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
datadir = $(prefix)/@DATADIRNAME@
|
|
|
|
localedir = $(datadir)/locale
|
|
|
|
gnulocaledir = $(prefix)/share/locale
|
1998-02-26 17:56:31 +01:00
|
|
|
gettextsrcdir = $(prefix)/share/gettext/po
|
1998-01-26 23:09:01 +01:00
|
|
|
subdir = po
|
|
|
|
|
|
|
|
INSTALL = @INSTALL@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
1998-10-07 15:30:43 +02:00
|
|
|
### This doe not work: MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
|
|
|
|
MKINSTALLDIRS = $(top_srcdir)/scripts/mkinstalldirs
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
CC = @CC@
|
|
|
|
GENCAT = @GENCAT@
|
1998-02-26 17:56:31 +01:00
|
|
|
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
1998-01-26 23:09:01 +01:00
|
|
|
MSGFMT = @MSGFMT@
|
1998-02-26 17:56:31 +01:00
|
|
|
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
|
|
|
MSGMERGE = PATH=../src:$$PATH msgmerge
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
DEFS = @DEFS@
|
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
|
|
|
|
INCLUDES = -I.. -I$(top_srcdir)/intl
|
|
|
|
|
|
|
|
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
|
|
|
|
|
|
|
SOURCES = cat-id-tbl.c
|
|
|
|
POFILES = @POFILES@
|
|
|
|
GMOFILES = @GMOFILES@
|
|
|
|
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
1998-02-26 17:56:31 +01:00
|
|
|
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
POTFILES = \
|
|
|
|
|
|
|
|
CATALOGS = @CATALOGS@
|
|
|
|
CATOBJEXT = @CATOBJEXT@
|
|
|
|
INSTOBJEXT = @INSTOBJEXT@
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(COMPILE) $<
|
|
|
|
|
|
|
|
.po.pox:
|
|
|
|
$(MAKE) $(PACKAGE).pot
|
1998-02-26 17:56:31 +01:00
|
|
|
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
.po.mo:
|
|
|
|
$(MSGFMT) -o $@ $<
|
|
|
|
|
|
|
|
.po.gmo:
|
|
|
|
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
|
|
|
&& rm -f $$file && $(GMSGFMT) -o $$file $<
|
|
|
|
|
|
|
|
.po.cat:
|
|
|
|
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
|
|
|
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
|
|
|
|
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
all: all-@USE_NLS@
|
|
|
|
|
|
|
|
all-yes: cat-id-tbl.c $(CATALOGS)
|
|
|
|
all-no:
|
1998-01-26 23:09:01 +01:00
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
1998-01-26 23:09:01 +01:00
|
|
|
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
|
|
|
--add-comments --keyword=_ --keyword=N_ \
|
1998-09-14 17:48:36 +02:00
|
|
|
--files-from=$(srcdir)/POTFILES.in \
|
|
|
|
&& test ! -f $(PACKAGE).po \
|
|
|
|
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
|
|
|
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
1998-01-26 23:09:01 +01:00
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
|
|
|
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
|
|
|
rm -f cat-id-tbl.tmp
|
1998-01-26 23:09:01 +01:00
|
|
|
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
1998-02-26 17:56:31 +01:00
|
|
|
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
|
|
|
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
|
|
|
rm cat-id-tbl.tmp; \
|
1998-01-26 23:09:01 +01:00
|
|
|
else \
|
|
|
|
echo cat-id-tbl.c changed; \
|
|
|
|
rm -f $(srcdir)/cat-id-tbl.c; \
|
1998-02-26 17:56:31 +01:00
|
|
|
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
1998-01-26 23:09:01 +01:00
|
|
|
fi
|
|
|
|
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
|
|
|
|
|
|
|
|
|
|
|
install: install-exec install-data
|
|
|
|
install-exec:
|
1998-02-26 17:56:31 +01:00
|
|
|
install-data: install-data-@USE_NLS@
|
|
|
|
install-data-no: all
|
|
|
|
install-data-yes: all
|
1998-09-14 17:48:36 +02:00
|
|
|
if test -r "$(MKINSTALLDIRS)"; then \
|
1998-02-26 17:56:31 +01:00
|
|
|
$(MKINSTALLDIRS) $(datadir); \
|
|
|
|
else \
|
1998-09-14 17:48:36 +02:00
|
|
|
$(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
|
1998-02-26 17:56:31 +01:00
|
|
|
fi
|
|
|
|
@catalogs='$(CATALOGS)'; \
|
1998-01-26 23:09:01 +01:00
|
|
|
for cat in $$catalogs; do \
|
1998-02-26 17:56:31 +01:00
|
|
|
cat=`basename $$cat`; \
|
|
|
|
case "$$cat" in \
|
|
|
|
*.gmo) destdir=$(gnulocaledir);; \
|
1998-10-07 15:30:43 +02:00
|
|
|
*) destdir=$(localedir);; \
|
1998-02-26 17:56:31 +01:00
|
|
|
esac; \
|
|
|
|
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
|
|
|
dir=$$destdir/$$lang/LC_MESSAGES; \
|
1998-09-14 17:48:36 +02:00
|
|
|
if test -r "$(MKINSTALLDIRS)"; then \
|
1998-02-26 17:56:31 +01:00
|
|
|
$(MKINSTALLDIRS) $$dir; \
|
1998-01-26 23:09:01 +01:00
|
|
|
else \
|
1998-09-14 17:48:36 +02:00
|
|
|
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
|
1998-01-26 23:09:01 +01:00
|
|
|
fi; \
|
|
|
|
if test -r $$cat; then \
|
|
|
|
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
1998-02-26 17:56:31 +01:00
|
|
|
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
1998-01-26 23:09:01 +01:00
|
|
|
else \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
1998-02-26 17:56:31 +01:00
|
|
|
echo "installing $(srcdir)/$$cat as" \
|
|
|
|
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
|
|
|
fi; \
|
|
|
|
if test -r $$cat.m; then \
|
|
|
|
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
|
|
|
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
|
|
|
else \
|
|
|
|
if test -r $(srcdir)/$$cat.m ; then \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
|
|
|
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
|
|
|
echo "installing $(srcdir)/$$cat as" \
|
|
|
|
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
|
|
|
else \
|
|
|
|
true; \
|
|
|
|
fi; \
|
1998-01-26 23:09:01 +01:00
|
|
|
fi; \
|
|
|
|
done
|
1998-02-26 17:56:31 +01:00
|
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
1998-09-14 17:48:36 +02:00
|
|
|
if test -r "$(MKINSTALLDIRS)"; then \
|
1998-02-26 17:56:31 +01:00
|
|
|
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
|
|
|
else \
|
1998-09-14 17:48:36 +02:00
|
|
|
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
1998-02-26 17:56:31 +01:00
|
|
|
fi; \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
|
|
|
$(gettextsrcdir)/Makefile.in.in; \
|
|
|
|
else \
|
|
|
|
: ; \
|
|
|
|
fi
|
1998-01-26 23:09:01 +01:00
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
# Define this as empty until I found a useful application.
|
|
|
|
installcheck:
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
1998-02-26 17:56:31 +01:00
|
|
|
cat=`basename $$cat`; \
|
|
|
|
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
1998-01-26 23:09:01 +01:00
|
|
|
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
1998-02-26 17:56:31 +01:00
|
|
|
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
1998-01-26 23:09:01 +01:00
|
|
|
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
1998-02-26 17:56:31 +01:00
|
|
|
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
1998-01-26 23:09:01 +01:00
|
|
|
done
|
|
|
|
rm -f $(gettextsrcdir)/po-Makefile.in.in
|
|
|
|
|
|
|
|
check: all
|
|
|
|
|
|
|
|
cat-id-tbl.o: ../intl/libgettext.h
|
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
dvi info tags TAGS ID:
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
mostlyclean:
|
1998-02-26 17:56:31 +01:00
|
|
|
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
|
|
|
|
rm -fr *.o
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
clean: mostlyclean
|
|
|
|
|
|
|
|
distclean: clean
|
1998-02-26 17:56:31 +01:00
|
|
|
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
maintainer-clean: distclean
|
|
|
|
@echo "This command is intended for maintainers to use;"
|
|
|
|
@echo "it deletes files that may require special tools to rebuild."
|
1998-02-26 17:56:31 +01:00
|
|
|
rm -f $(GMOFILES)
|
|
|
|
|
|
|
|
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
|
|
|
dist distdir: update-po $(DISTFILES)
|
|
|
|
dists="$(DISTFILES)"; \
|
|
|
|
for file in $$dists; do \
|
|
|
|
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
|
|
|
|| cp -p $(srcdir)/$$file $(distdir); \
|
1998-01-26 23:09:01 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
update-po: Makefile
|
|
|
|
$(MAKE) $(PACKAGE).pot
|
1998-02-26 17:56:31 +01:00
|
|
|
PATH=`pwd`/../src:$$PATH; \
|
1998-01-26 23:09:01 +01:00
|
|
|
cd $(srcdir); \
|
|
|
|
catalogs='$(CATALOGS)'; \
|
|
|
|
for cat in $$catalogs; do \
|
1998-02-26 17:56:31 +01:00
|
|
|
cat=`basename $$cat`; \
|
|
|
|
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
1998-01-26 23:09:01 +01:00
|
|
|
mv $$lang.po $$lang.old.po; \
|
1998-02-26 17:56:31 +01:00
|
|
|
echo "$$lang:"; \
|
|
|
|
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
1998-01-26 23:09:01 +01:00
|
|
|
rm -f $$lang.old.po; \
|
|
|
|
else \
|
1998-02-26 17:56:31 +01:00
|
|
|
echo "msgmerge for $$cat failed!"; \
|
1998-01-26 23:09:01 +01:00
|
|
|
rm -f $$lang.po; \
|
|
|
|
mv $$lang.old.po $$lang.po; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
POTFILES: POTFILES.in
|
|
|
|
( if test 'x$(srcdir)' != 'x.'; then \
|
|
|
|
posrcprefix='$(top_srcdir)/'; \
|
|
|
|
else \
|
|
|
|
posrcprefix="../"; \
|
|
|
|
fi; \
|
1998-02-26 17:56:31 +01:00
|
|
|
rm -f $@-t $@ \
|
1998-10-07 15:30:43 +02:00
|
|
|
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \
|
|
|
|
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
1998-02-26 17:56:31 +01:00
|
|
|
| sed -e '$$s/\\$$//') > $@-t \
|
|
|
|
&& chmod a-w $@-t \
|
|
|
|
&& mv $@-t $@ )
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
Makefile: Makefile.in.in ../config.status POTFILES
|
1998-02-26 17:56:31 +01:00
|
|
|
cd .. \
|
|
|
|
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
|
|
|
$(SHELL) ./config.status
|
1998-01-26 23:09:01 +01:00
|
|
|
|
|
|
|
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
|
|
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
|
|
.NOEXPORT:
|