| 1 |
# Makefile for program source directory in GNU NLS utilities package. |
| 2 |
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <[email protected]> |
| 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 <[email protected]> to use GETTEXT_PACKAGE |
| 10 |
# instead of PACKAGE and to look for po2tbl in ./ not in intl/ |
| 11 |
# |
| 12 |
# - Modified by jacob berkman <[email protected]> to install |
| 13 |
# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize |
| 14 |
|
| 15 |
GETTEXT_PACKAGE = gamazons |
| 16 |
PACKAGE = gamazons |
| 17 |
VERSION = 0.83rc3 |
| 18 |
|
| 19 |
SHELL = /bin/sh |
| 20 |
|
| 21 |
|
| 22 |
srcdir = . |
| 23 |
top_srcdir = .. |
| 24 |
|
| 25 |
|
| 26 |
prefix = /usr/local |
| 27 |
exec_prefix = ${prefix} |
| 28 |
datadir = $(prefix)/share |
| 29 |
localedir = $(datadir)/locale |
| 30 |
gnulocaledir = $(prefix)/share/locale |
| 31 |
gettextsrcdir = $(prefix)/share/glib-2.0/gettext/po |
| 32 |
subdir = po |
| 33 |
|
| 34 |
INSTALL = /usr/bin/install -c |
| 35 |
INSTALL_DATA = ${INSTALL} -m 644 |
| 36 |
MKINSTALLDIRS = $(top_srcdir)/./mkinstalldirs |
| 37 |
|
| 38 |
CC = gcc |
| 39 |
GENCAT = @GENCAT@ |
| 40 |
GMSGFMT = PATH=../src:$$PATH /usr/bin/msgfmt |
| 41 |
MSGFMT = /usr/bin/msgfmt |
| 42 |
XGETTEXT = PATH=../src:$$PATH /usr/bin/xgettext |
| 43 |
MSGMERGE = PATH=../src:$$PATH msgmerge |
| 44 |
|
| 45 |
DEFS = -DHAVE_CONFIG_H |
| 46 |
CFLAGS = -g -O2 |
| 47 |
CPPFLAGS = |
| 48 |
|
| 49 |
INCLUDES = -I.. -I$(top_srcdir)/intl |
| 50 |
|
| 51 |
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
| 52 |
|
| 53 |
SOURCES = |
| 54 |
POFILES = |
| 55 |
GMOFILES = |
| 56 |
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ |
| 57 |
$(POFILES) $(GMOFILES) $(SOURCES) |
| 58 |
|
| 59 |
POTFILES = \ |
| 60 |
../src/main.c \ |
| 61 |
../src/interface.c \ |
| 62 |
../src/callbacks.c \ |
| 63 |
../src/support.c |
| 64 |
|
| 65 |
CATALOGS = |
| 66 |
CATOBJEXT = .gmo |
| 67 |
INSTOBJEXT = .mo |
| 68 |
|
| 69 |
.SUFFIXES: |
| 70 |
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat |
| 71 |
|
| 72 |
.c.o: |
| 73 |
$(COMPILE) $< |
| 74 |
|
| 75 |
.po.pox: |
| 76 |
$(MAKE) $(GETTEXT_PACKAGE).pot |
| 77 |
$(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox |
| 78 |
|
| 79 |
.po.mo: |
| 80 |
$(MSGFMT) -o $@ $< |
| 81 |
|
| 82 |
.po.gmo: |
| 83 |
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
| 84 |
&& rm -f $$file && $(GMSGFMT) -o $$file $< |
| 85 |
|
| 86 |
.po.cat: |
| 87 |
sed -f ../intl/po2msg.sed < $< > $*.msg \ |
| 88 |
&& rm -f $@ && $(GENCAT) $@ $*.msg |
| 89 |
|
| 90 |
|
| 91 |
all: all-yes |
| 92 |
|
| 93 |
all-yes: $(CATALOGS) |
| 94 |
all-no: |
| 95 |
|
| 96 |
$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) |
| 97 |
$(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \ |
| 98 |
--add-comments --keyword=_ --keyword=N_ \ |
| 99 |
--files-from=$(srcdir)/POTFILES.in \ |
| 100 |
&& test ! -f $(GETTEXT_PACKAGE).po \ |
| 101 |
|| ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ |
| 102 |
&& mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) |
| 103 |
|
| 104 |
install: install-exec install-data |
| 105 |
install-exec: |
| 106 |
install-data: install-data-yes |
| 107 |
install-data-no: all |
| 108 |
install-data-yes: all |
| 109 |
if test -r "$(MKINSTALLDIRS)"; then \ |
| 110 |
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ |
| 111 |
else \ |
| 112 |
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ |
| 113 |
fi |
| 114 |
@catalogs='$(CATALOGS)'; \ |
| 115 |
for cat in $$catalogs; do \ |
| 116 |
cat=`basename $$cat`; \ |
| 117 |
case "$$cat" in \ |
| 118 |
*.gmo) destdir=$(gnulocaledir);; \ |
| 119 |
*) destdir=$(localedir);; \ |
| 120 |
esac; \ |
| 121 |
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
| 122 |
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ |
| 123 |
if test -r "$(MKINSTALLDIRS)"; then \ |
| 124 |
$(MKINSTALLDIRS) $$dir; \ |
| 125 |
else \ |
| 126 |
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ |
| 127 |
fi; \ |
| 128 |
if test -r $$cat; then \ |
| 129 |
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
| 130 |
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
| 131 |
else \ |
| 132 |
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
| 133 |
echo "installing $(srcdir)/$$cat as" \ |
| 134 |
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
| 135 |
fi; \ |
| 136 |
if test -r $$cat.m; then \ |
| 137 |
$(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
| 138 |
echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
| 139 |
else \ |
| 140 |
if test -r $(srcdir)/$$cat.m ; then \ |
| 141 |
$(INSTALL_DATA) $(srcdir)/$$cat.m \ |
| 142 |
$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
| 143 |
echo "installing $(srcdir)/$$cat as" \ |
| 144 |
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
| 145 |
else \ |
| 146 |
true; \ |
| 147 |
fi; \ |
| 148 |
fi; \ |
| 149 |
done |
| 150 |
if test "$(PACKAGE)" = "glib"; then \ |
| 151 |
if test -r "$(MKINSTALLDIRS)"; then \ |
| 152 |
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ |
| 153 |
else \ |
| 154 |
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ |
| 155 |
fi; \ |
| 156 |
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
| 157 |
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
| 158 |
else \ |
| 159 |
: ; \ |
| 160 |
fi |
| 161 |
|
| 162 |
# Define this as empty until I found a useful application. |
| 163 |
installcheck: |
| 164 |
|
| 165 |
uninstall: |
| 166 |
catalogs='$(CATALOGS)'; \ |
| 167 |
for cat in $$catalogs; do \ |
| 168 |
cat=`basename $$cat`; \ |
| 169 |
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
| 170 |
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
| 171 |
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
| 172 |
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
| 173 |
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
| 174 |
done |
| 175 |
rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in |
| 176 |
|
| 177 |
check: all |
| 178 |
|
| 179 |
dvi info tags TAGS ID: |
| 180 |
|
| 181 |
mostlyclean: |
| 182 |
rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp |
| 183 |
rm -fr *.o |
| 184 |
|
| 185 |
clean: mostlyclean |
| 186 |
|
| 187 |
distclean: clean |
| 188 |
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m |
| 189 |
|
| 190 |
maintainer-clean: distclean |
| 191 |
@echo "This command is intended for maintainers to use;" |
| 192 |
@echo "it deletes files that may require special tools to rebuild." |
| 193 |
rm -f $(GMOFILES) |
| 194 |
|
| 195 |
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) |
| 196 |
dist distdir: update-po $(DISTFILES) |
| 197 |
dists="$(DISTFILES)"; \ |
| 198 |
for file in $$dists; do \ |
| 199 |
ln $(srcdir)/$$file $(distdir) 2> /dev/null \ |
| 200 |
|| cp -p $(srcdir)/$$file $(distdir); \ |
| 201 |
done |
| 202 |
|
| 203 |
update-po: Makefile |
| 204 |
$(MAKE) $(GETTEXT_PACKAGE).pot |
| 205 |
PATH=`pwd`/../src:$$PATH; \ |
| 206 |
cd $(srcdir); \ |
| 207 |
catalogs='$(CATALOGS)'; \ |
| 208 |
for cat in $$catalogs; do \ |
| 209 |
cat=`basename $$cat`; \ |
| 210 |
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
| 211 |
mv $$lang.po $$lang.old.po; \ |
| 212 |
echo "$$lang:"; \ |
| 213 |
if $(MSGMERGE) $$lang.old.po $(GETTEXT_PACKAGE).pot -o $$lang.po; then \ |
| 214 |
rm -f $$lang.old.po; \ |
| 215 |
else \ |
| 216 |
echo "msgmerge for $$cat failed!"; \ |
| 217 |
rm -f $$lang.po; \ |
| 218 |
mv $$lang.old.po $$lang.po; \ |
| 219 |
fi; \ |
| 220 |
done |
| 221 |
|
| 222 |
# POTFILES is created from POTFILES.in by stripping comments, empty lines |
| 223 |
# and Intltool tags (enclosed in square brackets), and appending a full |
| 224 |
# relative path to them |
| 225 |
POTFILES: POTFILES.in |
| 226 |
( if test 'x$(srcdir)' != 'x.'; then \ |
| 227 |
posrcprefix='$(top_srcdir)/'; \ |
| 228 |
else \ |
| 229 |
posrcprefix="../"; \ |
| 230 |
fi; \ |
| 231 |
rm -f $@-t $@ \ |
| 232 |
&& (sed -e '/^#/d' \ |
| 233 |
-e "s/^\[.*\] +//" \ |
| 234 |
-e '/^[ ]*$$/d' \ |
| 235 |
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/[email protected] \ |
| 236 |
| sed -e '$$s/\\$$//') > $@-t \ |
| 237 |
&& chmod a-w $@-t \ |
| 238 |
&& mv $@-t $@ ) |
| 239 |
|
| 240 |
Makefile: Makefile.in.in ../config.status POTFILES |
| 241 |
cd .. \ |
| 242 |
&& CONFIG_FILES=$(subdir)/[email protected] CONFIG_HEADERS= \ |
| 243 |
$(SHELL) ./config.status |
| 244 |
|
| 245 |
# Tell versions [3.59,3.63) of GNU make not to export all variables. |
| 246 |
# Otherwise a system limit (for SysV at least) may be exceeded. |
| 247 |
.NOEXPORT: |