(Fmake_byte_code): Improve the `usage' string.
[emacs.git] / lib-src / Makefile.in
blobc88d868e3746034f4f1fbffb4124d06fafe4fe04
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003
3 # Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
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 2, or (at your option)
10 # any later version.
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.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs; see the file COPYING. If not, write to
19 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 # Boston, MA 02111-1307, USA.
22 # Avoid trouble on systems where the `SHELL' variable might be
23 # inherited from the environment.
24 SHELL = /bin/sh
26 # ==================== Things `configure' will edit ====================
28 CC=@CC@
29 CFLAGS=@CFLAGS@
30 ALLOCA=@ALLOCA@
31 version=@version@
32 configuration=@configuration@
33 EXEEXT=@EXEEXT@
35 # Program name transformation.
36 TRANSFORM = @program_transform_name@
38 # ==================== Where To Install Things ====================
40 # The default location for installation. Everything is placed in
41 # subdirectories of this directory. The default values for many of
42 # the variables below are expressed in terms of this one, so you may
43 # not need to change them. This is set with the --prefix option to
44 # `../configure'.
45 prefix=@prefix@
47 # Like `prefix', but used for architecture-specific files. This is
48 # set with the --exec-prefix option to `../configure'.
49 exec_prefix=@exec_prefix@
51 # Where to install Emacs and other binaries that people will want to
52 # run directly (like etags). This is set with the --bindir option
53 # to `../configure'.
54 bindir=@bindir@
56 # Where to install and expect executable files to be run by Emacs
57 # rather than directly by users, and other architecture-dependent
58 # data. ${archlibdir} is usually below this. This is set with the
59 # --libexecdir option to `../configure'.
60 libexecdir=@libexecdir@
62 # Directory for local state files for all programs.
63 localstatedir=@localstatedir@
65 # Where to find the source code. This is set by the configure
66 # script's `--srcdir' option. However, the value of ${srcdir} in
67 # this makefile is not identical to what was specified with --srcdir,
68 # since the variable here has `/lib-src' added at the end.
70 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
71 srcdir=@srcdir@
72 VPATH=@srcdir@
74 # The top-level source directory, also set by configure.
75 top_srcdir=@top_srcdir@
77 # ==================== Emacs-specific directories ====================
79 # These variables hold the values Emacs will actually use. They are
80 # based on the values of the standard Make variables above.
82 # Where to put executables to be run by Emacs rather than the user.
83 # This path usually includes the Emacs version and configuration name,
84 # so that multiple configurations for multiple versions of Emacs may
85 # be installed at once. This can be set with the --archlibdir option
86 # to `../configure'.
87 archlibdir=@archlibdir@
89 gamedir=@gamedir@
90 gameuser=@gameuser@
92 # ==================== Utility Programs for the Build =================
94 # ../configure figures out the correct values for these.
95 INSTALL = @INSTALL@
96 INSTALL_PROGRAM = @INSTALL_PROGRAM@
97 INSTALL_DATA = @INSTALL_DATA@
98 # By default, we uphold the dignity of our programs.
99 INSTALL_STRIP =
101 # ========================== Lists of Files ===========================
103 # Things that a user might actually run,
104 # which should be installed in bindir.
105 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} b2m${EXEEXT} ebrowse${EXEEXT}
106 INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
108 # Things that Emacs runs internally, or during the build process,
109 # which should not be installed in bindir.
110 UTILITIES= profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} movemail${EXEEXT} cvtmail${EXEEXT} fakemail${EXEEXT} \
111 yow${EXEEXT} hexl${EXEEXT} update-game-score${EXEEXT}
113 DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
115 # Like UTILITIES, but they're not system-dependent, and should not be
116 # deleted by the distclean target.
117 SCRIPTS= rcs2log vcdiff
119 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
121 SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
122 makedoc.com *.[chy] rcs2log vcdiff
124 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
125 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
126 # MAIL_USE_MMDF Support MMDF mailboxes.
127 # MAIL_USE_FLOCK Use flock for file locking (see the comments
128 # about locking in movemail.c)
129 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
130 # it (instead of just emptying it).
131 # KERBEROS Support Kerberized POP.
132 # KRB5 Support Kerberos Version 5 pop instead of
133 # Version 4 (define this in addition to
134 # KERBEROS).
135 # HESIOD Support Hesiod lookups of user mailboxes.
136 # MAILHOST A string, the host name of the default POP
137 # mail host for the site.
138 MOVE_FLAGS=
140 # ========================== start of cpp stuff =======================
141 /* From here on, comments must be done in C syntax. */
143 #define NO_SHORTNAMES
144 #define THIS_IS_MAKEFILE
145 #define NOT_C_CODE
146 #include "../src/config.h"
148 /* We won't really call alloca;
149 don't let the file name alloca.c get messed up. */
150 #ifdef alloca
151 #undef alloca
152 #endif
154 /* Some machines don\'t find the standard C libraries in the usual place. */
155 #ifndef ORDINARY_LINK
156 #ifndef LIB_STANDARD_LIBSRC
157 #define LIB_STANDARD_LIBSRC -lc
158 #endif
159 #else
160 #ifndef LIB_STANDARD_LIBSRC
161 #define LIB_STANDARD_LIBSRC
162 #endif
163 #endif
165 /* Some s/SYSTEM.h files define this to request special libraries. */
166 #ifndef LIBS_SYSTEM
167 #define LIBS_SYSTEM
168 #endif
170 /* Some m/MACHINE.h files define this to request special libraries. */
171 #ifndef LIBS_MACHINE
172 #define LIBS_MACHINE
173 #endif
175 #ifndef C_SWITCH_SYSTEM
176 #define C_SWITCH_SYSTEM
177 #endif
179 #ifndef C_SWITCH_MACHINE
180 #define C_SWITCH_MACHINE
181 #endif
183 #undef MOVEMAIL_NEEDS_BLESSING
184 #ifndef MAIL_USE_FLOCK
185 #ifndef MAIL_USE_LOCKF
186 #define MOVEMAIL_NEEDS_BLESSING
187 #endif
188 #endif
190 #ifdef MOVEMAIL_NEEDS_BLESSING
191 #define BLESSMAIL blessmail
192 #else
193 #define BLESSMAIL
194 #endif
196 #ifdef KERBEROS
197 # ifdef HAVE_LIBKRB
198 KRB4LIB = -lkrb
199 # else
200 # ifdef HAVE_LIBKRB4
201 KRB4LIB = -lkrb4
202 # endif
203 # endif
204 # ifdef HAVE_LIBDES
205 DESLIB = -ldes
206 # else
207 # ifdef HAVE_LIBDES425
208 DESLIB = -ldes425
209 # endif
210 # endif
211 # ifdef HAVE_LIBKRB5
212 KRB5LIB = -lkrb5
213 # endif
214 # ifdef HAVE_LIBK5CRYPTO
215 CRYPTOLIB = -lk5crypto
216 # else
217 # ifdef HAVE_LIBCRYPTO
218 CRYPTOLIB = -lcrypto
219 # endif
220 # endif
221 # ifdef HAVE_LIBCOM_ERR
222 COM_ERRLIB = -lcom_err
223 # endif
224 #endif /* KERBEROS */
226 /* If HESIOD is defined, set this to "-lhesiod". */
227 #ifdef HAVE_LIBHESIOD
228 # ifdef HAVE_LIBRESOLV
229 HESIODLIB= -lhesiod -lresolv
230 # else
231 HESIODLIB= -lhesiod
232 # endif
233 #endif
235 LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
237 #ifdef HAVE_LIBMAIL
238 LIBS_MAIL=-lmail
239 #endif
241 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
243 /* We need to #define emacs to get the right versions of some files.
244 Some other files - those shared with other GNU utilities - need
245 HAVE_CONFIG_H #defined before they know they can take advantage of
246 the information in ../src/config.h. */
247 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
248 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
249 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
250 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
251 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
252 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
253 /* This was all of CPP_CFLAGS except -Demacs.
254 Now that -Demacs has been deleted from CPP_CFLAGS,
255 this is actually the same as CPP_CFLAGS, but let\'s not delete it yet. */
256 BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
257 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
259 /* This is the default compilation command.
260 But we should never rely on it, because some make version
261 failed to find it for getopt.o.
262 Using an explicit command made it work. */
263 .c.o:
264 ${CC} -c ${CPP_CFLAGS} $<
266 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
268 /* These targets copy the scripts into the build directory
269 so that they can be run from there in an uninstalled Emacs. */
270 rcs2log: $(srcdir)/rcs2log
271 cp -p $(srcdir)/rcs2log rcs2log
273 rcs-checkin: $(srcdir)/rcs-checkin
274 cp -p $(srcdir)/rcs-checkin rcs-checkin
276 grep-changelog: $(srcdir)/grep-changelog
277 cp -p $(srcdir)/grep-changelog grep-changelog
279 vcdiff: $(srcdir)/vcdiff
280 cp -p $(srcdir)/vcdiff vcdiff
282 #ifdef MOVEMAIL_NEEDS_BLESSING
283 blessmail:
284 ../src/emacs -batch -l $(srcdir)/../lisp/mail/blessmail.el
285 chmod +x blessmail
286 #endif
288 maybe-blessmail: BLESSMAIL
289 #ifdef MOVEMAIL_NEEDS_BLESSING
290 /* Don\'t charge ahead and do it! Let the installer decide.
291 ./blessmail ${archlibdir}/movemail${EXEEXT} */
292 @if [ `wc -l <blessmail` != 2 ] ; then \
293 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
294 echo Assuming $$dir is really the mail spool directory, you should; \
295 echo run lib-src/blessmail ${archlibdir}/movemail${EXEEXT}; \
296 echo as root, to give movemail${EXEEXT} appropriate permissions.; \
297 echo Do that after running make install.; \
299 #endif
301 /* Install the internal utilities. Until they are installed, we can
302 just run them directly from lib-src. */
303 ${archlibdir}: all
304 @echo
305 @echo "Installing utilities run internally by Emacs."
306 $(top_srcdir)/mkinstalldirs ${archlibdir}
307 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
308 for file in ${UTILITIES}; do \
309 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file ${archlibdir}/$$file ; \
310 done ; \
312 $(top_srcdir)/mkinstalldirs ${gamedir}
313 touch ${gamedir}/snake-scores
314 touch ${gamedir}/tetris-scores
315 /* If the following commands fail, that is not a big deal.
316 update-game-score will detect at runtime that it is not setuid,
317 and handle things accordingly. */
318 -if chown ${gameuser} ${archlibdir}/update-game-score && chmod u+s ${archlibdir}/update-game-score; then \
319 chown ${gameuser} ${gamedir}; \
320 chmod u=rwx,g=rwx,o=rx ${gamedir}; \
322 if [ `(cd ${archlibdir} && /bin/pwd)` \
323 != `(cd ${srcdir} && /bin/pwd)` ]; then \
324 for file in ${SCRIPTS}; do \
325 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
326 done ; \
329 install: ${archlibdir}
330 @echo
331 @echo "Installing utilities for users to run."
332 for file in ${INSTALLABLES} ; do \
333 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
334 chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
335 done
336 for file in ${INSTALLABLE_SCRIPTS} ; do \
337 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
338 chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
339 done
341 uninstall:
342 (cd ${bindir}; \
343 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
344 rm -f ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
345 done)
346 (cd ${archlibdir}; \
347 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
349 mostlyclean:
350 -rm -f core *.o
352 clean: mostlyclean
353 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
354 -rm -f fns*.el *.tab.c *.tab.h
356 distclean: clean
357 -rm -f TAGS
358 -rm -f Makefile Makefile.c blessmail
360 maintainer-clean: distclean
361 true
363 extraclean: maintainer-clean
364 -rm -f *~ \#*
366 unlock:
367 chmod u+w $(SOURCES)
369 relock:
370 chmod u-w $(SOURCES)
372 /* Test the contents of the directory. */
373 check:
374 @echo "We don't have any tests for GNU Emacs yet."
376 tags: TAGS
377 TAGS: etags${EXEEXT}
378 etags *.[ch]
380 /* This verifies that the non-ASCII characters in the file \`testfile\'
381 have not been clobbered by whatever means were used to copy and
382 distribute Emacs. If they were clobbered, all the .elc files were
383 clobbered too. */
384 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
385 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
386 ./test-distrib ${srcdir}/testfile
388 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
389 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
390 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
391 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
392 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
393 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
394 alloca.o: ${srcdir}/alloca.c
395 ${CC} -Demacs -c ${BASE_CFLAGS} ${srcdir}/alloca.c
397 #ifdef REGEXP_IN_LIBC
398 REGEXPOBJ =
399 REGEXPDEPS =
400 #else
401 REGEXPOBJ = regex.o
402 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
403 #endif
405 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
406 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
408 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
409 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
411 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
412 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
414 /* We depend on etags to assure that parallel makes don\'t write two
415 etags.o files on top of each other. */
416 ctags${EXEEXT}: etags${EXEEXT}
417 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
419 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
420 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
422 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
423 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
425 digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
426 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
428 sorted-doc${EXEEXT}: ${srcdir}/sorted-doc.c ${ALLOCA}
429 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
431 b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
432 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
433 $(GETOPTOBJS) $(LOADLIBES) -o b2m
435 movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
436 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
438 movemail.o: ${srcdir}/movemail.c ../src/config.h
439 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
441 pop.o: ${srcdir}/pop.c ../src/config.h
442 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
444 cvtmail${EXEEXT}: ${srcdir}/cvtmail.c
445 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
447 fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
448 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
450 yow${EXEEXT}: ${srcdir}/yow.c ../src/epaths.h
451 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
453 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
454 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
455 -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \
456 $(LOADLIBES) -o emacsclient
458 hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
459 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
461 update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h
462 $(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c \
463 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
464 $(LOADLIBES) -o update-game-score
466 /* These are NOT included in INSTALLABLES or UTILITIES.
467 See ../src/Makefile.in. */
468 emacstool${EXEEXT}: ${srcdir}/emacstool.c
469 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
470 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
472 /* For SUN Japanese Language Environment. */
473 nemacstool${EXEEXT}: ${srcdir}/emacstool.c
474 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
475 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
477 xvetool${EXEEXT}: ${srcdir}/emacstool.c
478 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
479 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
480 $(LOADLIBES)
482 xveterm${EXEEXT}: ${srcdir}/emacstool.c
483 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
484 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
485 $(LOADLIBES)