1# Makefile for program source directory in GNU NLS utilities package. 2# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu> 3# Copyright 2001, 2003, 2006 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 10PACKAGE = @PACKAGE@ 11VERSION = @VERSION@ 12 13SHELL = /bin/sh 14@SET_MAKE@ 15 16srcdir = @srcdir@ 17top_srcdir = @top_srcdir@ 18VPATH = @srcdir@ 19top_builddir = @top_builddir@ 20 21prefix = @prefix@ 22exec_prefix = @exec_prefix@ 23datadir = $(prefix)/@DATADIRNAME@ 24localedir = $(datadir)/locale 25gnulocaledir = $(prefix)/share/locale 26gettextsrcdir = $(prefix)/share/gettext/po 27subdir = po 28 29DESTDIR = 30 31INSTALL = @INSTALL@ 32INSTALL_DATA = @INSTALL_DATA@ 33MKINSTALLDIRS = @MKINSTALLDIRS@ 34 35CC = @CC@ 36GENCAT = @GENCAT@ 37GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ 38MSGFMT = @MSGFMT@ 39XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ 40MSGMERGE = PATH=../src:$$PATH msgmerge 41 42DEFS = @DEFS@ 43CFLAGS = @CFLAGS@ 44CPPFLAGS = @CPPFLAGS@ 45 46INCLUDES = -I.. -I$(top_srcdir)/intl 47 48COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) 49 50SOURCES = cat-id-tbl.c 51POFILES = @POFILES@ 52GMOFILES = @GMOFILES@ 53DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \ 54stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) 55 56# Note - the following line gets processed by bfd/configure and amended 57# to contain the full list of source dir POTFILES. 58SRC-POTFILES = \ 59 60# Note - the following line gets processed by bfd/configure and amended 61# to contain the full list of build dir POTFILES. 62BLD-POTFILES = \ 63 64CATALOGS = @CATALOGS@ 65CATOBJEXT = @CATOBJEXT@ 66INSTOBJEXT = @INSTOBJEXT@ 67 68.SUFFIXES: 69.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat 70 71.c.o: 72 $(COMPILE) $< 73 74.po.pox: 75 $(MAKE) $(PACKAGE).pot 76 $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox 77 78.po.mo: 79 $(MSGFMT) -o $@ $< 80 81.po.gmo: 82 file=`echo $* | sed 's,.*/,,'`.gmo \ 83 && rm -f $$file && $(GMSGFMT) -o $$file $< 84 85.po.cat: 86 sed -f ../intl/po2msg.sed < $< > $*.msg \ 87 && rm -f $@ && $(GENCAT) $@ $*.msg 88 89 90all: all-@USE_NLS@ 91 92all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot 93all-no: 94 95$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES) 96 $(XGETTEXT) --default-domain=$(PACKAGE) \ 97 --directory=$(top_srcdir) \ 98 --add-comments --keyword=_ --keyword=N_ \ 99 --files-from=$(srcdir)/SRC-POTFILES.in 100 $(XGETTEXT) --default-domain=$(PACKAGE) \ 101 --directory=.. \ 102 --directory=. \ 103 --add-comments --keyword=_ --keyword=N_ \ 104 --join-existing \ 105 --files-from=$(srcdir)/BLD-POTFILES.in 106 rm -f $(srcdir)/$(PACKAGE).pot 107 mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot 108 109$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: 110$(srcdir)/stamp-cat-id: $(PACKAGE).pot 111 rm -f cat-id-tbl.tmp 112 sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ 113 | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp 114 if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ 115 rm cat-id-tbl.tmp; \ 116 else \ 117 echo cat-id-tbl.c changed; \ 118 rm -f $(srcdir)/cat-id-tbl.c; \ 119 mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ 120 fi 121 cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id 122 123 124install: install-exec install-data 125install-exec: 126install-info: 127install-html: 128install-data: install-data-@USE_NLS@ 129install-data-no: all 130install-data-yes: all 131 if test -r $(MKINSTALLDIRS); then \ 132 $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ 133 else \ 134 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ 135 fi 136 @catalogs='$(CATALOGS)'; \ 137 for cat in $$catalogs; do \ 138 cat=`basename $$cat`; \ 139 case "$$cat" in \ 140 *.gmo) destdir=$(gnulocaledir);; \ 141 *) destdir=$(localedir);; \ 142 esac; \ 143 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ 144 dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ 145 if test -r $(MKINSTALLDIRS); then \ 146 $(MKINSTALLDIRS) $$dir; \ 147 else \ 148 $(top_srcdir)/mkinstalldirs $$dir; \ 149 fi; \ 150 if test -r $$cat; then \ 151 $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ 152 echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ 153 else \ 154 $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ 155 echo "installing $(srcdir)/$$cat as" \ 156 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ 157 fi; \ 158 if test -r $$cat.m; then \ 159 $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ 160 echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ 161 else \ 162 if test -r $(srcdir)/$$cat.m ; then \ 163 $(INSTALL_DATA) $(srcdir)/$$cat.m \ 164 $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ 165 echo "installing $(srcdir)/$$cat as" \ 166 "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ 167 else \ 168 true; \ 169 fi; \ 170 fi; \ 171 done 172 if test "$(PACKAGE)" = "gettext"; then \ 173 if test -r $(MKINSTALLDIRS); then \ 174 $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ 175 else \ 176 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ 177 fi; \ 178 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ 179 $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ 180 else \ 181 : ; \ 182 fi 183 184# Define this as empty until I found a useful application. 185installcheck: 186 187uninstall: 188 catalogs='$(CATALOGS)'; \ 189 for cat in $$catalogs; do \ 190 cat=`basename $$cat`; \ 191 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ 192 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ 193 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ 194 rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ 195 rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ 196 done 197 rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in 198 199check: all 200 201cat-id-tbl.o: ../intl/libgettext.h 202 203html dvi pdf ps info tags TAGS ID: 204 205mostlyclean: 206 rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp 207 rm -fr *.o 208 209clean: mostlyclean 210 211distclean: clean 212 rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m 213 rm -f SRC-POTFILES BLD-POTFILES 214 215maintainer-clean: distclean 216 @echo "This command is intended for maintainers to use;" 217 @echo "it deletes files that may require special tools to rebuild." 218 rm -f $(GMOFILES) SRC-POTFILES.in BLD-POTFILES.in 219 220distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) 221dist distdir: update-po $(DISTFILES) 222 dists="$(DISTFILES)"; \ 223 for file in $$dists; do \ 224 ln $(srcdir)/$$file $(distdir) 2> /dev/null \ 225 || cp -p $(srcdir)/$$file $(distdir); \ 226 done 227 228update-po: Makefile 229 $(MAKE) $(PACKAGE).pot 230 PATH=`pwd`/../src:$$PATH; \ 231 cd $(srcdir); \ 232 catalogs='$(CATALOGS)'; \ 233 for cat in $$catalogs; do \ 234 cat=`basename $$cat`; \ 235 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ 236 mv $$lang.po $$lang.old.po; \ 237 echo "$$lang:"; \ 238 if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ 239 rm -f $$lang.old.po; \ 240 else \ 241 echo "msgmerge for $$cat failed!"; \ 242 rm -f $$lang.po; \ 243 mv $$lang.old.po $$lang.po; \ 244 fi; \ 245 done 246 247SRC-POTFILES: SRC-POTFILES.in 248 ( if test 'x$(srcdir)' != 'x.'; then \ 249 posrcprefix='$(top_srcdir)/'; \ 250 else \ 251 posrcprefix="../"; \ 252 fi; \ 253 rm -f $@-t $@ \ 254 && (sed -e '/^#/d' \ 255 -e '/^[ ]*$$/d' \ 256 -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ 257 | sed -e '$$s/\\$$//') > $@-t \ 258 && chmod a-w $@-t \ 259 && mv $@-t $@ ) 260 261BLD-POTFILES: BLD-POTFILES.in 262 ( rm -f $@-t $@ \ 263 && (sed -e '/^#/d' \ 264 -e '/^[ ]*$$/d' \ 265 -e "s@.*@ ../& \\\\@" < $(srcdir)/$@.in \ 266 | sed -e '$$s/\\$$//') > $@-t \ 267 && chmod a-w $@-t \ 268 && mv $@-t $@ ) 269 270SRC-POTFILES.in: @MAINT@ ../Makefile 271 cd .. && $(MAKE) po/SRC-POTFILES.in 272 273BLD-POTFILES.in: @MAINT@ ../Makefile 274 cd .. && $(MAKE) po/BLD-POTFILES.in 275 276# Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies 277# here breaks the implementation of the 'distclean' rule for maintainers. 278# This is because if 'make distclean' is run in the BFD directory, the 279# Makefile there will be deleted before 'distclean' is made here, and so 280# the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot 281# be satisfied. 282# 283# The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed, 284# however since it is necessary that these files be built during 285# *configure* time, so that configure can insert them into the 286# po/Makefile that it is creating, so that the Makefile will have 287# the correct dependencies. 288Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES 289 cd .. \ 290 && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \ 291 CONFIG_HEADERS= $(SHELL) ./config.status 292 293# Tell versions [3.59,3.63) of GNU make not to export all variables. 294# Otherwise a system limit (for SysV at least) may be exceeded. 295.NOEXPORT: 296