(widget-specify-secret): New function.
[bpt/emacs.git] / lib-src / Makefile.in
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
3
4 # This file is part of GNU Emacs.
5
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)
9 # any later version.
10
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.
15
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.
20
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
23 SHELL = /bin/sh
24
25 # ==================== Things `configure' will edit ====================
26
27 CC=@CC@
28 CFLAGS=@CFLAGS@
29 ALLOCA=@ALLOCA@
30 YACC=@YACC@
31 version=@version@
32 configuration=@configuration@
33
34 # ==================== Where To Install Things ====================
35
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
40 # `../configure'.
41 prefix=@prefix@
42
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@
46
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
49 # to `../configure'.
50 bindir=@bindir@
51
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@
57
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.
62 srcdir=@srcdir@
63 VPATH=@srcdir@
64
65 # The top-level source directory, also set by configure.
66 top_srcdir=@top_srcdir@
67
68 # ==================== Emacs-specific directories ====================
69
70 # These variables hold the values Emacs will actually use. They are
71 # based on the values of the standard Make variables above.
72
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
77 # to `../configure'.
78 archlibdir=@archlibdir@
79
80 # ==================== Utility Programs for the Build =================
81
82 # ../configure figures out the correct values for these.
83 INSTALL = @INSTALL@
84 INSTALL_PROGRAM = @INSTALL_PROGRAM@
85 INSTALL_DATA = @INSTALL_DATA@
86 # By default, we uphold the dignity of our programs.
87 INSTALL_STRIP =
88
89 # ========================== Lists of Files ===========================
90
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
95
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
100
101 DONT_INSTALL= test-distrib make-docfile
102
103 # Like UTILITIES, but they're not system-dependent, and should not be
104 # deleted by the distclean target.
105 SCRIPTS= rcs2log vcdiff
106
107 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
108
109 SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
110 makedoc.com *.[chy] rcs2log vcdiff
111
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
122 # KERBEROS).
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.
126 MOVE_FLAGS=
127
128 # ========================== start of cpp stuff =======================
129 /* From here on, comments must be done in C syntax. */
130
131 #define NO_SHORTNAMES
132 #define THIS_IS_MAKEFILE
133 #define NOT_C_CODE
134 #include "../src/config.h"
135
136 /* We won't really call alloca;
137 don't let the file name alloca.c get messed up. */
138 #ifdef alloca
139 #undef alloca
140 #endif
141
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
146 #endif
147 #else
148 #ifndef LIB_STANDARD_LIBSRC
149 #define LIB_STANDARD_LIBSRC
150 #endif
151 #endif
152
153 /* Some s/SYSTEM.h files define this to request special libraries. */
154 #ifndef LIBS_SYSTEM
155 #define LIBS_SYSTEM
156 #endif
157
158 /* Some m/MACHINE.h files define this to request special libraries. */
159 #ifndef LIBS_MACHINE
160 #define LIBS_MACHINE
161 #endif
162
163 #ifndef C_SWITCH_SYSTEM
164 #define C_SWITCH_SYSTEM
165 #endif
166
167 #ifndef C_SWITCH_MACHINE
168 #define C_SWITCH_MACHINE
169 #endif
170
171 #undef MOVEMAIL_NEEDS_BLESSING
172 #ifndef MAIL_USE_FLOCK
173 #ifndef MAIL_USE_LOCKF
174 #define MOVEMAIL_NEEDS_BLESSING
175 #endif
176 #endif
177
178 #ifdef MOVEMAIL_NEEDS_BLESSING
179 #define BLESSMAIL blessmail
180 #else
181 #define BLESSMAIL
182 #endif
183
184 #ifdef KERBEROS
185 # ifdef HAVE_LIBKRB
186 KRB4LIB = -lkrb
187 # else
188 # ifdef HAVE_LIBKRB4
189 KRB4LIB = -lkrb4
190 # endif
191 # endif
192 # ifdef HAVE_LIBDES
193 DESLIB = -ldes
194 # else
195 # ifdef HAVE_LIBDES425
196 DESLIB = -ldes425
197 # endif
198 # endif
199 # ifdef HAVE_LIBKRB5
200 KRB5LIB = -lkrb5
201 # endif
202 # ifdef HAVE_LIBCRYPTO
203 CRYPTOLIB = -lcrypto
204 # endif
205 # ifdef HAVE_LIBCOM_ERR
206 COM_ERRLIB = -lcom_err
207 # endif
208 #endif /* KERBEROS */
209
210 /* If HESIOD is defined, set this to "-lhesiod". */
211 HESIODLIB=
212
213 MOVE_LIBS=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
214
215 #ifdef HAVE_LIBMAIL
216 LIBMAIL=-lmail
217 #endif
218
219 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
220
221 /* We need to #define emacs to get the right versions of some files.
222 Some other files - those shared with other GNU utilities - need
223 HAVE_CONFIG_H #defined before they know they can take advantage of
224 the information in ../src/config.h. */
225 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
226 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
227 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
228 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
229 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
230 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
231 /* This was all of CPP_CFLAGS except -Demacs.
232 Now that -Demacs has been deleted from CPP_CFLAGS,
233 this is actually the same as CPP_CFLAGS, but let's not delete it yet. */
234 BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
235 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
236 \f
237 /* This is the default compilation command.
238 But we should never rely on it, because some make version
239 failed to find it for getopt.o.
240 Using an explicit command made it work. */
241 .c.o:
242 ${CC} -c ${CPP_CFLAGS} $<
243
244 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
245
246 #ifdef MOVEMAIL_NEEDS_BLESSING
247 blessmail:
248 ../src/emacs -batch -l $(srcdir)/../lisp/mail/blessmail.el
249 chmod +x blessmail
250 #endif
251
252 maybe-blessmail: BLESSMAIL
253 #ifdef MOVEMAIL_NEEDS_BLESSING
254 /* Don't charge ahead and do it! Let the installer decide.
255 ./blessmail ${archlibdir}/movemail */
256 @if [ `wc -l <blessmail` != 2 ] ; then \
257 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
258 echo Assuming $$dir is really the mail spool directory, you should; \
259 echo run lib-src/blessmail ${archlibdir}/movemail; \
260 echo as root, to give movemail appropriate permissions.; \
261 echo Do that after running make install.; \
262 fi
263 #endif
264
265 /* Install the internal utilities. Until they are installed, we can
266 just run them directly from lib-src. */
267 ${archlibdir}: all
268 @echo
269 @echo "Installing utilities run internally by Emacs."
270 $(top_srcdir)/mkinstalldirs ${archlibdir}
271 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
272 for file in ${UTILITIES}; do \
273 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file ${archlibdir}/$$file ; \
274 done ; \
275 fi
276 if [ `(cd ${archlibdir} && /bin/pwd)` \
277 != `(cd ${srcdir} && /bin/pwd)` ]; then \
278 for file in ${SCRIPTS}; do \
279 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
280 done ; \
281 fi
282
283 install: ${archlibdir}
284 @echo
285 @echo "Installing utilities for users to run."
286 for file in ${INSTALLABLES} ; do \
287 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} ${bindir}/$${file} ; \
288 chmod a+rx ${bindir}/$${file}; \
289 done
290 for file in ${INSTALLABLE_SCRIPTS} ; do \
291 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \
292 chmod a+rx ${bindir}/$${file}; \
293 done
294
295 uninstall:
296 (cd ${bindir}; \
297 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
298 (cd ${archlibdir}; \
299 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
300
301 mostlyclean:
302 -rm -f core *.o
303
304 clean: mostlyclean
305 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
306 -rm -f ../etc/DOC* *.tab.c *.tab.h
307
308 distclean: clean
309 -rm -f TAGS
310 -rm -f Makefile Makefile.c blessmail
311
312 maintainer-clean: distclean
313 true
314
315 extraclean: maintainer-clean
316 -rm -f *~ \#*
317
318 unlock:
319 chmod u+w $(SOURCES)
320
321 relock:
322 chmod u-w $(SOURCES)
323
324 /* Test the contents of the directory. */
325 check:
326 @echo "We don't have any tests for GNU Emacs yet."
327
328 tags: TAGS
329 TAGS: etags
330 etags *.[ch]
331
332 /* This verifies that the non-ASCII characters in the file `testfile'
333 have not been clobbered by whatever means were used to copy and
334 distribute Emacs. If they were clobbered, all the .elc files were
335 clobbered too. */
336 test-distrib: ${srcdir}/test-distrib.c
337 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
338 ./test-distrib ${srcdir}/testfile
339
340 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
341 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
342 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
343 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
344 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
345 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
346 alloca.o: ${srcdir}/alloca.c
347 ${CC} -c ${BASE_CFLAGS} ${srcdir}/alloca.c
348
349 #ifdef REGEXP_IN_LIBC
350 REGEXPOBJ =
351 REGEXPDEPS =
352 #else
353 REGEXPOBJ = regex.o
354 REGEXPDEPS = $(REGEXPOBJ) ../src/regex.h
355 #endif
356
357 regex.o: ../src/regex.c ../src/regex.h ../src/config.h
358 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
359
360 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
361 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
362
363 /* We depend on etags to assure that parallel makes don't write two
364 etags.o files on top of each other. */
365 ctags: etags
366 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
367
368 profile: ${srcdir}/profile.c
369 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
370
371 make-docfile: ${srcdir}/make-docfile.c
372 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
373
374 digest-doc: ${srcdir}/digest-doc.c
375 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
376
377 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
378 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
379
380 b2m: ${srcdir}/b2m.c ../src/config.h
381 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
382 $(GETOPTOBJS) $(LOADLIBES) -o b2m
383
384 movemail: movemail.o pop.o $(GETOPTDEPS)
385 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBMAIL) $(MOVE_LIBS) -o movemail
386
387 movemail.o: ${srcdir}/movemail.c ../src/config.h
388 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
389
390 pop.o: ${srcdir}/pop.c
391 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
392
393 cvtmail: ${srcdir}/cvtmail.c
394 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
395
396 fakemail: ${srcdir}/fakemail.c ../src/config.h
397 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
398
399 yow: ${srcdir}/yow.c ../src/paths.h
400 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
401
402 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
403 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
404
405 emacsclient: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
406 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
407 -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \
408 $(LOADLIBES) -o emacsclient
409
410 hexl: ${srcdir}/hexl.c
411 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
412
413 /* These are NOT included in INSTALLABLES or UTILITIES.
414 See ../src/Makefile.in. */
415 emacstool: ${srcdir}/emacstool.c
416 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
417 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
418
419 /* For SUN Japanese Language Environment. */
420 nemacstool: ${srcdir}/emacstool.c
421 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
422 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
423
424 xvetool: ${srcdir}/emacstool.c
425 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
426 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
427 $(LOADLIBES)
428
429 xveterm: ${srcdir}/emacstool.c
430 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
431 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
432 $(LOADLIBES)