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