1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004,
3 # 2005, 2006 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)
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., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
22 # Avoid trouble on systems where the `SHELL' variable might be
23 # inherited from the environment.
26 # ==================== Things `configure' will edit ====================
31 configuration
=@configuration@
34 # Program name transformation.
35 TRANSFORM
= @program_transform_name@
37 # ==================== Where To Install Things ====================
39 # The default location for installation. Everything is placed in
40 # subdirectories of this directory. The default values for many of
41 # the variables below are expressed in terms of this one, so you may
42 # not need to change them. This is set with the --prefix option to
46 # Like `prefix', but used for architecture-specific files. This is
47 # set with the --exec-prefix option to `../configure'.
48 exec_prefix=@
exec_prefix@
50 # Where to install Emacs and other binaries that people will want to
51 # run directly (like etags). This is set with the --bindir option
55 # Where to install and expect executable files to be run by Emacs
56 # rather than directly by users, and other architecture-dependent
57 # data. ${archlibdir} is usually below this. This is set with the
58 # --libexecdir option to `../configure'.
59 libexecdir
=@libexecdir@
61 # Directory for local state files for all programs.
62 localstatedir
=@localstatedir@
64 # Where to find the source code. This is set by the configure
65 # script's `--srcdir' option. However, the value of ${srcdir} in
66 # this makefile is not identical to what was specified with --srcdir,
67 # since the variable here has `/lib-src' added at the end.
69 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
73 # The top-level source directory, also set by configure.
74 top_srcdir
=@top_srcdir@
76 # ==================== Emacs-specific directories ====================
78 # These variables hold the values Emacs will actually use. They are
79 # based on the values of the standard Make variables above.
81 # Where to put executables to be run by Emacs rather than the user.
82 # This path usually includes the Emacs version and configuration name,
83 # so that multiple configurations for multiple versions of Emacs may
84 # be installed at once. This can be set with the --archlibdir option
86 archlibdir
=@archlibdir@
91 # ==================== Utility Programs for the Build =================
93 # ../configure figures out the correct values for these.
95 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
96 INSTALL_DATA
= @INSTALL_DATA@
97 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
98 # By default, we uphold the dignity of our programs.
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 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
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.
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
146 #include "../src/config.h"
148 /* Some machines don
\'t find the standard C libraries in the usual place.
*/
149 #ifndef ORDINARY_LINK
150 #ifndef LIB_STANDARD_LIBSRC
151 #define LIB_STANDARD_LIBSRC -lc
154 #ifndef LIB_STANDARD_LIBSRC
155 #define LIB_STANDARD_LIBSRC
159 /* Some s
/SYSTEM.h files
define this to request special libraries.
*/
164 /* Some m
/MACHINE.h files
define this to request special libraries.
*/
169 #ifndef C_SWITCH_SYSTEM
170 #define C_SWITCH_SYSTEM
173 #ifndef C_SWITCH_MACHINE
174 #define C_SWITCH_MACHINE
177 #undef MOVEMAIL_NEEDS_BLESSING
178 #ifndef MAIL_USE_FLOCK
179 #ifndef MAIL_USE_LOCKF
180 #define MOVEMAIL_NEEDS_BLESSING
184 #ifdef MOVEMAIL_NEEDS_BLESSING
185 #define BLESSMAIL blessmail
201 # ifdef HAVE_LIBDES425
208 # ifdef HAVE_LIBK5CRYPTO
209 CRYPTOLIB
= -lk5crypto
211 # ifdef HAVE_LIBCRYPTO
215 # ifdef HAVE_LIBCOM_ERR
216 COM_ERRLIB
= -lcom_err
218 #endif /* KERBEROS */
220 /* If HESIOD is defined
, set this to
"-lhesiod".
*/
221 #ifdef HAVE_LIBHESIOD
222 # ifdef HAVE_LIBRESOLV
223 HESIODLIB
= -lhesiod
-lresolv
229 LIBS_MOVE
=$(KRB4LIB
) $(DESLIB
) $(KRB5LIB
) $(CRYPTOLIB
) $(COM_ERRLIB
) $(HESIODLIB
)
231 #ifdef HAVE_LIBLOCKFILE
239 LOADLIBES
=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
241 /* We need to
#define emacs to get the right versions of some files.
242 Some other files
- those shared with other GNU utilities
- need
243 HAVE_CONFIG_H
#defined before they know they can take advantage of
244 the information in ..
/src
/config.h.
*/
245 ALL_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
246 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
247 LINK_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
248 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${LDFLAGS} ${CFLAGS}
249 CPP_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
250 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${CPPFLAGS} ${CFLAGS}
251 /* This was
all of CPP_CFLAGS except
-Demacs.
252 Now that
-Demacs has been deleted from CPP_CFLAGS
,
253 this is actually the same
as CPP_CFLAGS
, but let
\'s not delete it yet.
*/
254 BASE_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
255 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${CPPFLAGS} ${CFLAGS}
257 /* This is the default compilation command.
258 But we should never rely on it
, because some make version
259 failed to find it for getopt.o.
260 Using an explicit command made it work.
*/
262 ${CC} -c
${CPP_CFLAGS} $<
264 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
266 /* These targets copy the scripts into the build directory
267 so that they can be run from there in an uninstalled Emacs.
*/
268 rcs2log
: $(srcdir)/rcs2log
269 cp
-p
$(srcdir)/rcs2log rcs2log
271 rcs-checkin
: $(srcdir)/rcs-checkin
272 cp
-p
$(srcdir)/rcs-checkin rcs-checkin
274 grep-changelog
: $(srcdir)/grep-changelog
275 cp
-p
$(srcdir)/grep-changelog grep-changelog
277 vcdiff
: $(srcdir)/vcdiff
278 cp
-p
$(srcdir)/vcdiff vcdiff
280 #ifdef MOVEMAIL_NEEDS_BLESSING
282 ..
/src
/emacs
-batch
-l
$(srcdir)/..
/lisp
/mail
/blessmail.el
286 maybe-blessmail
: BLESSMAIL
287 #ifdef MOVEMAIL_NEEDS_BLESSING
288 /* Don
\'t charge ahead and do it
! Let the installer decide.
289 .
/blessmail
$(DESTDIR
)${archlibdir}/movemail
${EXEEXT} */
290 @if
[ `wc -l <blessmail` != 2 ] ; then \
291 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
292 echo Assuming
$$dir is really the mail spool directory
, you should
; \
293 echo run lib-src
/blessmail
$(DESTDIR
)${archlibdir}/movemail
${EXEEXT}; \
294 echo
as root
, to give movemail
${EXEEXT} appropriate permissions.
; \
295 echo Do that after running make
install.
; \
299 /* Install the internal utilities. Until they are installed
, we can
300 just run them directly from lib-src.
*/
301 $(DESTDIR
)${archlibdir}: all
303 @echo
"Installing utilities run internally by Emacs."
304 $(top_srcdir
)/mkinstalldirs
$(DESTDIR
)${archlibdir}
305 if
[ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
306 for file in
${UTILITIES}; do \
307 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file $(DESTDIR
)${archlibdir}/$$file ; \
310 $(top_srcdir
)/mkinstalldirs
$(DESTDIR
)${gamedir}
311 touch
$(DESTDIR
)${gamedir}/snake-scores
312 touch
$(DESTDIR
)${gamedir}/tetris-scores
313 /* If the following commands fail
, that is not a big deal.
314 update-game-score will detect at runtime that it is not setuid
,
315 and handle things accordingly.
*/
316 -if chown
${gameuser} $(DESTDIR
)${archlibdir}/update-game-score
&& chmod u
+s
$(DESTDIR
)${archlibdir}/update-game-score
; then \
317 chown
${gameuser} $(DESTDIR
)${gamedir}; \
318 chmod u
=rwx
,g
=rwx
,o
=rx
$(DESTDIR
)${gamedir}; \
320 if
[ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
321 != `(cd ${srcdir} && /bin/pwd)` ]; then \
322 for file in
${SCRIPTS}; do \
323 $(INSTALL_SCRIPT
) ${srcdir}/$$file $(DESTDIR
)${archlibdir}/$$file; \
327 install: $(DESTDIR
)${archlibdir}
329 @echo
"Installing utilities for users to run."
330 for file in
${INSTALLABLES} ; do \
331 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $${file} $(DESTDIR
)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
332 chmod a
+rx
$(DESTDIR
)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
334 for file in
${INSTALLABLE_SCRIPTS} ; do \
335 $(INSTALL_SCRIPT
) ${srcdir}/$${file} $(DESTDIR
)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
336 chmod a
+rx
$(DESTDIR
)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
340 (cd
$(DESTDIR
)${bindir}; \
341 for file in
${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
342 rm -f
$(DESTDIR
)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
344 (cd
$(DESTDIR
)${archlibdir}; \
345 rm -f
${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
348 -rm -f core
*.o getopt.h getopt.h-t
351 -rm -f
${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
352 -rm -f fns
*.el
*.tab.c
*.tab.h
356 -rm -f Makefile Makefile.c blessmail
358 maintainer-clean
: distclean
361 extraclean
: maintainer-clean
370 /* Test the contents of the directory.
*/
372 @echo
"We don't have any tests for GNU Emacs yet."
378 /* This verifies that the non-ASCII characters in the file \
`testfile\'
379 have not been clobbered by whatever means were used to copy and
380 distribute Emacs. If they were clobbered, all the .elc files were
382 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
383 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
384 ./test-distrib ${srcdir}/testfile
386 /* We need the following in order to create a <getopt.h> when the system
387 doesn't have one that works with the given compiler. */
388 GETOPT_H = @GETOPT_H@
390 cp $(srcdir)/getopt_.h $@-t
393 GETOPTOBJS = @GETOPTOBJS@
394 GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
395 getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
396 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
397 getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
398 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
400 #ifdef REGEXP_IN_LIBC
405 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
408 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
409 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
411 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
412 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
414 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
415 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
417 /* We depend on etags to assure that parallel makes don\'t write two
418 etags.o files on top of each other. */
419 ctags${EXEEXT}: etags${EXEEXT}
420 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
422 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
423 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
425 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
426 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
428 digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
429 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
431 sorted-doc${EXEEXT}: ${srcdir}/sorted-doc.c
432 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c $(LOADLIBES) -o sorted-doc
434 b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
435 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
436 $(GETOPTOBJS) $(LOADLIBES) -o b2m
438 movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
439 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
441 movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
442 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
444 pop.o: ${srcdir}/pop.c ../src/config.h
445 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
447 cvtmail${EXEEXT}: ${srcdir}/cvtmail.c
448 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
450 fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
451 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
453 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
454 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
455 -DVERSION="\"${version}\"" \
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}: update-game-score.o $(GETOPTDEPS)
462 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} update-game-score.o $(GETOPTOBJS) $(LOADLIBES) -o update-game-score
464 update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
465 $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
466 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
468 /* These are NOT included in INSTALLABLES or UTILITIES.
469 See ../src/Makefile.in. */
470 emacstool${EXEEXT}: ${srcdir}/emacstool.c
471 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
472 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
474 /* For SUN Japanese Language Environment. */
475 nemacstool${EXEEXT}: ${srcdir}/emacstool.c
476 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
477 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
479 xvetool${EXEEXT}: ${srcdir}/emacstool.c
480 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
481 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
484 xveterm${EXEEXT}: ${srcdir}/emacstool.c
485 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
486 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \