* Makefile.in (EXECUTABLES): Remove; macro unused since 1993.
[bpt/emacs.git] / lib-src / Makefile.in
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 # Free Software Foundation, Inc.
5
6 # This file is part of GNU Emacs.
7
8 # GNU Emacs is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12
13 # GNU Emacs is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
20
21
22 # Avoid trouble on systems where the `SHELL' variable might be
23 # inherited from the environment.
24 SHELL = /bin/sh
25
26 # Following ../lisp/Makefile.in.
27 EMACS = ../src/emacs
28 EMACSOPT = -batch --no-site-file --no-site-lisp
29
30 # ==================== Things `configure' will edit ====================
31
32 CC=@CC@
33 CFLAGS=@CFLAGS@
34 version=@version@
35 ## Used in $archlibdir.
36 configuration=@configuration@
37 EXEEXT=@EXEEXT@
38 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
39 C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
40 C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
41 PROFILING_CFLAGS = @PROFILING_CFLAGS@
42
43 # Program name transformation.
44 TRANSFORM = @program_transform_name@
45
46 # ==================== Where To Install Things ====================
47
48 # The default location for installation. Everything is placed in
49 # subdirectories of this directory. The default values for many of
50 # the variables below are expressed in terms of this one, so you may
51 # not need to change them. This is set with the --prefix option to
52 # `../configure'.
53 prefix=@prefix@
54
55 # Like `prefix', but used for architecture-specific files. This is
56 # set with the --exec-prefix option to `../configure'.
57 exec_prefix=@exec_prefix@
58
59 # Where to install Emacs and other binaries that people will want to
60 # run directly (like etags). This is set with the --bindir option
61 # to `../configure'.
62 bindir=@bindir@
63
64 # Where to install and expect executable files to be run by Emacs
65 # rather than directly by users, and other architecture-dependent
66 # data. ${archlibdir} is usually below this. This is set with the
67 # --libexecdir option to `../configure'.
68 libexecdir=@libexecdir@
69
70 # Directory for local state files for all programs.
71 localstatedir=@localstatedir@
72
73 # Where to find the source code. This is set by the configure
74 # script's `--srcdir' option. However, the value of ${srcdir} in
75 # this makefile is not identical to what was specified with --srcdir,
76 # since the variable here has `/lib-src' added at the end.
77
78 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
79 srcdir=@srcdir@
80 VPATH=@srcdir@
81
82 # The top-level source directory, also set by configure.
83 top_srcdir=@top_srcdir@
84
85 # ==================== Emacs-specific directories ====================
86
87 # These variables hold the values Emacs will actually use. They are
88 # based on the values of the standard Make variables above.
89
90 # Where to put executables to be run by Emacs rather than the user.
91 # This path usually includes the Emacs version and configuration name,
92 # so that multiple configurations for multiple versions of Emacs may
93 # be installed at once. This can be set with the --archlibdir option
94 # to `../configure'.
95 archlibdir=@archlibdir@
96
97 gamedir=@gamedir@
98 gameuser=@gameuser@
99
100 # ==================== Utility Programs for the Build =================
101
102 # ../configure figures out the correct values for these.
103 INSTALL = @INSTALL@
104 INSTALL_PROGRAM = @INSTALL_PROGRAM@
105 INSTALL_DATA = @INSTALL_DATA@
106 INSTALL_SCRIPT = @INSTALL_SCRIPT@
107 # By default, we uphold the dignity of our programs.
108 INSTALL_STRIP =
109
110 # ========================== Lists of Files ===========================
111
112 # Things that a user might actually run, which should be installed in bindir.
113 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
114 ebrowse${EXEEXT}
115
116 INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
117 STAMP_INST_SCRIPTS = stamp-rcs-checkin stamp-grep-changelog
118
119 # Things that Emacs runs internally, or during the build process,
120 # which should not be installed in bindir.
121 UTILITIES = profile${EXEEXT} movemail${EXEEXT} fakemail${EXEEXT} \
122 hexl${EXEEXT} update-game-score${EXEEXT}
123
124 DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
125
126 # Like UTILITIES, but they're not system-dependent, and should not be
127 # deleted by the distclean target.
128 SCRIPTS= rcs2log vcdiff
129 STAMP_SCRIPTS= stamp-rcs2log stamp-vcdiff
130
131 # Specify additional -D flags for movemail. Options:
132 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
133 # See the comments about locking in movemail.c. Normally the values
134 # set by configure should be correct and you should not need to do anything.
135 # If neither flag is set, you need to use blessmail.
136 MOVE_FLAGS=
137
138 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
139 BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
140
141 ## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4
142 KRB4LIB=@KRB4LIB@
143 ## -ldes if HAVE_LIBDES or -ldes425 if HAVE_LIBDES425
144 DESLIB=@DESLIB@
145 ## -lkrb5 if HAVE_LIBKRB5
146 KRB5LIB=@KRB5LIB@
147 ## -lk5crypto if HAVE_LIBK5CRYPTO or -lcrypto if HAVE_LIBCRYPTO
148 CRYPTOLIB=@CRYPTOLIB@
149 ## -lcom_err if HAVE_LIBCOM_ERR
150 COM_ERRLIB=@COM_ERRLIB@
151 ## -lhesiod if HAVE_LIBHESIOD
152 LIBHESIOD=@LIBHESIOD@
153 ## -lresolv if HAVE_LIBRESOLV
154 LIBRESOLV=@LIBRESOLV@
155 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
156 LIBS_MAIL=@LIBS_MAIL@
157
158 ## Extra libraries to use when linking movemail.
159 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
160 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
161
162 ## Some systems define this to request special libraries.
163 LIBS_SYSTEM = @LIBS_SYSTEM@
164
165 # Those files shared with other GNU utilities need HAVE_CONFIG_H
166 # defined before they know they can take advantage of the information
167 # in ../src/config.h.
168 BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) ${C_WARNINGS_SWITCH} \
169 -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src
170
171 ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
172 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
173 CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
174
175 LOADLIBES=$(LIBS_SYSTEM)
176
177 ## This is the default compilation command.
178 ## But we should never rely on it, because some make version failed to
179 ## find it for getopt.o.
180 ## Using an explicit command made it work.
181 .c.o:
182 ${CC} -c ${CPP_CFLAGS} $<
183
184 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
185
186 ## These targets copy the scripts into the build directory so that
187 ## they can be run from there in an uninstalled Emacs.
188 ## The "-" is prepended because some versions of cp barf when srcdir
189 ## is the current directory, and thus the file will be copied into itself.
190 stamp-rcs2log: $(srcdir)/rcs2log
191 -cp -p $(srcdir)/rcs2log rcs2log
192 touch $@
193
194 stamp-rcs-checkin: $(srcdir)/rcs-checkin
195 -cp -p $(srcdir)/rcs-checkin rcs-checkin
196 touch $@
197
198 stamp-grep-changelog: $(srcdir)/grep-changelog
199 -cp -p $(srcdir)/grep-changelog grep-changelog
200 touch $@
201
202 stamp-vcdiff: $(srcdir)/vcdiff
203 -cp -p $(srcdir)/vcdiff vcdiff
204 touch $@
205
206 ## Only used if we need blessmail, but no harm in always defining.
207 ## This makes the actual blessmail executable.
208 blessmail:
209 $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
210 chmod +x blessmail
211
212 ## This checks if we need to run blessmail.
213 ## Do not charge ahead and do it! Let the installer decide.
214 need-blessmail: blessmail
215 @if [ `wc -l <blessmail` != 2 ] ; then \
216 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
217 echo Assuming $$dir is really the mail spool directory, you should; \
218 echo run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}; \
219 echo as root, to give movemail${EXEEXT} appropriate permissions.; \
220 echo Do that after running make install.; \
221 fi
222
223 ## This is the target invoked by the top-level Makefile.
224 maybe-blessmail: $(BLESSMAIL_TARGET)
225
226 ## Install the internal utilities. Until they are installed, we can
227 ## just run them directly from lib-src.
228 ## If the chown/chmod commands fail, that is not a big deal.
229 ## update-game-score will detect at runtime that it is not setuid,
230 ## and handle things accordingly.
231 $(DESTDIR)${archlibdir}: all
232 @echo
233 @echo "Installing utilities run internally by Emacs."
234 umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${archlibdir}
235 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
236 for file in ${UTILITIES}; do \
237 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
238 done ; \
239 fi
240 umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \
241 touch $(DESTDIR)${gamedir}/snake-scores; \
242 touch $(DESTDIR)${gamedir}/tetris-scores
243 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
244 chown ${gameuser} $(DESTDIR)${gamedir}; \
245 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
246 fi
247 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
248 != `(cd ${srcdir} && /bin/pwd)` ]; then \
249 for file in ${SCRIPTS}; do \
250 $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
251 done ; \
252 fi
253
254 install: $(DESTDIR)${archlibdir}
255 @echo
256 @echo "Installing utilities for users to run."
257 for file in ${INSTALLABLES} ; do \
258 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
259 chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
260 done
261 for file in ${INSTALLABLE_SCRIPTS} ; do \
262 $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
263 chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
264 done
265
266 uninstall:
267 (cd $(DESTDIR)${bindir}; \
268 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
269 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
270 done)
271 if [ -d $(DESTDIR)${archlibdir} ]; then \
272 (cd $(DESTDIR)${archlibdir} && \
273 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \
274 fi
275
276 mostlyclean:
277 -rm -f core *.o getopt.h getopt.h-t
278
279 clean: mostlyclean
280 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
281 -rm -f fns*.el *.tab.c *.tab.h stamp-*
282
283 distclean: clean
284 -rm -f TAGS
285 -rm -f Makefile blessmail
286
287 maintainer-clean: distclean
288 true
289
290 extraclean: maintainer-clean
291 -rm -f *~ \#*
292
293 ## Test the contents of the directory.
294 check:
295 @echo "We don't have any tests for the lib-src/ directory yet."
296
297 tags: TAGS
298 TAGS: etags${EXEEXT}
299 etags *.[ch]
300
301 ## This verifies that the non-ASCII characters in the file \`testfile\'
302 ## have not been clobbered by whatever means were used to copy and
303 ## distribute Emacs. If they were clobbered, all the .elc files were
304 ## clobbered too.
305 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
306 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
307 ./test-distrib ${srcdir}/testfile
308
309 ## We need the following in order to create a <getopt.h> when the system
310 ## does not have one that works with the given compiler.
311 GETOPT_H = @GETOPT_H@
312 getopt.h: getopt_.h
313 cp $(srcdir)/getopt_.h $@-t
314 mv $@-t $@
315
316 GETOPTOBJS = @GETOPTOBJS@
317 GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
318 getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
319 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
320 getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
321 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
322
323 REGEXPOBJ = regex.o
324 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
325
326 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
327 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
328 ${srcdir}/../src/regex.c
329
330 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
331 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
332 -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
333 $(REGEXPOBJ) $(LOADLIBES) -o etags
334
335 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
336 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
337 ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
338
339 ## We depend on etags to assure that parallel makes do not write two
340 ## etags.o files on top of each other.
341 ctags${EXEEXT}: etags${EXEEXT}
342 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
343 -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
344 $(REGEXPOBJ) $(LOADLIBES) -o ctags
345
346 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
347 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
348
349 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
350 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
351 -o make-docfile
352
353 movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
354 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \
355 $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
356
357 movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
358 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
359
360 pop.o: ${srcdir}/pop.c ../src/config.h
361 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
362
363 fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
364 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
365
366 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
367 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
368 -DVERSION="\"${version}\"" \
369 $(LOADLIBES) -o emacsclient
370
371 hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
372 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
373
374 update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
375 $(CC) ${LINK_CFLAGS} update-game-score.o $(GETOPTOBJS) \
376 $(LOADLIBES) -o update-game-score
377
378 update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
379 $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
380 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
381
382 ## Makefile ends here.