3 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
16 localedir
= $(LOCALEDIR
)
17 gnulocaledir
= $(LOCALEDIR
)
19 # Not giving an explicit path improves the chances of finding this
21 INSTALL_DATA
= ${INSTALL} -m
644
23 # Not giving an explicit path improves the chances of finding these
25 MSGFMT
= msgfmt
-c
# -c: undocumented, but useful option
30 # .. for <config.h> (if HAVE_CONFIG_H is set)
31 # $(INTL) for "libgettext.h"
32 INCLUDES
= -I..
-I
$(INTL
)
34 COMPILE
= $(CC
) -c
$(DEFS
) $(INCLUDES
) $(CPPFLAGS
) $(CFLAGS
) $(XCFLAGS
)
36 # Enter here all .po files
37 POFILES
= cs.po da.po de.po es.po fr.po it.po ja.po nl.po pt_BR.po
38 # the same but with .gmo
39 GMOFILES
= cs.gmo da.gmo de.gmo es.gmo fr.gmo it.gmo ja.gmo nl.gmo pt_BR.gmo
41 CATALOGS
= $(GMOFILES
)
46 .SUFFIXES
: .c .o .po .gmo .mo .msg .cat
58 sed
-f
$(PO2TBL
) < $< > $*.msg \
59 && rm -f
$@
&& $(GENCAT
) $@
$*.msg
61 all: all-
$(HAVE_XGETTEXT
)
63 all-yes
: cat-id-tbl.c
$(CATALOGS
)
67 $(XGETTEXT
) --default-domain
=util-linux
--directory
=.. \
68 --add-comments
--keyword
=_
--keyword
=N_ \
69 --files-from
=POTFILES.in
$(FOREIGN
)
70 mv util-linux.po util-linux.pot
72 cat-id-tbl.c
: stamp-cat-id
73 stamp-cat-id
: util-linux.pot
75 sed
-f
$(PO2TBL
) util-linux.pot \
76 | sed
-e
"s/@PACKAGE NAME@/util-linux/" > cat-id-tbl.tmp
77 if cmp
-s cat-id-tbl.tmp cat-id-tbl.c
; then \
80 echo cat-id-tbl.c changed
; \
82 mv cat-id-tbl.tmp cat-id-tbl.c
; \
84 rm -f stamp-cat-id
&& echo timestamp
> stamp-cat-id
86 install: install-data-
$(HAVE_XGETTEXT
)
89 @catalogs
='$(CATALOGS)'; \
90 for cat in
$$catalogs; do \
92 *.gmo
) destdir
=$(gnulocaledir
);; \
93 *) destdir
=$(localedir
);; \
95 lang
=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
96 dir=$$destdir/$$lang/LC_MESSAGES
; \
97 ..
/mkinstalldirs
$$dir; \
98 $(INSTALL_DATA
) $$cat $$dir/util-linux
$(INSTOBJEXT
); \
99 echo
"installing $$cat as $$dir/util-linux$(INSTOBJEXT)"; \
100 if
test -r
$$cat.m
; then \
101 $(INSTALL_DATA
) $$cat.m
$$dir/util-linux
$(INSTOBJEXT
).m
; \
102 echo
"installing $$cat.m as $$dir/util-linux$(INSTOBJEXT).m"; \
107 catalogs
='$(CATALOGS)'; \
108 for cat in
$$catalogs; do \
109 lang
=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
110 rm -f
$(localedir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
); \
111 rm -f
$(localedir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
).m
; \
112 rm -f
$(gnulocaledir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
); \
113 rm -f
$(gnulocaledir
)/$$lang/LC_MESSAGES
/util-linux
$(INSTOBJEXT
).m
; \
116 cat-id-tbl.o
: $(INTL
)/libgettext.h
119 rm -f core core.
* *~
*.o util-linux.pot cat-id-tbl.tmp
122 rm -f POTFILES
*.gmo
*.mo
*.msg
*.cat
*.cat.m
125 $(MAKE
) util-linux.pot
126 catalogs
='$(CATALOGS)'; \
127 for cat in
$$catalogs; do \
128 lang
=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
129 mv
$$lang.po
$$lang.old.po
; \
131 if
$(MSGMERGE
) $$lang.old.po util-linux.pot
-o
$$lang.po
; then \
132 rm -f
$$lang.old.po
; \
134 echo
"msgmerge for $$cat failed!"; \
136 mv
$$lang.old.po
$$lang.po
; \