1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
6 # GNU Emacs is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # GNU Emacs is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Emacs; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
25 # ==================== Things `configure' will edit ====================
32 configuration
=@configuration@
34 # ==================== Where To Install Things ====================
36 # The default location for installation. Everything is placed in
37 # subdirectories of this directory. The default values for many of
38 # the variables below are expressed in terms of this one, so you may
39 # not need to change them. This is set with the --prefix option to
43 # Like `prefix', but used for architecture-specific files. This is
44 # set with the --exec-prefix option to `../configure'.
45 exec_prefix=@
exec_prefix@
47 # Where to install Emacs and other binaries that people will want to
48 # run directly (like etags). This is set with the --bindir option
52 # Where to install and expect executable files to be run by Emacs
53 # rather than directly by users, and other architecture-dependent
54 # data. ${archlibdir} is usually below this. This is set with the
55 # --libexecdir option to `../configure'.
56 libexecdir
=@libexecdir@
58 # Where to find the source code. This is set by the configure
59 # script's `--srcdir' option. However, the value of ${srcdir} in
60 # this makefile is not identical to what was specified with --srcdir,
61 # since the variable here has `/lib-src' added at the end.
65 # The top-level source directory, also set by configure.
66 top_srcdir
=@top_srcdir@
68 # ==================== Emacs-specific directories ====================
70 # These variables hold the values Emacs will actually use. They are
71 # based on the values of the standard Make variables above.
73 # Where to put executables to be run by Emacs rather than the user.
74 # This path usually includes the Emacs version and configuration name,
75 # so that multiple configurations for multiple versions of Emacs may
76 # be installed at once. This can be set with the --archlibdir option
78 archlibdir
=@archlibdir@
80 # ==================== Utility Programs for the Build =================
82 # ../configure figures out the correct values for these.
84 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
85 INSTALL_DATA
= @INSTALL_DATA@
86 # By default, we uphold the dignity of our programs.
89 # ========================== Lists of Files ===========================
91 # Things that a user might actually run,
92 # which should be installed in bindir.
93 INSTALLABLES
= etags ctags emacsclient b2m
94 INSTALLABLE_SCRIPTS
= rcs-checkin
96 # Things that Emacs runs internally, or during the build process,
97 # which should not be installed in bindir.
98 UTILITIES
= profile digest-doc \
99 sorted-doc movemail cvtmail fakemail yow emacsserver hexl
101 DONT_INSTALL
= test-distrib make-docfile
103 # Like UTILITIES, but they're not system-dependent, and should not be
104 # deleted by the distclean target.
105 SCRIPTS
= rcs2log vcdiff
107 EXECUTABLES
= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
109 SOURCES
= COPYING ChangeLog Makefile.in README emacs.csh \
110 makedoc.com
*.
[chy
] rcs2log vcdiff
112 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
113 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
114 # MAIL_USE_MMDF Support MMDF mailboxes.
115 # MAIL_USE_FLOCK Use flock for file locking (see the comments
116 # about locking in movemail.c)
117 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
118 # it (instead of just emptying it).
119 # KERBEROS Support Kerberized POP.
120 # KRB5 Support Kerberos Version 5 pop instead of
121 # Version 4 (define this in addition to
123 # HESIOD Support Hesiod lookups of user mailboxes.
124 # MAILHOST A string, the host name of the default POP
125 # mail host for the site.
128 # ========================== start of cpp stuff =======================
129 /* From here on
, comments must be done in C syntax.
*/
131 #define NO_SHORTNAMES
132 #define THIS_IS_MAKEFILE
134 #include "../src/config.h"
136 /* We won
't really call alloca;
137 don't let the file name alloca.c
get messed up.
*/
142 /* Some machines don
't find the standard C libraries in the usual place. */
143 #ifndef ORDINARY_LINK
144 #ifndef LIB_STANDARD_LIBSRC
145 #define LIB_STANDARD_LIBSRC -lc
148 #ifndef LIB_STANDARD_LIBSRC
149 #define LIB_STANDARD_LIBSRC
153 /* Some s/SYSTEM.h files define this to request special libraries. */
158 /* Some m/MACHINE.h files define this to request special libraries. */
163 #ifndef C_SWITCH_SYSTEM
164 #define C_SWITCH_SYSTEM
167 #ifndef C_SWITCH_MACHINE
168 #define C_SWITCH_MACHINE
171 #undef MOVEMAIL_NEEDS_BLESSING
172 #ifndef MAIL_USE_FLOCK
173 #ifndef MAIL_USE_LOCKF
174 #define MOVEMAIL_NEEDS_BLESSING
178 #ifdef MOVEMAIL_NEEDS_BLESSING
179 #define BLESSMAIL blessmail
186 /* For krb5, use -lkrb5 */
190 /* For krb4, use -lcrypto */
193 #ifdef HAVE_LIBCOM_ERR
196 #endif /* KERBEROS */
198 /* If HESIOD is defined, set this to "-lhesiod". */
201 MOVE_LIBS=$(KRBLIB) $(DESLIB) $(COM_ERRLIB) $(HESIODLIB)
203 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
205 /* We need to #define emacs to get the right versions of some files.
206 Some other files - those shared with other GNU utilities - need
207 HAVE_CONFIG_H #defined before they know they can take advantage of
208 the information in ../src/config.h. */
209 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
210 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
211 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
212 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
213 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
214 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
215 /* This was all of CPP_CFLAGS except -Demacs.
216 Now that -Demacs has been deleted from CPP_CFLAGS,
217 this is actually the same as CPP_CFLAGS, but let's not delete it yet.
*/
218 BASE_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
219 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${CPPFLAGS} ${CFLAGS}
221 /* This is the default compilation command.
222 But we should never rely on it
, because some make version
223 failed to find it for getopt.o.
224 Using an explicit command made it work.
*/
226 ${CC} -c
${CPP_CFLAGS} $<
228 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
230 #ifdef MOVEMAIL_NEEDS_BLESSING
232 ..
/src
/emacs
-batch
-l
$(srcdir)/..
/lisp
/blessmail.el
236 maybe-blessmail
: BLESSMAIL
237 #ifdef MOVEMAIL_NEEDS_BLESSING
238 /* Don
't charge ahead and do it! Let the installer decide.
239 ./blessmail ${archlibdir}/movemail */
240 @if [ `wc -l <blessmail` != 2 ] ; then \
241 dir=`sed -n -e 's
/echo mail directory
= \
(.
*\
)/\
1/p
' blessmail`; \
242 echo Assuming $$dir is really the mail spool directory, you should; \
243 echo run lib-src/blessmail ${archlibdir}/movemail; \
244 echo as root, to give movemail appropriate permissions.; \
245 echo Do that after running make install.; \
249 /* Install the internal utilities. Until they are installed, we can
250 just run them directly from lib-src. */
253 @echo "Installing utilities run internally by Emacs."
254 $(top_srcdir)/mkinstalldirs ${archlibdir}
255 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
256 for file in ${UTILITIES}; do \
257 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file ${archlibdir}/$$file ; \
260 if [ `(cd ${archlibdir} && /bin/pwd)` \
261 != `(cd ${srcdir} && /bin/pwd)` ]; then \
262 for file in ${SCRIPTS}; do \
263 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
267 install: ${archlibdir}
269 @echo "Installing utilities for users to run."
270 for file in ${INSTALLABLES} ; do \
271 $(INSTALL_PROGRAM) $${file} ${bindir}/$${file} ; \
272 chmod a+rx ${bindir}/$${file}; \
274 for file in ${INSTALLABLE_SCRIPTS} ; do \
275 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \
276 chmod a+rx ${bindir}/$${file}; \
281 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
283 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
289 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
290 -rm -f ../etc/DOC* *.tab.c *.tab.h
294 -rm -f Makefile Makefile.c blessmail
296 maintainer-clean: distclean
299 extraclean: maintainer-clean
308 /* Test the contents of the directory. */
310 @echo "We don't have any tests for GNU Emacs yet.
"
316 /* This verifies that the non-ASCII characters in the file `testfile'
317 have not been clobbered by whatever means were used to copy and
318 distribute Emacs. If they were clobbered, all the .elc files were
320 test-distrib: ${srcdir}/test-distrib.c
321 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
322 ./test-distrib ${srcdir}/testfile
324 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
325 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
326 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
327 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
328 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
329 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
330 alloca.o: ${srcdir}/alloca.c
331 ${CC} -c ${BASE_CFLAGS} ${srcdir}/alloca.c
333 #ifdef REGEXP_IN_LIBC
338 REGEXPDEPS = $(REGEXPOBJ) ../src/regex.h
341 regex.o: ../src/regex.c ../src/regex.h ../src/config.h
342 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
344 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
345 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
347 /* We depend on etags to assure that parallel makes don't write two
348 etags.o files on top of each other. */
350 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
352 profile: ${srcdir}/profile.c
353 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
355 make-docfile: ${srcdir}/make-docfile.c
356 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
358 digest-doc: ${srcdir}/digest-doc.c
359 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
361 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
362 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
364 b2m: ${srcdir}/b2m.c ../src/config.h
365 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
367 movemail: movemail.o pop.o
368 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(LOADLIBES) $(MOVE_LIBS) -o movemail
370 movemail.o: ${srcdir}/movemail.c ../src/config.h
371 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
373 pop.o: ${srcdir}/pop.c
374 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
376 cvtmail: ${srcdir}/cvtmail.c
377 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
379 fakemail: ${srcdir}/fakemail.c ../src/config.h
380 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
382 yow: ${srcdir}/yow.c ../src/paths.h
383 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
385 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
386 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
388 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
389 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
391 hexl: ${srcdir}/hexl.c
392 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
394 /* These are NOT included in INSTALLABLES or UTILITIES.
395 See ../src/Makefile.in. */
396 emacstool: ${srcdir}/emacstool.c
397 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
398 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
400 /* For SUN Japanese Language Environment. */
401 nemacstool: ${srcdir}/emacstool.c
402 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
403 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
405 xvetool: ${srcdir}/emacstool.c
406 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
407 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
410 xveterm: ${srcdir}/emacstool.c
411 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
412 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \