4 include ..
/make_include
7 # po2tbl.sed is not taken from /usr/share/gettext/intl
8 # Often it is not present.
9 # A RedHat 5.2 installation only has po2tbl.sed.in.
12 INTL
= /usr
/share
/gettext
/intl
17 exec_prefix = ${prefix}
18 datadir = $(prefix)/share
19 localedir
= $(datadir)/locale
20 gnulocaledir
= $(prefix)/share
/locale
21 gettextsrcdir
= $(prefix)/share
/gettext
/po
23 # Not giving an explicit path improves the chances of finding this
25 INSTALL_DATA
= ${INSTALL} -m
644
27 # Not giving an explicit path improves the chances of finding these
34 # .. for <config.h> (if HAVE_CONFIG_H is set)
35 # $(INTL) for "libgettext.h"
36 INCLUDES
= -I..
-I
$(INTL
)
38 COMPILE
= $(CC
) -c
$(DEFS
) $(INCLUDES
) $(CPPFLAGS
) $(CFLAGS
) $(XCFLAGS
)
40 # Enter here all .po files
41 POFILES
= cs.po de.po fr.po it.po ja.po nl.po pt_BR.po
42 # the same but with .gmo
43 GMOFILES
= cs.gmo de.gmo fr.gmo it.gmo ja.gmo nl.gmo pt_BR.gmo
45 CATALOGS
= $(GMOFILES
)
50 .SUFFIXES
: .c .o .po .gmo .mo .msg .cat
62 sed
-f
$(PO2TBL
) < $< > $*.msg \
63 && rm -f
$@
&& $(GENCAT
) $@
$*.msg
65 all: all-
$(HAVE_XGETTEXT
)
67 all-yes
: cat-id-tbl.c
$(CATALOGS
)
71 $(XGETTEXT
) --default-domain
=util-linux
--directory
=.. \
72 --add-comments
--keyword
=_
--keyword
=N_ \
73 --files-from
=POTFILES.in
$(FOREIGN
)
74 mv util-linux.po util-linux.pot
76 cat-id-tbl.c
: stamp-cat-id
77 stamp-cat-id
: util-linux.pot
79 sed
-f
$(PO2TBL
) util-linux.pot \
80 | sed
-e
"s/@PACKAGE NAME@/util-linux/" > cat-id-tbl.tmp
81 if cmp
-s cat-id-tbl.tmp cat-id-tbl.c
; then \
84 echo cat-id-tbl.c changed
; \
86 mv cat-id-tbl.tmp cat-id-tbl.c
; \
88 rm -f stamp-cat-id
&& echo timestamp
> stamp-cat-id
90 install: install-data-
$(HAVE_XGETTEXT
)
93 ..
/mkinstalldirs
$(datadir);
94 @catalogs
='$(CATALOGS)'; \
95 for cat in
$$catalogs; do \
97 *.gmo
) destdir
=$(gnulocaledir
);; \
98 *) destdir
=$(localedir
);; \
100 lang
=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
101 dir=$$destdir/$$lang/LC_MESSAGES
; \
102 ..
/mkinstalldirs
$$dir; \
103 $(INSTALL_DATA
) $$cat $$dir/util-linux
$(INSTOBJEXT
); \
104 echo
"installing $$cat as $$dir/util-linux$(INSTOBJEXT)"; \
105 if
test -r
$$cat.m
; then \
106 $(INSTALL_DATA
) $$cat.m
$$dir/util-linux
$(INSTOBJEXT
).m
; \
107 echo
"installing $$cat.m as $$dir/util-linux$(INSTOBJEXT).m"; \
112 catalogs
='$(CATALOGS)'; \
113 for cat in
$$catalogs; do \
114 lang
=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
115 rm -f
$(localedir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
); \
116 rm -f
$(localedir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
).m
; \
117 rm -f
$(gnulocaledir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
); \
118 rm -f
$(gnulocaledir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
).m
; \
120 rm -f
$(gettextsrcdir
)/po-Makefile.in.in
122 cat-id-tbl.o
: $(INTL
)/libgettext.h
125 rm -f core core.
* *~
*.o util-linux.pot cat-id-tbl.tmp
128 rm -f POTFILES
*.gmo
*.mo
*.msg
*.cat
*.cat.m
131 $(MAKE
) util-linux.pot
132 catalogs
='$(CATALOGS)'; \
133 for cat in
$$catalogs; do \
134 lang
=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
135 mv
$$lang.po
$$lang.old.po
; \
137 if
$(MSGMERGE
) $$lang.old.po util-linux.pot
-o
$$lang.po
; then \
138 rm -f
$$lang.old.po
; \
140 echo
"msgmerge for $$cat failed!"; \
142 mv
$$lang.old.po
$$lang.po
; \