Improve Hebrew rendering.
[bpt/emacs.git] / lib-src / Makefile.in
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4
5 # This file is part of GNU Emacs.
6
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
23 SHELL = /bin/sh
24
25 # Following ../lisp/Makefile.in.
26 EMACS = ../src/emacs
27 EMACSOPT = -batch --no-site-file --multibyte
28
29 # ==================== Things `configure' will edit ====================
30
31 CC=@CC@
32 CFLAGS=@CFLAGS@
33 version=@version@
34 ## Used in $archlibdir.
35 configuration=@configuration@
36 EXEEXT=@EXEEXT@
37 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
38 C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
39
40 # Program name transformation.
41 TRANSFORM = @program_transform_name@
42
43 # ==================== Where To Install Things ====================
44
45 # The default location for installation. Everything is placed in
46 # subdirectories of this directory. The default values for many of
47 # the variables below are expressed in terms of this one, so you may
48 # not need to change them. This is set with the --prefix option to
49 # `../configure'.
50 prefix=@prefix@
51
52 # Like `prefix', but used for architecture-specific files. This is
53 # set with the --exec-prefix option to `../configure'.
54 exec_prefix=@exec_prefix@
55
56 # Where to install Emacs and other binaries that people will want to
57 # run directly (like etags). This is set with the --bindir option
58 # to `../configure'.
59 bindir=@bindir@
60
61 # Where to install and expect executable files to be run by Emacs
62 # rather than directly by users, and other architecture-dependent
63 # data. ${archlibdir} is usually below this. This is set with the
64 # --libexecdir option to `../configure'.
65 libexecdir=@libexecdir@
66
67 # Directory for local state files for all programs.
68 localstatedir=@localstatedir@
69
70 # Where to find the source code. This is set by the configure
71 # script's `--srcdir' option. However, the value of ${srcdir} in
72 # this makefile is not identical to what was specified with --srcdir,
73 # since the variable here has `/lib-src' added at the end.
74
75 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
76 srcdir=@srcdir@
77 VPATH=@srcdir@
78
79 # The top-level source directory, also set by configure.
80 top_srcdir=@top_srcdir@
81
82 # ==================== Emacs-specific directories ====================
83
84 # These variables hold the values Emacs will actually use. They are
85 # based on the values of the standard Make variables above.
86
87 # Where to put executables to be run by Emacs rather than the user.
88 # This path usually includes the Emacs version and configuration name,
89 # so that multiple configurations for multiple versions of Emacs may
90 # be installed at once. This can be set with the --archlibdir option
91 # to `../configure'.
92 archlibdir=@archlibdir@
93
94 gamedir=@gamedir@
95 gameuser=@gameuser@
96
97 # ==================== Utility Programs for the Build =================
98
99 # ../configure figures out the correct values for these.
100 INSTALL = @INSTALL@
101 INSTALL_PROGRAM = @INSTALL_PROGRAM@
102 INSTALL_DATA = @INSTALL_DATA@
103 INSTALL_SCRIPT = @INSTALL_SCRIPT@
104 # By default, we uphold the dignity of our programs.
105 INSTALL_STRIP =
106
107 # ========================== Lists of Files ===========================
108
109 # Things that a user might actually run, which should be installed in bindir.
110 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
111 b2m${EXEEXT} ebrowse${EXEEXT}
112
113 INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
114 STAMP_INST_SCRIPTS = stamp-rcs-checkin stamp-grep-changelog
115
116 # Things that Emacs runs internally, or during the build process,
117 # which should not be installed in bindir.
118 UTILITIES = profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \
119 movemail${EXEEXT} fakemail${EXEEXT} \
120 hexl${EXEEXT} update-game-score${EXEEXT}
121
122 DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
123
124 # Like UTILITIES, but they're not system-dependent, and should not be
125 # deleted by the distclean target.
126 SCRIPTS= rcs2log vcdiff
127 STAMP_SCRIPTS= stamp-rcs2log stamp-vcdiff
128
129 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
130
131 # Specify additional -D flags for movemail. Options:
132 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
133 # See the comments about locking in movemail.c. Normally the values
134 # set by configure should be correct and you should not need to do anything.
135 # If neither flag is set, you need to use blessmail.
136 MOVE_FLAGS=
137
138 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
139 BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
140
141 ## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4
142 KRB4LIB=@KRB4LIB@
143 ## -ldes if HAVE_LIBDES or -ldes425 if HAVE_LIBDES425
144 DESLIB=@DESLIB@
145 ## -lkrb5 if HAVE_LIBKRB5
146 KRB5LIB=@KRB5LIB@
147 ## -lk5crypto if HAVE_LIBK5CRYPTO or -lcrypto if HAVE_LIBCRYPTO
148 CRYPTOLIB=@CRYPTOLIB@
149 ## -lcom_err if HAVE_LIBCOM_ERR
150 COM_ERRLIB=@COM_ERRLIB@
151 ## -lhesiod if HAVE_LIBHESIOD
152 LIBHESIOD=@LIBHESIOD@
153 ## -lresolv if HAVE_LIBRESOLV
154 LIBRESOLV=@LIBRESOLV@
155 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
156 LIBS_MAIL=@LIBS_MAIL@
157
158 ## Extra libraries to use when linking movemail.
159 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
160 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
161
162 ## Some systems define this to request special libraries.
163 LIBS_SYSTEM = @LIBS_SYSTEM@
164
165 # Those files shared with other GNU utilities need HAVE_CONFIG_H
166 # defined before they know they can take advantage of the information
167 # in ../src/config.h.
168 BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \
169 -I. -I../src -I${srcdir} -I${srcdir}/../src
170
171 ALL_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
172 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
173 CPP_CFLAGS = ${BASE_CFLAGS} ${CPPFLAGS} ${CFLAGS}
174
175 LOADLIBES=$(LIBS_SYSTEM)
176
177 \f
178 ## This is the default compilation command.
179 ## But we should never rely on it, because some make version failed to
180 ## find it for getopt.o.
181 ## Using an explicit command made it work.
182 .c.o:
183 ${CC} -c ${CPP_CFLAGS} $<
184
185 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
186
187 ## These targets copy the scripts into the build directory so that
188 ## they can be run from there in an uninstalled Emacs.
189 ## The "-" is prepended because some versions of cp barf when srcdir
190 ## is the current directory, and thus the file will be copied into itself.
191 stamp-rcs2log: $(srcdir)/rcs2log
192 -cp -p $(srcdir)/rcs2log rcs2log
193 touch $@
194
195 stamp-rcs-checkin: $(srcdir)/rcs-checkin
196 -cp -p $(srcdir)/rcs-checkin rcs-checkin
197 touch $@
198
199 stamp-grep-changelog: $(srcdir)/grep-changelog
200 -cp -p $(srcdir)/grep-changelog grep-changelog
201 touch $@
202
203 stamp-vcdiff: $(srcdir)/vcdiff
204 -cp -p $(srcdir)/vcdiff vcdiff
205 touch $@
206
207 ## Only used if we need blessmail, but no harm in always defining.
208 ## This makes the actual blessmail executable.
209 blessmail:
210 $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
211 chmod +x blessmail
212
213 ## This checks if we need to run blessmail.
214 ## Do not charge ahead and do it! Let the installer decide.
215 need-blessmail: blessmail
216 @if [ `wc -l <blessmail` != 2 ] ; then \
217 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
218 echo Assuming $$dir is really the mail spool directory, you should; \
219 echo run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}; \
220 echo as root, to give movemail${EXEEXT} appropriate permissions.; \
221 echo Do that after running make install.; \
222 fi
223
224 ## This is the target invoked by the top-level Makefile.
225 maybe-blessmail: $(BLESSMAIL_TARGET)
226
227 ## Install the internal utilities. Until they are installed, we can
228 ## just run them directly from lib-src.
229 ## If the chown/chmod commands fail, that is not a big deal.
230 ## update-game-score will detect at runtime that it is not setuid,
231 ## and handle things accordingly.
232 $(DESTDIR)${archlibdir}: all
233 @echo
234 @echo "Installing utilities run internally by Emacs."
235 umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${archlibdir}
236 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
237 for file in ${UTILITIES}; do \
238 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
239 done ; \
240 fi
241 umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \
242 touch $(DESTDIR)${gamedir}/snake-scores; \
243 touch $(DESTDIR)${gamedir}/tetris-scores
244 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
245 chown ${gameuser} $(DESTDIR)${gamedir}; \
246 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
247 fi
248 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
249 != `(cd ${srcdir} && /bin/pwd)` ]; then \
250 for file in ${SCRIPTS}; do \
251 $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
252 done ; \
253 fi
254
255 install: $(DESTDIR)${archlibdir}
256 @echo
257 @echo "Installing utilities for users to run."
258 for file in ${INSTALLABLES} ; do \
259 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
260 chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
261 done
262 for file in ${INSTALLABLE_SCRIPTS} ; do \
263 $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
264 chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
265 done
266
267 uninstall:
268 (cd $(DESTDIR)${bindir}; \
269 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
270 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
271 done)
272 if [ -d $(DESTDIR)${archlibdir} ]; then \
273 (cd $(DESTDIR)${archlibdir} && \
274 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \
275 fi
276
277 mostlyclean:
278 -rm -f core *.o getopt.h getopt.h-t
279
280 clean: mostlyclean
281 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
282 -rm -f fns*.el *.tab.c *.tab.h stamp-*
283
284 distclean: clean
285 -rm -f TAGS
286 -rm -f Makefile blessmail
287
288 maintainer-clean: distclean
289 true
290
291 extraclean: maintainer-clean
292 -rm -f *~ \#*
293
294 ## Test the contents of the directory.
295 check:
296 @echo "We don't have any tests for the lib-src/ directory yet."
297
298 tags: TAGS
299 TAGS: etags${EXEEXT}
300 etags *.[ch]
301
302 ## This verifies that the non-ASCII characters in the file \`testfile\'
303 ## have not been clobbered by whatever means were used to copy and
304 ## distribute Emacs. If they were clobbered, all the .elc files were
305 ## clobbered too.
306 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
307 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
308 ./test-distrib ${srcdir}/testfile
309
310 ## We need the following in order to create a <getopt.h> when the system
311 ## does not have one that works with the given compiler.
312 GETOPT_H = @GETOPT_H@
313 getopt.h: getopt_.h
314 cp $(srcdir)/getopt_.h $@-t
315 mv $@-t $@
316
317 GETOPTOBJS = @GETOPTOBJS@
318 GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
319 getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
320 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
321 getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
322 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
323
324 REGEXPOBJ = regex.o
325 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
326
327 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
328 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
329 ${srcdir}/../src/regex.c
330
331 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
332 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
333 -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
334 $(REGEXPOBJ) $(LOADLIBES) -o etags
335
336 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
337 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
338 ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
339
340 ## We depend on etags to assure that parallel makes do not write two
341 ## etags.o files on top of each other.
342 ctags${EXEEXT}: etags${EXEEXT}
343 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
344 -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
345 $(REGEXPOBJ) $(LOADLIBES) -o ctags
346
347 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
348 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
349
350 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
351 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
352 -o make-docfile
353
354 digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
355 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
356
357 sorted-doc${EXEEXT}: ${srcdir}/sorted-doc.c
358 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c $(LOADLIBES) -o sorted-doc
359
360 b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
361 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
362 $(GETOPTOBJS) $(LOADLIBES) -o b2m
363
364 movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
365 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \
366 $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
367
368 movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
369 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
370
371 pop.o: ${srcdir}/pop.c ../src/config.h
372 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
373
374 fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
375 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
376
377 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
378 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
379 -DVERSION="\"${version}\"" \
380 $(LOADLIBES) -o emacsclient
381
382 hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
383 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
384
385 update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
386 $(CC) ${LINK_CFLAGS} update-game-score.o $(GETOPTOBJS) \
387 $(LOADLIBES) -o update-game-score
388
389 update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
390 $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
391 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
392
393 ## Makefile ends here.