* cl.el: New version - 3.0 - from Cesar Quiroz.
[bpt/emacs.git] / 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 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.
10 # make install.aix to install on AIX.
11 # make tags to update tags tables.
12 #
13 # make distclean to delete everything that wasn't in the distribution.
14 # This is a very dangerous thing to do! It removes backup files,
15 # among other things.
16 # make clean
17 # This is a little less dangerous.
18 # make dist
19 # This produces a tar file from the current source tree suitable
20 # for redistribution.
21
22 SHELL = /bin/sh
23
24 # ==================== Where To Install Things ====================
25
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
32
33 # Where to install Emacs and other binaries that people will want to
34 # run directly (like etags).
35 bindir=${prefix}/bin
36
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.
40 emacsdir=${prefix}/emacs-19.0
41
42 # Where to install and expect the architecture-independent data files
43 # (like the tutorial and the Zippy database).
44 datadir=${emacsdir}/etc
45
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.
50 lispdir=${emacsdir}/lisp
51
52 # Directories Emacs should search for elisp files specific to this
53 # site (i.e. customizations), before consulting ${lispdir}. This
54 # should be a colon-separated list of directories.
55 locallisppath=${emacsdir}/local-lisp
56
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.
61 lisppath=${locallisppath}:${lispdir}
62
63 # Where Emacs will search for its elisp files while building. This is
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.
70 buildlisppath=../lisp
71
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.
75 statedir=${emacsdir}
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.
79 lockdir=${statedir}/lock
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.
84 libdir=${emacsdir}/arch-lib
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
90 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
91 # since there are now many packages documented with the texinfo
92 # system, it is inappropriate to imply that it is part of Emacs.
93 infodir=${prefix}/info
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 ==============================
106
107 # Flags passed down to subdirectory makefiles.
108 MFLAGS =
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.
113 SUBDIR = lib-src src
114
115 # Subdirectories to install, and where they'll go.
116 COPYDIR = arch-lib etc info lisp
117 COPYDESTS = ${libdir} ${datadir} ${infodir} ${lispdir}
118
119 all: src/paths.h ${SUBDIR}
120
121 removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'
122
123 # Note that sed is not in /bin on 386bsd.
124 src/paths.h: Makefile src/paths.h.in
125 lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
126 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
127 sed < src/paths.h.in > src/paths.h.tmp \
128 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
129 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
130 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${libdir}";' \
131 -e 's;\(#.*PATH_DATA\).*$$;\1 "${datadir}";' \
132 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";'
133 ./move-if-change src/paths.h.tmp src/paths.h
134
135 src: lib-src
136
137 .RECURSIVE: ${SUBDIR}
138
139 ${SUBDIR}: FRC
140 cd $@; make ${MFLAGS} all
141
142 install: all mkdir lockdir
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
162
163 install.sysv: all mkdir lockdir
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
182
183 install.xenix: all mkdir lockdir
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
204
205 install.aix: all mkdir lockdir
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
225
226 # Build all the directories
227 mkdir: FRC
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 \
233 mkdir ${emacsdir} ; \
234 chmod 777 ${emacsdir} ; \
235 fi ; \
236 break\
237 ;; \
238 esac ; \
239 done
240 -mkdir ${COPYDESTS}
241 -chmod 777 ${COPYDESTS}
242
243 lockdir:
244 # If the lockdir needs ${emacsdir}, create it.
245 -case "${lockdir}" in \
246 ${statedir}/* ) \
247 if [ ! -d ${emacsdir} ]; then \
248 mkdir ${emacsdir} ; \
249 chmod 777 ${emacsdir} ; \
250 fi \
251 ;; \
252 esac
253 -mkdir ${LOCKDIR}
254 -chmod 777 ${LOCKDIR}
255
256 FRC:
257
258 clean mostlyclean:
259 cd src; make clean
260 if [ `/bin/pwd` != `(cd ${emacsdir}; /bin/pwd)` ] ; then \
261 (cd etc; make clean); \
262 (cd lib-src; make clean); \
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
279 cd src; ../arch-lib/etags *.[ch] ../lisp/*.el ../lisp/term/*.el
280
281 check:
282 @echo "We don't have any tests for GNU Emacs yet."
283
284 dist:
285 make-dist