1# Makefile for directory with message catalog handling library of GNU gettext
2# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU Library General Public License as published
6# by the Free Software Foundation; either version 2, or (at your option)
7# any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Library General Public License for more details.
13#
14# You should have received a copy of the GNU Library General Public
15# License along with this program; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
17# USA.
18
19# This Makefile has been modified from the original shipped with
20# gettext 0.12.1 to remove the ability to install libintl (which
21# we do not need nor want), the ability to build a shared library
22# (likewise), and a large number of heinous kludges.
23
24SHELL = @SHELL@
25
26srcdir = @srcdir@
27VPATH = $(srcdir)
28
29prefix = @prefix@
30exec_prefix = @exec_prefix@
31transform = @program_transform_name@
32libdir = @libdir@
33includedir = @includedir@
34datarootdir = @datarootdir@
35datadir = @datadir@
36localedir = $(datadir)/locale
37aliaspath = $(localedir)
38
39AR = ar
40ACLOCAL = @ACLOCAL@
41AUTOCONF = @AUTOCONF@
42AUTOHEADER = @AUTOHEADER@
43CC = @CC@
44RANLIB = @RANLIB@
45YACC = @INTLBISON@ -y -d
46YFLAGS = --name-prefix=__gettext
47CPPFLAGS = @CPPFLAGS@
48CFLAGS = @CFLAGS@
49LDFLAGS = @LDFLAGS@
50LIBS = @LIBS@
51DEFS = -DHAVE_CONFIG_H
52PICFLAG = @PICFLAG@
53
54COMPILE = $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PICFLAG) $(DEFS) $(DEFS-$@) $(INCLUDES)
55
56HEADERS = \
57  gmo.h \
58  gettextP.h \
59  hash-string.h \
60  loadinfo.h \
61  plural-config.h \
62  plural-exp.h \
63  eval-plural.h \
64  localcharset.h \
65  relocatable.h \
66  libgnuintl.h
67SOURCES = \
68  bindtextdom.c \
69  dcgettext.c \
70  dgettext.c \
71  gettext.c \
72  finddomain.c \
73  loadmsgcat.c \
74  localealias.c \
75  textdomain.c \
76  l10nflist.c \
77  explodename.c \
78  dcigettext.c \
79  dcngettext.c \
80  dngettext.c \
81  ngettext.c \
82  plural.y \
83  plural-exp.c \
84  localcharset.c \
85  relocatable.c \
86  localename.c \
87  log.c \
88  osdep.c \
89  intl-compat.c
90OBJECTS = \
91  bindtextdom.o \
92  dcgettext.o \
93  dgettext.o \
94  gettext.o \
95  finddomain.o \
96  loadmsgcat.o \
97  localealias.o \
98  textdomain.o \
99  l10nflist.o \
100  explodename.o \
101  dcigettext.o \
102  dcngettext.o \
103  dngettext.o \
104  ngettext.o \
105  plural.o \
106  plural-exp.o \
107  localcharset.o \
108  relocatable.o \
109  localename.o \
110  log.o \
111  osdep.o \
112  intl-compat.o
113
114DEFS-dcigettext.o = -DLOCALEDIR="\"$(localedir)\""
115DEFS-localealias.o = -DLOCALE_ALIAS_PATH="\"$(aliaspath)\""
116DEFS-localcharset.o = -DLIBDIR="\"$(libdir)\""
117DEFS-relocatable.o = -DINSTALLDIR="\"$(libdir)\""
118
119all: all-@USE_INCLUDED_LIBINTL@
120all-yes: libintl.a libintl.h config.intl
121all-no: # nothing
122
123libintl.a: $(OBJECTS)
124	rm -f $@
125	$(AR) cru $@ $(OBJECTS)
126	$(RANLIB) $@
127
128libintl.h: $(srcdir)/libgnuintl.h
129	cp $(srcdir)/libgnuintl.h $@
130
131.SUFFIXES:
132.SUFFIXES: .c .y .o
133
134.c.o:
135	$(COMPILE) $<
136
137.y.c:
138	@echo "Not rebuilding yacc output"
139	cp -p $(srcdir)/$@ $@
140#@BISON3_YES@	echo '#define USE_BISON3' > $(patsubst %.c,%-config.h,$@)
141#@BISON3_YES@	sed 's,%pure_parser,,;s,^/\* BISON3 \(.*\) \*/$$,\1,' $< > $@.y
142#@BISON3_YES@	$(YACC) $(YFLAGS) --output $@.c $@.y
143#@BISON3_YES@	sed 's/\.c\.y"/.y"/' $@.c > $@
144#@BISON3_YES@	rm -f $@.c $@.y $@.h
145#@BISON3_NO@	echo '/* #define USE_BISON3 */' > $(patsubst %.c,%-config.h,$@)
146#@BISON3_NO@	$(YACC) $(YFLAGS) --output $@ $<
147#	rm -f $*.h
148
149INCLUDES = -I. -I$(srcdir)
150
151check: all
152
153# The installation targets have been disabled.
154install: install-exec install-data
155install-exec: all
156install-data: all
157install-strip: install
158installdirs:
159installcheck:
160uninstall:
161
162.PHONY: info dvi ps pdf html
163.PHONY: install-info install-dvi install-ps install-pdf install-html
164
165info dvi ps pdf html:
166install-info install-dvi install-ps install-pdf install-html:
167
168$(OBJECTS): config.h libintl.h
169bindtextdom.o dcgettext.o dcigettext.o dcngettext.o dgettext.o \
170dngettext.o finddomain.o gettext.o intl-compat.o loadmsgcat.o \
171localealias.o ngettext.o textdomain.o: gettextP.h gmo.h loadinfo.h
172dcigettext.o loadmsgcat.o: hash-string.h
173explodename.o l10nflist.o: loadinfo.h
174dcigettext.o loadmsgcat.o plural.o plural-exp.o: plural-exp.h plural-config.h
175dcigettext.o: eval-plural.h
176localcharset.o: localcharset.h
177localealias.o localcharset.o relocatable.o: relocatable.h
178
179tags: TAGS
180TAGS: $(HEADERS) $(SOURCES)
181	here=`pwd`; cd $(srcdir) && \
182		etags -o $$here/TAGS $(HEADERS) $(SOURCES)
183
184ctags: CTAGS
185CTAGS: $(HEADERS) $(SOURCES)
186	here=`pwd`; cd $(srcdir) && \
187		ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
188
189id: ID
190ID: $(HEADERS) $(SOURCES)
191	here=`pwd`; cd $(srcdir) && \
192		mkid -f$$here/ID $(HEADERS) $(SOURCES)
193
194mostlyclean:
195	rm -f *.a *.la *.o *.obj *.lo core core.* libintl.h
196
197clean: mostlyclean
198
199distclean: clean
200	rm -f config.status config.cache config.log config.intl config.h
201	rm -f Makefile ID TAGS
202
203maintainer-clean: distclean
204
205# The 'make dist' targets have been disabled; the GNU toolchain handles this
206# with a script maintained separately from the Makefile.
207dist:
208distdir:
209
210# Rules to rebuild the configuration
211
212Makefile: $(srcdir)/Makefile.in config.status
213	$(SHELL) ./config.status Makefile
214
215config.intl: $(srcdir)/config.intl.in config.status
216	$(SHELL) ./config.status config.intl
217
218config.status: $(srcdir)/configure
219	$(SHELL) ./config.status --recheck
220
221$(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/configure.ac
222	cd $(srcdir) && $(AUTOCONF)
223
224aclocal_deps = \
225	$(srcdir)/configure.ac \
226	$(srcdir)/../config/codeset.m4 \
227	$(srcdir)/../config/gettext.m4 \
228	$(srcdir)/../config/glibc21.m4 \
229	$(srcdir)/../config/iconv.m4 \
230	$(srcdir)/../config/intdiv0.m4 \
231	$(srcdir)/../config/inttypes-pri.m4 \
232	$(srcdir)/../config/inttypes.m4 \
233	$(srcdir)/../config/inttypes_h.m4 \
234	$(srcdir)/../config/lcmessage.m4 \
235	$(srcdir)/../config/lib-ld.m4 \
236	$(srcdir)/../config/lib-link.m4 \
237	$(srcdir)/../config/lib-prefix.m4 \
238	$(srcdir)/../config/nls.m4 \
239	$(srcdir)/../config/po.m4 \
240	$(srcdir)/../config/progtest.m4 \
241	$(srcdir)/../config/stdint_h.m4 \
242	$(srcdir)/../config/uintmax_t.m4 \
243	$(srcdir)/../config/ulonglong.m4
244
245$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
246	cd $(srcdir) && $(ACLOCAL) -I ../config
247
248config.h: stamp-h1
249	test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1)
250
251plural-config.h: plural.c
252
253stamp-h1: $(srcdir)/config.h.in config.status
254	-rm -f stamp-h1
255	$(SHELL) ./config.status config.h
256
257$(srcdir)/config.h.in: @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/configure.ac
258	cd $(srcdir) && $(AUTOHEADER)
259	-rm -f stamp-h1
260
261# Tell versions [3.59,3.63) of GNU make not to export all variables.
262# Otherwise a system limit (for SysV at least) may be exceeded.
263.NOEXPORT:
264