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