source: trunk/third/gtk/po/Makefile.in.in @ 15930

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