Commit | Line | Data |
---|---|---|
46947372 JB |
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. | |
86a5659e | 4 | |
46947372 JB |
5 | # make all to compile and build Emacs. |
6 | # make install to install it. | |
7 | # make install.sysv to install on system V. Note that on system V you | |
8 | # must change mandir to /usr/local/man/man1. | |
9 | # make install.xenix to install on Xenix. | |
badb0a97 | 10 | # make install.aix to install on AIX. |
46947372 | 11 | # make tags to update tags tables. |
86a5659e | 12 | # |
46947372 | 13 | # make distclean to delete everything that wasn't in the distribution. |
e4801b31 JB |
14 | # This is a very dangerous thing to do! It removes backup files, |
15 | # among other things. | |
86a5659e | 16 | # make clean |
46947372 | 17 | # This is a little less dangerous. |
4746118a JB |
18 | # make dist |
19 | # This produces a tar file from the current source tree suitable | |
20 | # for redistribution. | |
86a5659e JB |
21 | |
22 | SHELL = /bin/sh | |
23 | ||
46947372 | 24 | # ==================== Where To Install Things ==================== |
86a5659e | 25 | |
0c22fbca JB |
26 | version=version-not-set |
27 | configname=configuration-name-not-set | |
28 | ||
46947372 JB |
29 | # The default location for installation. Everything is placed in |
30 | # subdirectories of this directory. This directory must exist when | |
31 | # you start installation. The default values for many of the | |
32 | # variables below are expressed in terms of this one, so you may not | |
33 | # need to change them. | |
34 | prefix=/usr/local | |
86a5659e | 35 | |
46947372 JB |
36 | # Where to install Emacs and other binaries that people will want to |
37 | # run directly (like etags). | |
4746118a | 38 | bindir=${prefix}/bin |
86a5659e | 39 | |
0c22fbca JB |
40 | # Where to install architecture-independent data files. ${lispdir} |
41 | # and ${etcdir} are below this. | |
42 | datadir=${prefix}/lib/emacs/${version} | |
43 | ||
44 | # Where to install and expect the files that Emacs modifies as it | |
45 | # runs. These files are all architecture-independent. Right now, | |
46 | # the only such data is the locking directory. | |
47 | statedir=${prefix}/lib/emacs | |
48 | ||
49 | # Where to install and expect executable files to be run by Emacs | |
50 | # rather than directly by users, and other architecture-dependent | |
51 | # data. | |
52 | libdir=${prefix}/${version}/${configname} | |
53 | ||
54 | # Where to install Emacs's man pages, and what extension they should have. | |
55 | mandir=/usr/man/man1 | |
56 | manext=.1 | |
57 | ||
58 | # Where to install and expect the info files describing Emacs. In the | |
59 | # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but | |
60 | # since there are now many packages documented with the texinfo | |
61 | # system, it is inappropriate to imply that it is part of Emacs. | |
62 | infodir=${prefix}/info | |
86a5659e | 63 | |
0c22fbca JB |
64 | # Where to find the source code. The source code for Emacs's C kernel |
65 | # is expected to be in ${srcdir}/src, and the source code for Emacs's | |
66 | # utility programs is expected to be in ${srcdir}/lib-src. | |
67 | # This is set by the configure script's `--srcdir' option. | |
68 | srcdir=. | |
86a5659e | 69 | |
0c22fbca JB |
70 | |
71 | # ==================== Emacs-specific directories ==================== | |
72 | ||
73 | # Where to install the elisp files distributed with Emacs. | |
74 | lispdir=${datadir}/lisp | |
86a5659e | 75 | |
46947372 | 76 | # Directories Emacs should search for elisp files specific to this |
4746118a | 77 | # site (i.e. customizations), before consulting ${lispdir}. This |
46947372 | 78 | # should be a colon-separated list of directories. |
0c22fbca | 79 | locallisppath=${prefix}/lib/emacs/local-lisp |
86a5659e | 80 | |
46947372 JB |
81 | # Where Emacs will search to find its elisp files. Before changing |
82 | # this, check to see if your purpose wouldn't better be served by | |
83 | # changing locallisppath. This should be a colon-separated list of | |
84 | # directories. | |
4746118a | 85 | lisppath=${locallisppath}:${lispdir} |
86a5659e | 86 | |
4746118a | 87 | # Where Emacs will search for its elisp files while building. This is |
46947372 JB |
88 | # only used during the process of compiling Emacs, to help Emacs find |
89 | # its lisp files before they've been installed in their final | |
90 | # location. It's usually identical to lisppath, except that the entry | |
91 | # for the directory containing the installed lisp files has been | |
92 | # replaced with ../lisp. This should be a colon-separated list of | |
93 | # directories. | |
4746118a | 94 | buildlisppath=../lisp |
86a5659e | 95 | |
0c22fbca JB |
96 | # Where to install the other architecture-independent data files |
97 | # distributed with Emacs (like the tutorial, the cookie recipes and | |
98 | # the Zippy database). | |
99 | etcdir=${datadir}/etc | |
46947372 JB |
100 | |
101 | # Where to create and expect the locking directory, where the Emacs | |
102 | # locking code keeps track of which files are currently being edited. | |
4746118a | 103 | lockdir=${statedir}/lock |
46947372 | 104 | |
0c22fbca JB |
105 | # Where to put executables to be run by Emacs rather than the user. |
106 | archlibdir=${libdir} | |
46947372 | 107 | |
0c22fbca | 108 | # ==================== Things `configure' might edit ==================== |
46947372 | 109 | |
0c22fbca JB |
110 | CC=cc |
111 | CFLAGS=-g | |
46947372 JB |
112 | |
113 | # ==================== Utility Programs for the Build ==================== | |
114 | ||
115 | # Allow the user to specify the install program. | |
116 | INSTALL = install | |
117 | INSTALLFLAGS = -c | |
118 | INSTALL_PROGRAM = ${INSTALL} | |
119 | INSTALL_DATA = ${INSTALL} | |
120 | ||
46947372 | 121 | # ============================= Targets ============================== |
86a5659e JB |
122 | |
123 | # Flags passed down to subdirectory makefiles. | |
0c22fbca | 124 | MFLAGS = CC='${CC}' CFLAGS='${CFLAGS}' |
86a5659e JB |
125 | |
126 | # Subdirectories to make recursively. `lisp' is not included | |
127 | # because the compiled lisp files are part of the distribution | |
128 | # and you cannot remake them without installing Emacs first. | |
46947372 | 129 | SUBDIR = lib-src src |
86a5659e | 130 | |
46947372 JB |
131 | # Subdirectories to install, and where they'll go. |
132 | COPYDIR = arch-lib etc info lisp | |
4746118a | 133 | COPYDESTS = ${libdir} ${datadir} ${infodir} ${lispdir} |
86a5659e JB |
134 | |
135 | all: src/paths.h ${SUBDIR} | |
136 | ||
46947372 JB |
137 | removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/' |
138 | ||
692f9ac6 | 139 | # Note that sed is not in /bin on 386bsd. |
46947372 | 140 | src/paths.h: Makefile src/paths.h.in |
4746118a JB |
141 | lisppath=`echo ${lisppath} | ${removenullpaths}` ; \ |
142 | buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \ | |
e4801b31 | 143 | sed < src/paths.h.in > src/paths.h.tmp \ |
46947372 | 144 | -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \ |
4746118a JB |
145 | -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \ |
146 | -e 's;\(#.*PATH_EXEC\).*$$;\1 "${libdir}";' \ | |
147 | -e 's;\(#.*PATH_DATA\).*$$;\1 "${datadir}";' \ | |
32676c08 | 148 | -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";' |
e065a56e | 149 | ./move-if-change src/paths.h.tmp src/paths.h |
86a5659e JB |
150 | |
151 | src: lib-src | |
152 | ||
153 | .RECURSIVE: ${SUBDIR} | |
154 | ||
155 | ${SUBDIR}: FRC | |
156 | cd $@; make ${MFLAGS} all | |
157 | ||
158 | install: all mkdir lockdir | |
46947372 JB |
159 | -set ${COPYDESTS} ; \ |
160 | for dir in ${COPYDIR} ; do \ | |
161 | dest=$$1 ; shift ; \ | |
162 | if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \ | |
163 | (cd $${dir}; tar cf - . ) | (cd $${dest}; umask 0; tar xf - ) ; \ | |
164 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ | |
165 | rm -rf $${subdir}/RCS ; \ | |
166 | rm -f $${subdir}/\#* ; \ | |
167 | rm -f $${subdir}/*~ ; \ | |
168 | done ; \ | |
169 | fi ; \ | |
170 | done | |
171 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -c arch-lib/emacsclient ${bindir}/emacsclient | |
172 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -c arch-lib/etags ${bindir}/etags | |
173 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -c arch-lib/ctags ${bindir}/ctags | |
174 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -c -m 1755 src/xemacs ${bindir}/xemacs | |
175 | ${INSTALL_DATA} ${INSTALLFLAGS} -c -m 444 etc/emacs.1 ${mandir}/emacs.1 | |
176 | -rm -f ${bindir}/emacs | |
177 | mv ${bindir}/xemacs ${bindir}/emacs | |
86a5659e JB |
178 | |
179 | install.sysv: all mkdir lockdir | |
46947372 JB |
180 | -set ${COPYDESTS} ; \ |
181 | for dir in ${COPYDIR} ; do \ | |
182 | dest=$$1 ; shift ; \ | |
183 | if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \ | |
184 | (cd $${dir}; find . -print | cpio -pdum ${dest} ) ; \ | |
185 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ | |
186 | rm -rf $${subdir}/RCS ; \ | |
187 | rm -f $${subdir}/\#* ; \ | |
188 | rm -f $${subdir}/*~ ; \ | |
189 | done ; \ | |
190 | fi ; \ | |
191 | done | |
192 | -cpset arch-lib/emacsclient ${bindir}/emacsclient 755 bin bin | |
193 | -cpset arch-lib/etags ${bindir}/etags 755 bin bin | |
194 | -cpset arch-lib/ctags ${bindir}/ctags 755 bin bin | |
195 | -cpset etc/emacs.1 ${mandir}/emacs.1 444 bin bin | |
196 | -/bin/rm -f ${bindir}/emacs | |
197 | -cpset src/xemacs ${bindir}/emacs 1755 bin bin | |
86a5659e JB |
198 | |
199 | install.xenix: all mkdir lockdir | |
46947372 JB |
200 | -set ${COPYDESTS} ; \ |
201 | for dir in ${COPYDIR} ; do \ | |
202 | dest=$$1 ; shift ; \ | |
203 | if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \ | |
204 | (cd $${dir}; tar cf - . ) | (cd $${dest}; umask 0; tar xpf - ) ; \ | |
205 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ | |
206 | rm -rf $${subdir}/RCS ; \ | |
207 | rm -f $${subdir}/\#* ; \ | |
208 | rm -f $${subdir}/*~ ; \ | |
209 | done ; \ | |
210 | fi ; \ | |
211 | done | |
212 | cp arch-lib/etags arch-lib/ctags arch-lib/emacsclient ${bindir} | |
213 | chmod 755 ${bindir}/etags ${bindir}/ctags ${bindir}/emacsclient | |
214 | cp etc/emacs.1 ${mandir}/emacs.1 | |
215 | chmod 444 ${mandir}/emacs.1 | |
216 | -mv -f ${bindir}/emacs ${bindir}/emacs.old | |
217 | cp src/xemacs ${bindir}/emacs | |
218 | chmod 1755 ${bindir}/emacs | |
219 | -rm -f ${bindir}/emacs.old | |
86a5659e | 220 | |
badb0a97 | 221 | install.aix: all mkdir lockdir |
46947372 JB |
222 | -set ${COPYDESTS} ; \ |
223 | for dir in ${COPYDIR} ; do \ | |
224 | dest=$$1 ; shift ; \ | |
225 | if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \ | |
226 | (cd $${dir}; tar cf - . ) | (cd $${dest}; umask 0; tar xBf - ) ; \ | |
227 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ | |
228 | rm -rf $${subdir}/RCS ; \ | |
229 | rm -f $${subdir}/\#* ; \ | |
230 | rm -f $${subdir}/*~ ; \ | |
231 | done ; \ | |
232 | fi ; \ | |
233 | done | |
234 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -f ${bindir} etc/emacsclient | |
235 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -f ${bindir} etc/etags | |
236 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -f ${bindir} etc/ctags | |
237 | ${INSTALL_PROGRAM} ${INSTALLFLAGS} -M 1755 -f ${bindir} src/xemacs | |
238 | ${INSTALL_DATA} ${INSTALLFLAGS} -M 444 -f ${mandir} etc/emacs.1 | |
239 | -rm -f ${bindir}/emacs | |
240 | mv ${bindir}/xemacs ${bindir}/emacs | |
badb0a97 | 241 | |
46947372 | 242 | # Build all the directories |
86a5659e | 243 | mkdir: FRC |
46947372 JB |
244 | # If any of the directories are below ${emacsdir}, create it. |
245 | -for dir in ${COPYDESTS}; do \ | |
246 | case "$${dir}" in \ | |
247 | ${emacsdir}/* ) \ | |
248 | if [ ! -d ${emacsdir} ]; then \ | |
a88b5c25 JB |
249 | mkdir ${emacsdir} ; \ |
250 | chmod 777 ${emacsdir} ; \ | |
46947372 JB |
251 | fi ; \ |
252 | break\ | |
253 | ;; \ | |
254 | esac ; \ | |
255 | done | |
256 | -mkdir ${COPYDESTS} | |
257 | -chmod 777 ${COPYDESTS} | |
86a5659e JB |
258 | |
259 | lockdir: | |
46947372 JB |
260 | # If the lockdir needs ${emacsdir}, create it. |
261 | -case "${lockdir}" in \ | |
262 | ${statedir}/* ) \ | |
263 | if [ ! -d ${emacsdir} ]; then \ | |
a88b5c25 JB |
264 | mkdir ${emacsdir} ; \ |
265 | chmod 777 ${emacsdir} ; \ | |
46947372 JB |
266 | fi \ |
267 | ;; \ | |
268 | esac | |
86a5659e JB |
269 | -mkdir ${LOCKDIR} |
270 | -chmod 777 ${LOCKDIR} | |
271 | ||
272 | FRC: | |
273 | ||
46947372 JB |
274 | clean mostlyclean: |
275 | cd src; make clean | |
dc5a70f1 JB |
276 | if [ `/bin/pwd` != `(cd ${emacsdir}; /bin/pwd)` ] ; then \ |
277 | (cd etc; make clean); \ | |
278 | (cd lib-src; make clean); \ | |
46947372 JB |
279 | else true; \ |
280 | fi | |
281 | cd oldXMenu; make clean | |
282 | ||
283 | distclean: | |
284 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} distclean); done | |
285 | -(cd lock; rm *) | |
286 | -rm config.status config-tmp-* | |
287 | -rm #*# *~ | |
288 | ||
289 | realclean: | |
290 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} realclean); done | |
291 | (cd lock; rm *) | |
292 | rm config.status | |
293 | ||
294 | TAGS tags: lib-src | |
86a5659e | 295 | cd src; ../arch-lib/etags *.[ch] ../lisp/*.el ../lisp/term/*.el |
46947372 JB |
296 | |
297 | check: | |
298 | @echo "We don't have any tests for GNU Emacs yet." | |
4746118a JB |
299 | |
300 | dist: | |
301 | make-dist |