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