http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.03.tar.gz
[xscreensaver] / po / Makefile.in.in
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 #
4 # This file file be copied and used freely without restrictions.  It can
5 # be used in projects which are not available under the GNU Public License
6 # but which still want to provide support for the GNU gettext functionality.
7 # Please note that the actual code is *not* freely available.
8 #
9 # - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
10 #   instead of PACKAGE and to look for po2tbl in ./ not in intl/
11 #
12 # - Modified by jacob berkman <jacob@ximian.com> to install
13 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
14 #
15 # - Modified by jwz to not suck wet farts from dead pigeons.
16 #   This is truly one of the worst-written Makefiles I've ever seen.
17 #   Problems I (tried to) fix:
18 #
19 #     - MKINSTALLDIRS was $(top_srcdir)/@MKINSTALLDIRS@, but the
20 #       configure script already put $(top_srcdir) into @MKINSTALLDIRS@,
21 #       so the result was an absolute path that didn't work at all.
22 #
23 #     - GMSGFMT and XGETTEXT set $PATH to some random value before
24 #       running the program.  That's completely stupid, and anyway,
25 #       the hardcoded $PATH value they were using (../src) do not
26 #       apply to xscreensaver.
27 #
28 #     - the .po.gmo, .po.cat, .po.pox, .pot, install-data-yes, update-po, and
29 #       uninstall rules didn't actually print the commands they were
30 #       executing: they just dumped a bunch of sh code at you, and expected
31 #       you to figure it out yourself.  This is typical behavior of Makefile
32 #       rules written by morons.
33 #
34 #     - intltool-update prints a lot of useless crap to both stderr and
35 #       stdout and has no command-line argument meaning "be quiet, and only
36 #       print errors", so I just redirected the whole thing to /dev/null.
37 #
38 #     - Demonstrating a total misunderstanding of build-directories and
39 #       VPATH, the .po.gmo rule was writing output to $(srcdir).  When
40 #       the current directory is not $(srcdir), one *never* writes to
41 #       $(srcdir) -- it is to be considered read-only.
42 #
43 #     - Likewise, install-data-yes was looking for .gmo files in both the
44 #       current directory, and in $(srcdir).  In the case where those are
45 #       not the same directory, there must be no .gmo files in $(srcdir).
46 #
47 #     - The update-po rule was explicitly writing to $(srcdir).  I changed
48 #       it to just work in the current directory.  As I understand it, it
49 #       only makes sense to run this rule while in the srcdir, e.g., from
50 #       distdepend -- so it should be allowed to error out when run in an
51 #       inappropriate directory.
52 #
53 #     - install-data-yes went through great code-duplication-contortions
54 #       to cope with the file mentioned by MKINSTALLDIRS not actually
55 #       existing!  Instead of assuming that MKINSTALLDIRS will be set to
56 #       an actual, correct value, it had a hardcoded check to look for it
57 #       in $(top_srcdir) as well!  WTF!
58 #
59 #     - It turns out that "msgfmt" silently fails to write a .gmo file
60 #       if the source .po file is empty (or otherwise not yet written.)
61 #       The install-data-yes rule made no provision for this, and would
62 #       just error out when the .gmo files were not there.
63 #
64 #     - $(DESTDIR) was being used where $(install_prefix) should have been.
65 #
66 #     - For xscreensaver, $(prefix) is generally /usr/X11R6/, but some files
67 #       need to go under /usr/ instead of under /usr/X11R6/ -- for those, we
68 #       use @GNOME_DATADIR@ instead of @prefix@.  So I changed $(datadir) and
69 #       $(gnulocaledir) appropriately.
70 #
71 #     - WTF is $(gettextsrcdir) doing in here?
72 #
73 #     - added  "*.gmo *.pot" to "distclean".
74 #
75 #     - I added a rule to po/POTFILES.in so that I wouldn't have to maintain
76 #       that list of files in two places.
77 #   
78 #     - I removed the rule to auto-regenerate Makefile from Makefile.in.in
79 #       because it made my top-level "make distdepend" rule fail: things
80 #       were executing in the wrong order.
81 #
82 #     - the .po.cat rule has a hardcoded "../intl/po2msg.sed" in it.
83 #       Guess what, I don't have any such directory.  And that should be
84 #       refering to $(srcdir) anyway.  So I just commented (my half-fixed
85 #       version of) this rule out.
86 #
87
88 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
89 PACKAGE = @PACKAGE@
90 VERSION = @VERSION@
91
92 SHELL = /bin/sh
93 @SET_MAKE@
94
95 srcdir = @srcdir@
96 top_srcdir = @top_srcdir@
97 top_builddir = ..
98 VPATH = @srcdir@
99
100 prefix = @prefix@
101 exec_prefix = @exec_prefix@
102 #datadir = $(prefix)/@DATADIRNAME@      -- not for xscreensaver
103 datadir = @GNOME_DATADIR@
104 localedir = $(datadir)/locale
105 #gnulocaledir = $(prefix)/share/locale  -- not for xscreensaver
106 gnulocaledir = $(localedir)
107 #gettextsrcdir = $(prefix)/share/glib-2.0/gettext/po
108 subdir = po
109
110 INSTALL = @INSTALL@
111 INSTALL_DATA = @INSTALL_DATA@
112 MKINSTALLDIRS = @MKINSTALLDIRS@
113
114 CC = @CC@
115 #GENCAT = @GENCAT@
116 GMSGFMT = @GMSGFMT@
117 MSGFMT = @MSGFMT@
118 XGETTEXT = @XGETTEXT@
119 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
120 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
121 MSGMERGE = $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
122 GENPOT   = $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
123
124 DEFS = @DEFS@
125 CFLAGS = @CFLAGS@
126 CPPFLAGS = @CPPFLAGS@
127
128 INCLUDES = -I.. -I$(top_srcdir)/intl
129
130 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
131
132 SOURCES = 
133 POFILES = @POFILES@
134 GMOFILES = @GMOFILES@
135 DISTFILES_1 = ChangeLog Makefile.in.in POTFILES.in
136 DISTFILES = $(DISTFILES_1) $(GETTEXT_PACKAGE).pot \
137             $(POFILES) $(GMOFILES) $(SOURCES)
138
139 TARFILES = $(DISTFILES_1) $(POFILES) $(SOURCES)
140
141 POTFILES = \
142
143 CATALOGS = @CATALOGS@
144 CATOBJEXT = @CATOBJEXT@
145 INSTOBJEXT = @INSTOBJEXT@
146
147 .SUFFIXES:
148 .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
149
150 .c.o:
151         $(COMPILE) $<
152
153 .po.pox:
154         $(MAKE) $(GETTEXT_PACKAGE).pot
155         INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) ; \
156         export INTLTOOL_EXTRACT ; \
157         echo $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox ; \
158              $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
159
160 .po.mo:
161         $(MSGFMT) -o $@ $<
162
163 .po.gmo:
164         @file=`echo $* | sed 's,.*/,,'`.gmo ; \
165          rm -f "$$file" ; \
166          echo $(GMSGFMT) -o "$$file" $< ; \
167               $(GMSGFMT) -o "$$file" $<
168
169 #.po.cat:
170 #       @echo "sed -f ../intl/po2msg.sed < $< > $*.msg" ; \
171 #              sed -f ../intl/po2msg.sed < $< > $*.msg && \
172 #        rm -f $@ && \
173 #        echo $(GENCAT) "$@" "$*.msg" ; \
174 #             $(GENCAT) "$@" "$*.msg"
175
176
177 all: all-@USE_NLS@
178 default: all
179
180 all-yes: $(CATALOGS)
181 all-no:
182
183 $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
184         @INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) ; \
185         export INTLTOOL_EXTRACT ; \
186         echo $(GENPOT) ; \
187              $(GENPOT)
188
189 install-strip: install
190
191 install: install-exec install-data
192 install-exec:
193 install-data: install-data-@USE_NLS@
194 install-data-no: all
195 install-data-yes: all
196         @set -e; \
197         catalogs='$(CATALOGS)'; \
198         losers=""; \
199         for cat in $$catalogs; do \
200           cat=`basename $$cat`; \
201           case "$$cat" in \
202             *.gmo) destdir=$(gnulocaledir);; \
203             *)     destdir=$(localedir);; \
204           esac; \
205           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
206           dir=$(install_prefix)$$destdir/$$lang/LC_MESSAGES; \
207           dest=$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
208           if test -r $$cat -o -r $$cat.m; then \
209             echo $(MKINSTALLDIRS) $$dir; \
210                  $(MKINSTALLDIRS) $$dir; \
211           else \
212             losers="$$losers $$lang"; \
213           fi ; \
214           if test -r $$cat; then \
215             echo $(INSTALL_DATA) $$cat $$dest; \
216                  $(INSTALL_DATA) $$cat $$dest; \
217           fi; \
218           if test -r $$cat.m; then \
219             echo $(INSTALL_DATA) $$cat.m $$dest.m; \
220                  $(INSTALL_DATA) $$cat.m $$dest.m; \
221           fi; \
222         done; \
223         if [ "$$losers" != '' ]; then \
224           echo "Warning: these catalogs were not installed:" >&2 ; \
225           echo "        $$losers" >&2; \
226         fi
227
228 # Define this as empty until I found a useful application.
229 installcheck:
230
231 uninstall:
232         @catalogs='$(CATALOGS)'; \
233         for cat in $$catalogs; do \
234           cat=`basename $$cat`; \
235           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
236           suffix="$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
237           for f in $(install_prefix)$(localedir)/$$suffix \
238                    $(install_prefix)$(localedir)/$$suffix.m \
239                    $(install_prefix)$(gnulocaledir)/$$suffix \
240                    $(install_prefix)$(gnulocaledir)/$$suffix.m; do \
241             if [ -f $$f ]; then \
242               echo rm -f $$f; \
243                    rm -f $$f; \
244             fi; \
245           done; \
246         done
247
248 check: all
249
250 dvi info tags TAGS ID:
251
252 mostlyclean:
253         rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
254         rm -fr *.o
255
256 clean: mostlyclean
257
258 distclean: clean
259         rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m *.gmo *.pot
260
261 maintainer-clean: distclean
262         @echo "This command is intended for maintainers to use;"
263         @echo "it deletes files that may require special tools to rebuild."
264         rm -f $(GMOFILES)
265
266 distdepend: generate_potfiles_in update-po $(DISTFILES)
267
268 # jwz: Generates po/POTFILES.in by examining the source tree:
269 # that way we don't have to keep this list up to date as files are added.
270 #
271 generate_potfiles_in:
272         @tmp=po.$$$$ ;                          \
273          file=POTFILES.in ;                     \
274          ( cd $(top_srcdir);                    \
275            echo "# Auto-generated: `date`" ;    \
276            ( grep -l '_("' driver/*.[ch] ;      \
277              ls driver/*.glade                  \
278                 driver/*.desktop.in             \
279                 hacks/config/*.xml ) | sort     \
280           ) > $$tmp &&                          \
281          mv $$tmp $$file &&                     \
282          echo "created `pwd`/$$file"
283
284 echo_tarfiles:
285         @echo $(TARFILES)
286
287 distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
288 dist distdir: update-po $(DISTFILES)
289         dists="$(DISTFILES)"; \
290         for file in $$dists; do \
291           ln $(srcdir)/$$file $(distdir) 2> /dev/null \
292             || cp -p $(srcdir)/$$file $(distdir); \
293         done
294
295 update-po: Makefile
296         $(MAKE) $(GETTEXT_PACKAGE).pot
297         @catalogs='$(CATALOGS)'; \
298         INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) ; \
299         export INTLTOOL_EXTRACT ; \
300         for cat in $$catalogs; do \
301           cat=`basename $$cat`; \
302           lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
303           cp $$lang.po $$lang.old.po; \
304           echo $(MSGMERGE) $$lang; \
305           if   $(MSGMERGE) $$lang >/dev/null 2>&1; then \
306             rm -f $$lang.old.po; \
307           else \
308             echo "msgmerge for $$cat failed!"; \
309             rm -f $$lang.po; \
310             mv $$lang.old.po $$lang.po; \
311           fi; \
312         done
313
314 .po: Makefile
315         $(MAKE)  $(PACKAGE).pot;
316         INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) ; \
317         export INTLTOOL_EXTRACT ; \
318         echo; printf "$*: "; \
319         if $(MSGMERGE) $*; then \
320           rm -f $*.old.po; \
321           else \
322             echo "msgmerge for * failed!"; \
323             mv $*.old.po $*.po; \
324         fi; \
325         msgfmt --statistics $*.po; echo;
326
327
328 # POTFILES is created from POTFILES.in by stripping comments, empty lines
329 # and Intltool tags (enclosed in square brackets), and appending a full
330 # relative path to them
331 POTFILES: POTFILES.in
332         ( if test 'x$(srcdir)' != 'x.'; then \
333             posrcprefix='$(top_srcdir)/'; \
334           else \
335             posrcprefix="../"; \
336           fi; \
337           rm -f $@-t $@ \
338             && (sed -e '/^#/d'                                          \
339                     -e "s/^\[.*\] +//"                                  \
340                     -e '/^[     ]*$$/d'                                 \
341                     -e "s@.*@   $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
342                 | sed -e '$$s/\\$$//') > $@-t \
343             && chmod a-w $@-t \
344             && mv $@-t $@ )
345
346 # Please to be fucking the hell off.   This breaks "make distdepend". -jwz
347 #Makefile: Makefile.in.in ../config.status POTFILES
348 #       cd .. \
349 #         && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
350 #              $(SHELL) ./config.status
351
352 # Tell versions [3.59,3.63) of GNU make not to export all variables.
353 # Otherwise a system limit (for SysV at least) may be exceeded.
354 .NOEXPORT: