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