]> code.delx.au - gnu-emacs/blob - Makefile.in
* s/linux.h (SIGNALS_VIA_CHARACTERS): Try this out for a bit.
[gnu-emacs] / Makefile.in
1 # DIST: This is the distribution Makefile for Emacs. configure can
2 # DIST: make most of the changes to this file you might want, so try
3 # DIST: that first.
4
5 # make all to compile and build Emacs.
6 # make install to install it.
7 # make TAGS to update tags tables.
8 #
9 # make clean or make mostlyclean
10 # Delete all files from the current directory that are normally
11 # created by building the program. Don't delete the files that
12 # record the configuration. Also preserve files that could be made
13 # by building, but normally aren't because the distribution comes
14 # with them.
15 #
16 # Delete `.dvi' files here if they are not part of the distribution.
17 #
18 # make distclean
19 # Delete all files from the current directory that are created by
20 # configuring or building the program. If you have unpacked the
21 # source and built the program without creating any other files,
22 # `make distclean' should leave only the files that were in the
23 # distribution.
24 #
25 # make realclean
26 # Delete everything from the current directory that can be
27 # reconstructed with this Makefile. This typically includes
28 # everything deleted by distclean, plus more: C source files
29 # produced by Bison, tags tables, info files, and so on.
30 #
31 # make extraclean
32 # Still more severe - delete backup and autosave files, too.
33
34 SHELL = /bin/sh
35 MAKE = make # BSD doesn't have it as a default.
36
37 # ==================== Things `configure' Might Edit ====================
38
39 CC=@CC@
40 C_SWITCH_SYSTEM=@c_switch_system@
41 ALLOCA=@ALLOCA@
42 LN_S=@LN_S@
43 CFLAGS=@CFLAGS@
44 C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
45
46 ### These help us choose version- and architecture-specific directories
47 ### to install files in.
48
49 ### This should be the number of the Emacs version we're building,
50 ### like `18.59' or `19.0'.
51 version=@version@
52
53 ### This should be the name of the configuration we're building Emacs
54 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
55 configuration=@configuration@
56
57 ### Libraries which should be edited into lib-src/Makefile.
58 libsrc_libs=@libsrc_libs@
59
60 # ==================== Where To Install Things ====================
61
62 # The default location for installation. Everything is placed in
63 # subdirectories of this directory. The default values for many of
64 # the variables below are expressed in terms of this one, so you may
65 # not need to change them. This defaults to /usr/local.
66 prefix=@prefix@
67
68 # Like `prefix', but used for architecture-specific files.
69 exec_prefix=@exec_prefix@
70
71 # Where to install Emacs and other binaries that people will want to
72 # run directly (like etags).
73 bindir=${exec_prefix}/bin
74
75 # Where to install architecture-independent data files. ${lispdir}
76 # and ${etcdir} are subdirectories of this.
77 datadir=${prefix}/lib
78
79 # Where to install and expect the files that Emacs modifies as it
80 # runs. These files are all architecture-independent. Right now, the
81 # only such data is the locking directory; ${lockdir} is a
82 # subdirectory of this.
83 statedir=${prefix}/lib
84
85 # Where to install and expect executable files to be run by Emacs
86 # rather than directly by users, and other architecture-dependent
87 # data. ${archlibdir} is a subdirectory of this.
88 libdir=${exec_prefix}/lib
89
90 # Where to install Emacs's man pages, and what extension they should have.
91 mandir=${prefix}/man/man1
92 manext=.1
93
94 # Where to install and expect the info files describing Emacs. In the
95 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
96 # since there are now many packages documented with the texinfo
97 # system, it is inappropriate to imply that it is part of Emacs.
98 infodir=${prefix}/info
99
100 # Where to find the source code. The source code for Emacs's C kernel is
101 # expected to be in ${srcdir}/src, and the source code for Emacs's
102 # utility programs is expected to be in ${srcdir}/lib-src. This is
103 # set by the configure script's `--srcdir' option.
104 srcdir=@srcdir@
105
106 # ==================== Emacs-specific directories ====================
107
108 # These variables hold the values Emacs will actually use. They are
109 # based on the values of the standard Make variables above.
110
111 @inst_paths@# Where to install the lisp files distributed with
112 @inst_paths@# Emacs. This includes the Emacs version, so that the
113 @inst_paths@# lisp files for different versions of Emacs will install
114 @inst_paths@# themselves in separate directories.
115 @inst_paths@lispdir=${datadir}/emacs/${version}/lisp
116
117 @inst_paths@# Directories Emacs should search for lisp files specific
118 @inst_paths@# to this site (i.e. customizations), before consulting
119 @inst_paths@# ${lispdir}. This should be a colon-separated list of
120 @inst_paths@# directories.
121 @inst_paths@locallisppath=${datadir}/emacs/site-lisp
122
123 # Where Emacs will search to find its lisp files. Before
124 # changing this, check to see if your purpose wouldn't
125 # better be served by changing locallisppath. This
126 # should be a colon-separated list of directories.
127 lisppath=${locallisppath}:${lispdir}
128
129 # Where Emacs will search for its lisp files while
130 # building. This is only used during the process of
131 # compiling Emacs, to help Emacs find its lisp files
132 # before they've been installed in their final location.
133 # It's usually identical to lisppath, except that the
134 # entry for the directory containing the installed lisp
135 # files has been replaced with ../lisp. This should be a
136 # colon-separated list of directories.
137 buildlisppath=${srcdir}/lisp
138
139 @inst_paths@# Where to install the other architecture-independent
140 @inst_paths@# data files distributed with Emacs (like the tutorial,
141 @inst_paths@# the cookie recipes and the Zippy database). This path
142 @inst_paths@# usually contains the Emacs version number, so the data
143 @inst_paths@# files for multiple versions of Emacs may be installed
144 @inst_paths@# at once.
145 @inst_paths@etcdir=${datadir}/emacs/${version}/etc
146
147 @inst_paths@# Where to create and expect the locking directory, where
148 @inst_paths@# the Emacs locking code keeps track of which files are
149 @inst_paths@# currently being edited.
150 @inst_paths@lockdir=${statedir}/emacs/lock
151
152 @inst_paths@# Where to put executables to be run by Emacs rather than
153 @inst_paths@# the user. This path usually includes the Emacs version
154 @inst_paths@# and configuration name, so that multiple configurations
155 @inst_paths@# for multiple versions of Emacs may be installed at
156 @inst_paths@# once.
157 @inst_paths@archlibdir=${libdir}/emacs/${version}/${configuration}
158
159 # ====================== Developer's configuration =======================
160
161 # The following assignments make sense if you're running Emacs on a single
162 # machine, one version at a time, and you want changes to the lisp and etc
163 # directories in the source tree to show up immediately in your working
164 # environment. It saves a great deal of disk space by not duplicating the
165 # lisp and etc directories.
166
167 @rip_paths@lispdir=${srcdir}/lisp
168 @rip_paths@externallispdir=${srcdir}/externallisp
169 @rip_paths@locallisppath=${srcdir}/site-lisp:${datadir}/emacs/site-lisp
170 @rip_paths@etcdir=${srcdir}/etc
171 @rip_paths@lockdir=${srcdir}/lock
172 @rip_paths@archlibdir=${srcdir}/lib-src
173 @rip_paths@infodir=${srcdir}/info
174
175 # ==================== Utility Programs for the Build ====================
176
177 # Allow the user to specify the install program.
178 INSTALL = @INSTALL@
179 INSTALL_PROGRAM = @INSTALL_PROGRAM@
180 INSTALL_DATA = @INSTALL_DATA@
181
182 # ============================= Targets ==============================
183
184 # Flags passed down to subdirectory makefiles.
185 MFLAGS =
186
187 # Subdirectories to make recursively. `lisp' is not included
188 # because the compiled lisp files are part of the distribution
189 # and you cannot remake them without installing Emacs first.
190 SUBDIR = lib-src src
191
192 # The makefiles of the directories in $SUBDIR.
193 SUBDIR_MAKEFILES = lib-src/Makefile src/Makefile oldXMenu/Makefile
194
195 # Subdirectories to install, and where they'll go.
196 # lib-src's makefile knows how to install it, so we don't do that here.
197 # When installing the info files, we need to do special things to
198 # avoid nuking an existing dir file, so we don't do that here;
199 # instead, we have written out explicit code in the `install' targets.
200 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
201 COPYDESTS = ${etcdir} ${lispdir}
202
203 all: src/paths.h ${SUBDIR}
204
205 removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'
206
207 # We force the rebuilding of src/paths.h because the user might give
208 # make different values for the various directories. Since we use
209 # move-if-change, src/paths.h only actually changes if the user did
210 # something notable, so the only unnecessary work we do is in building
211 # src/paths.h.tmp, which isn't much.
212 # Note that sed is not in /bin on 386bsd.
213 src/paths.h: Makefile ${srcdir}/src/paths.h.in FRC
214 @echo "Producing \`src/paths.h' from \`src/paths.h.in'."
215 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
216 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
217 sed < ${srcdir}/src/paths.h.in > src/paths.h.tmp \
218 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
219 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
220 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
221 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
222 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
223 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";')
224 @${srcdir}/move-if-change src/paths.h.tmp src/paths.h
225
226 src: lib-src
227
228 .RECURSIVE: ${SUBDIR}
229
230 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
231 cd $@; $(MAKE) all ${MFLAGS} \
232 CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
233 prefix='${prefix}' srcdir='${srcdir}/$@' libdir='${libdir}'
234
235 ## We build the makefiles for the subdirectories here so that we can
236 ## edit the values for the path variables into them. This means that
237 ## when the user has built them from this makefile once, they will use
238 ## the right default values for the path variables.
239 lib-src/Makefile: ${srcdir}/lib-src/Makefile.in Makefile
240 rm -f lib-src/Makefile.tmp
241 @echo "Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
242 @(echo "# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
243 echo "# If you are thinking about editing it, you should seriously consider" ; \
244 echo "# running \`make lib-src/Makefile' at the top of the" ; \
245 echo "# Emacs build tree instead, or editing" ; \
246 echo "# \`${srcdir}/lib-src/Makefile.in' itself." ; \
247 sed < ${srcdir}/lib-src/Makefile.in \
248 -e 's|^\(version *=\).*$$|\1'"${version}"'|' \
249 -e 's|^\(configname *=\).*$$|\1'"${configuration}"'|' \
250 -e 's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
251 -e 's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
252 -e 's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
253 -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/lib-src|' \
254 -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/lib-src|' \
255 -e 's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
256 -e 's|^\(ALLOCA *=\).*$$|\1'"${ALLOCA}"'|' \
257 -e 's|^CC *=.*$$|CC='"${CC}"'|' \
258 -e 's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \
259 -e 's|^C_SWITCH_SYSTEM *=.*$$|C_SWITCH_SYSTEM='"${C_SWITCH_SYSTEM}"'|' \
260 -e 's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
261 -e '/^# DIST: /d') > lib-src/Makefile.tmp
262 @${srcdir}/move-if-change lib-src/Makefile.tmp lib-src/Makefile
263 chmod -w lib-src/Makefile
264
265 src/Makefile: ${srcdir}/src/Makefile.in Makefile
266 rm -f src/Makefile.tmp
267 @echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
268 @(echo "# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
269 echo "# If you are thinking about editing it, you should seriously consider" ; \
270 echo "# running \`make src/Makefile' at the top of the" ; \
271 echo "# Emacs build tree instead, or editing" ; \
272 echo "# \`${srcdir}/src/Makefile.in' itself." ; \
273 sed < ${srcdir}/src/Makefile.in \
274 -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/src|' \
275 -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/src|' \
276 -e 's|^CC *=.*$$|CC='"${CC}"'|' \
277 -e 's|^LN_S *=.*$$|LN_S='"${LN_S}"'|' \
278 -e 's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \
279 -e '/^# DIST: /d') > src/Makefile.tmp
280 @${srcdir}/move-if-change src/Makefile.tmp src/Makefile
281 chmod -w src/Makefile
282
283 oldXMenu/Makefile: ${srcdir}/oldXMenu/Makefile.in Makefile
284 rm -f oldXMenu/Makefile.tmp
285 @echo "Producing \`oldXMenu/Makefile' from \`${srcdir}/oldXMenu/Makefile.in'."
286 @(echo "# This file is generated from \`${srcdir}/oldXMenu/Makefile.in'." ; \
287 echo "# If you are thinking about editing it, you should seriously consider" ; \
288 echo "# running \`make oldXMenu/Makefile' at the top of the" ; \
289 echo "# Emacs build tree instead, or editing" ; \
290 echo "# \`${srcdir}/oldXMenu/Makefile.in' itself." ; \
291 sed < ${srcdir}/oldXMenu/Makefile.in \
292 -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \
293 -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \
294 -e 's|^\(C_SWITCH_X_SITE *=\).*$$|\1'"${C_SWITCH_X_SITE}"'|' \
295 -e 's|^CC *=.*$$|CC='"${CC}"'|' \
296 -e 's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \
297 -e '/^# DIST: /d') > oldXMenu/Makefile.tmp
298 @${srcdir}/move-if-change oldXMenu/Makefile.tmp oldXMenu/Makefile
299 chmod -w oldXMenu/Makefile
300
301 Makefile:
302 ./config.status
303
304 # ==================== Installation ====================
305
306 ## If we let lib-src do its own installation, that means we
307 ## don't have to duplicate the list of utilities to install in
308 ## this Makefile as well.
309
310 ## On AIX, use tar xBf.
311 ## On Xenix, use tar xpf.
312
313 ## We delete each directory in ${COPYDESTS} before we copy into it;
314 ## that way, we can reinstall over directories that have been put in
315 ## place with their files read-only (perhaps because they are checked
316 ## into RCS). In order to make this safe, we make sure that the
317 ## source exists and is distinct from the destination.
318 install: all do-install
319
320 do-install: mkdir
321 (cd lib-src; \
322 $(MAKE) install ${MFLAGS} prefix=${prefix} \
323 exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
324 archlibdir=${archlibdir})
325 -set ${COPYDESTS} ; \
326 for dir in ${COPYDIR} ; do \
327 if [ `(cd $$1 ; pwd)` != `(cd $${dir} ; pwd)` ] ; then \
328 rm -rf $$1 ; \
329 fi ; \
330 shift ; \
331 done
332 -set ${COPYDESTS} ; \
333 mkdir ${COPYDESTS} ; \
334 for dir in ${COPYDIR} ; do \
335 dest=$$1 ; shift ; \
336 [ -d $${dir} ] \
337 && [ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ] \
338 && (echo "Copying $${dir}..." ; \
339 (cd $${dir}; tar cf - . )|(cd $${dest}; umask 0; tar xvf - ); \
340 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
341 rm -rf $${subdir}/RCS ; \
342 rm -rf $${subdir}/CVS ; \
343 rm -f $${subdir}/\#* ; \
344 rm -f $${subdir}/*~ ; \
345 done) ; \
346 done
347 -[ `(cd etc; /bin/pwd)` != `(cd ${srcdir}/etc; /bin/pwd)` ] \
348 && (echo "Copying ./etc..." ; \
349 (cd ./etc; tar cf - . )|(cd ${etcdir}; umask 0; tar xvf - ); \
350 for subdir in `find ${etcdir} -type d ! -name RCS -print` ; do \
351 rm -rf $${subdir}/RCS ; \
352 rm -rf $${subdir}/CVS ; \
353 rm -f $${subdir}/\#* ; \
354 rm -f $${subdir}/*~ ; \
355 done)
356 -[ `(cd ${srcdir}/info; /bin/pwd)` != `(cd ${infodir}; /bin/pwd)` ] \
357 && (cd ${srcdir}/info ; \
358 if [ ! -f ${infodir}/dir ] && [ -f dir ]; then \
359 ${INSTALL_DATA} dir ${infodir}/dir ; \
360 fi ; \
361 for f in cl* emacs* forms* info* vip* ; do \
362 ${INSTALL_DATA} $$f ${infodir}/$$f ; \
363 done)
364 cd ${srcdir}/etc; for page in emacs etags ctags ; do \
365 ${INSTALL_DATA} $${page}.1 ${mandir}/$${page}${manext} ; \
366 done
367 ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version}
368 chmod 1755 ${bindir}/emacs-${version}
369 rm -f ${bindir}/emacs
370 ln ${bindir}/emacs-${version} ${bindir}/emacs
371
372 ### Build all the directories we're going to install Emacs in. Since
373 ### we may be creating several layers of directories (for example,
374 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
375 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
376 mkdir: FRC
377 ./lib-src/make-path ${COPYDESTS} ${lockdir} ${infodir} ${mandir} \
378 ${bindir} ${datadir} ${libdir} \
379 `echo ${locallisppath} | sed 's/:/ /'`
380 chmod 777 ${COPYDESTS} ${lockdir}
381
382 FRC:
383
384
385 # ==================== Cleaning up and miscellanea ====================
386
387 ### `clean'
388 ### Delete all files from the current directory that are normally
389 ### created by building the program. Don't delete the files that
390 ### record the configuration. Also preserve files that could be made
391 ### by building, but normally aren't because the distribution comes
392 ### with them.
393 ### `mostlyclean'
394 ### Like `clean', but may refrain from deleting a few files that
395 ### people normally don't want to recompile. For example, the
396 ### `mostlyclean' target for GCC does not delete `libgcc.a', because
397 ### recompiling it is rarely necessary and takes a lot of time.
398 ###
399 clean mostlyclean:
400 cd src; $(MAKE) clean
401 cd lib-src; $(MAKE) clean
402 cd oldXMenu; $(MAKE) clean
403 if [ `(cd ${etcdir} ; /bin/pwd)` != `(cd etc; /bin/pwd)` ] ; then \
404 cd etc; $(MAKE) clean; \
405 else true; \
406 fi
407
408 ### `distclean'
409 ### Delete all files from the current directory that are created by
410 ### configuring or building the program. This should leave only the
411 ### files that would be in the distribution.
412 distclean:
413 for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} distclean); done
414 -(cd lock; rm *)
415 -rm config.status config-tmp-*
416
417 ### `realclean'
418 ### Delete everything from the current directory that can be
419 ### reconstructed with this makefile. This typically includes
420 ### everything deleted by distclean, plus more: C source files
421 ### produced by Bison, tags tables, info files, and so on.
422 realclean:
423 for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} realclean); done
424 (cd lock; rm *)
425 rm config.status
426
427 ### This doesn't actually appear in the coding standards, but Karl
428 ### says GCC supports it, and that's where the configuration part of
429 ### the coding standards seem to come from. It's like distclean, but
430 ### it deletes backup and autosave files too.
431 extraclean:
432 for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} extraclean); done
433 -(cd lock; rm *)
434 -rm config.status config-tmp-*
435 -rm -f *~ \#*
436
437 ### Unlocking and relocking. The idea of these productions is to reduce
438 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
439 ### before unlocking the file to take the write locks off all sources so
440 ### that tar xvof will overwrite them without fuss. Then do `make relock'
441 ### afterward so that VC mode will know which files should be checked in
442 ### if you want to mung them.
443 ###
444 ### Note: it's no disaster if these productions miss a file or two; tar
445 ### and VC will swiftly let you know if this happens, and it is easily
446 ### corrected.
447 SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
448 README build-install.in configure make-dist move-if-change
449
450 unlock:
451 chmod u+w $(SOURCES) cpp/*
452 -(cd elisp; chmod u+w Makefile README *.texi)
453 (cd etc; make unlock)
454 (cd lib-src; make unlock)
455 (cd lisp; make unlock)
456 (cd lisp/term; chmod u+w README *.el)
457 (cd man; chmod u+w *texi* ChangeLog split-man)
458 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
459 (cd src; make unlock)
460
461 relock:
462 chmod u-w $(SOURCES) cpp/*
463 -(cd elisp; chmod u-w Makefile README *.texi)
464 (cd etc; make relock)
465 (cd lib-src; make relock)
466 (cd lisp; make relock)
467 (cd lisp/term; chmod u+w README *.el)
468 (cd man; chmod u+w *texi* ChangeLog split-man)
469 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
470 (cd src; make relock)
471
472 TAGS tags: lib-src
473 (cd ${srcdir} ; lib-src/etags --output=./src/TAGS \
474 src/*.[ch] lisp/*.el lisp/term/*.el)
475
476 check:
477 @echo "We don't have any tests for GNU Emacs yet."
478
479 dist:
480 cd ${srcdir}; make-dist