| 1 |
# Makefile for program source directory in GNU NLS utilities package. |
| 2 |
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <[email protected]> |
| 3 |
# Copyright 2003 Free Software Foundation, Inc. |
| 4 |
# |
| 5 |
# This file may be copied and used freely without restrictions. It can |
| 6 |
# be used in projects which are not available under the GNU Public License |
| 7 |
# but which still want to provide support for the GNU gettext functionality. |
| 8 |
# Please note that the actual code is *not* freely available. |
| 9 |
|
| 10 |
PACKAGE = @PACKAGE@ |
| 11 |
VERSION = @VERSION@ |
| 12 |
|
| 13 |
SHELL = /bin/sh |
| 14 |
@SET_MAKE@ |
| 15 |
|
| 16 |
srcdir = @srcdir@ |
| 17 |
top_srcdir = @top_srcdir@ |
| 18 |
VPATH = @srcdir@ |
| 19 |
|
| 20 |
prefix = @prefix@ |
| 21 |
exec_prefix = @exec_prefix@ |
| 22 |
datadir = $(prefix)/@DATADIRNAME@ |
| 23 |
localedir = $(datadir)/locale |
| 24 |
gnulocaledir = $(prefix)/share/locale |
| 25 |
gettextsrcdir = $(prefix)/share/gettext/po |
| 26 |
subdir = po |
| 27 |
|
| 28 |
DESTDIR = |
| 29 |
|
| 30 |
INSTALL = @INSTALL@ |
| 31 |
INSTALL_DATA = @INSTALL_DATA@ |
| 32 |
MKINSTALLDIRS = @MKINSTALLDIRS@ |
| 33 |
|
| 34 |
CC = @CC@ |
| 35 |
GENCAT = @GENCAT@ |
| 36 |
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ |
| 37 |
MSGFMT = @MSGFMT@ |
| 38 |
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ |
| 39 |
MSGMERGE = PATH=../src:$$PATH msgmerge |
| 40 |
|
| 41 |
DEFS = @DEFS@ |
| 42 |
CFLAGS = @CFLAGS@ |
| 43 |
CPPFLAGS = @CPPFLAGS@ |
| 44 |
|
| 45 |
INCLUDES = -I.. -I$(top_srcdir)/intl |
| 46 |
|
| 47 |
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
| 48 |
|
| 49 |
SOURCES = cat-id-tbl.c |
| 50 |
POFILES = @POFILES@ |
| 51 |
GMOFILES = @GMOFILES@ |
| 52 |
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ |
| 53 |
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) |
| 54 |
|
| 55 |
POTFILES = \ |
| 56 |
|
| 57 |
CATALOGS = @CATALOGS@ |
| 58 |
CATOBJEXT = @CATOBJEXT@ |
| 59 |
INSTOBJEXT = @INSTOBJEXT@ |
| 60 |
|
| 61 |
.SUFFIXES: |
| 62 |
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat |
| 63 |
|
| 64 |
.c.o: |
| 65 |
$(COMPILE) $< |
| 66 |
|
| 67 |
.po.pox: |
| 68 |
$(MAKE) $(PACKAGE).pot |
| 69 |
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox |
| 70 |
|
| 71 |
.po.mo: |
| 72 |
$(MSGFMT) -o $@ $< |
| 73 |
|
| 74 |
.po.gmo: |
| 75 |
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
| 76 |
&& rm -f $$file && $(GMSGFMT) -o $$file $< |
| 77 |
|
| 78 |
.po.cat: |
| 79 |
sed -f ../intl/po2msg.sed < $< > $*.msg \ |
| 80 |
&& rm -f $@ && $(GENCAT) $@ $*.msg |
| 81 |
|
| 82 |
|
| 83 |
all: all-@USE_NLS@ |
| 84 |
|
| 85 |
all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot |
| 86 |
all-no: |
| 87 |
|
| 88 |
$(srcdir)/$(PACKAGE).pot: $(POTFILES) |
| 89 |
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ |
| 90 |
--add-comments --keyword=_ --keyword=N_ \ |
| 91 |
--files-from=$(srcdir)/POTFILES.in |
| 92 |
rm -f $(srcdir)/$(PACKAGE).pot |
| 93 |
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot |
| 94 |
|
| 95 |
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: |
| 96 |
$(srcdir)/stamp-cat-id: $(PACKAGE).pot |
| 97 |
rm -f cat-id-tbl.tmp |
| 98 |
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ |
| 99 |
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp |
| 100 |
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ |
| 101 |
rm cat-id-tbl.tmp; \ |
| 102 |
else \ |
| 103 |
echo cat-id-tbl.c changed; \ |
| 104 |
rm -f $(srcdir)/cat-id-tbl.c; \ |
| 105 |
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ |
| 106 |
fi |
| 107 |
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id |
| 108 |
|
| 109 |
|
| 110 |
install: install-exec install-data |
| 111 |
install-exec: |
| 112 |
install-info: |
| 113 |
install-data: install-data-@USE_NLS@ |
| 114 |
install-data-no: all |
| 115 |
install-data-yes: all |
| 116 |
if test -r $(MKINSTALLDIRS); then \ |
| 117 |
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ |
| 118 |
else \ |
| 119 |
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ |
| 120 |
fi |
| 121 |
@catalogs='$(CATALOGS)'; \ |
| 122 |
for cat in $$catalogs; do \ |
| 123 |
cat=`basename $$cat`; \ |
| 124 |
case "$$cat" in \ |
| 125 |
*.gmo) destdir=$(gnulocaledir);; \ |
| 126 |
*) destdir=$(localedir);; \ |
| 127 |
esac; \ |
| 128 |
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
| 129 |
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ |
| 130 |
if test -r $(MKINSTALLDIRS); then \ |
| 131 |
$(MKINSTALLDIRS) $$dir; \ |
| 132 |
else \ |
| 133 |
$(top_srcdir)/mkinstalldirs $$dir; \ |
| 134 |
fi; \ |
| 135 |
if test -r $$cat; then \ |
| 136 |
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ |
| 137 |
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ |
| 138 |
else \ |
| 139 |
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ |
| 140 |
echo "installing $(srcdir)/$$cat as" \ |
| 141 |
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ |
| 142 |
fi; \ |
| 143 |
if test -r $$cat.m; then \ |
| 144 |
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ |
| 145 |
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ |
| 146 |
else \ |
| 147 |
if test -r $(srcdir)/$$cat.m ; then \ |
| 148 |
$(INSTALL_DATA) $(srcdir)/$$cat.m \ |
| 149 |
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \ |
| 150 |
echo "installing $(srcdir)/$$cat as" \ |
| 151 |
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ |
| 152 |
else \ |
| 153 |
true; \ |
| 154 |
fi; \ |
| 155 |
fi; \ |
| 156 |
done |
| 157 |
if test "$(PACKAGE)" = "gettext"; then \ |
| 158 |
if test -r $(MKINSTALLDIRS); then \ |
| 159 |
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ |
| 160 |
else \ |
| 161 |
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ |
| 162 |
fi; \ |
| 163 |
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
| 164 |
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
| 165 |
else \ |
| 166 |
: ; \ |
| 167 |
fi |
| 168 |
|
| 169 |
# Define this as empty until I found a useful application. |
| 170 |
installcheck: |
| 171 |
|
| 172 |
uninstall: |
| 173 |
catalogs='$(CATALOGS)'; \ |
| 174 |
for cat in $$catalogs; do \ |
| 175 |
cat=`basename $$cat`; \ |
| 176 |
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
| 177 |
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ |
| 178 |
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ |
| 179 |
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ |
| 180 |
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ |
| 181 |
done |
| 182 |
rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in |
| 183 |
|
| 184 |
check: all |
| 185 |
|
| 186 |
cat-id-tbl.o: ../intl/libgettext.h |
| 187 |
|
| 188 |
dvi info tags TAGS ID: |
| 189 |
|
| 190 |
mostlyclean: |
| 191 |
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp |
| 192 |
rm -fr *.o |
| 193 |
|
| 194 |
clean: mostlyclean |
| 195 |
|
| 196 |
distclean: clean |
| 197 |
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m |
| 198 |
|
| 199 |
maintainer-clean: distclean |
| 200 |
@echo "This command is intended for maintainers to use;" |
| 201 |
@echo "it deletes files that may require special tools to rebuild." |
| 202 |
rm -f $(GMOFILES) |
| 203 |
|
| 204 |
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) |
| 205 |
dist distdir: update-po $(DISTFILES) |
| 206 |
dists="$(DISTFILES)"; \ |
| 207 |
for file in $$dists; do \ |
| 208 |
ln $(srcdir)/$$file $(distdir) 2> /dev/null \ |
| 209 |
|| cp -p $(srcdir)/$$file $(distdir); \ |
| 210 |
done |
| 211 |
|
| 212 |
update-po: Makefile |
| 213 |
$(MAKE) $(PACKAGE).pot |
| 214 |
PATH=`pwd`/../src:$$PATH; \ |
| 215 |
cd $(srcdir); \ |
| 216 |
catalogs='$(CATALOGS)'; \ |
| 217 |
for cat in $$catalogs; do \ |
| 218 |
cat=`basename $$cat`; \ |
| 219 |
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
| 220 |
mv $$lang.po $$lang.old.po; \ |
| 221 |
echo "$$lang:"; \ |
| 222 |
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ |
| 223 |
rm -f $$lang.old.po; \ |
| 224 |
else \ |
| 225 |
echo "msgmerge for $$cat failed!"; \ |
| 226 |
rm -f $$lang.po; \ |
| 227 |
mv $$lang.old.po $$lang.po; \ |
| 228 |
fi; \ |
| 229 |
done |
| 230 |
|
| 231 |
POTFILES: POTFILES.in |
| 232 |
( if test 'x$(srcdir)' != 'x.'; then \ |
| 233 |
posrcprefix='$(top_srcdir)/'; \ |
| 234 |
else \ |
| 235 |
posrcprefix="../"; \ |
| 236 |
fi; \ |
| 237 |
rm -f $@-t $@ \ |
| 238 |
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \ |
| 239 |
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/[email protected] \ |
| 240 |
| sed -e '$$s/\\$$//') > $@-t \ |
| 241 |
&& chmod a-w $@-t \ |
| 242 |
&& mv $@-t $@ ) |
| 243 |
|
| 244 |
POTFILES.in: @MAINT@ ../Makefile |
| 245 |
cd .. && $(MAKE) po/POTFILES.in |
| 246 |
|
| 247 |
Makefile: Make-in ../config.status POTFILES |
| 248 |
cd .. \ |
| 249 |
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \ |
| 250 |
CONFIG_HEADERS= $(SHELL) ./config.status |
| 251 |
|
| 252 |
# Tell versions [3.59,3.63) of GNU make not to export all variables. |
| 253 |
# Otherwise a system limit (for SysV at least) may be exceeded. |
| 254 |
.NOEXPORT: |