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