Remove lib-src/rcs-checkin
[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-2012
3 # Free Software Foundation, Inc.
4
5 # This file is part of GNU Emacs.
6
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
23 SHELL = /bin/sh
24
25 # Following ../lisp/Makefile.in.
26 EMACS = ../src/emacs
27 EMACSOPT = -batch --no-site-file --no-site-lisp
28
29 # ==================== Things `configure' will edit ====================
30
31 CC=@CC@
32 CFLAGS=@CFLAGS@
33 version=@version@
34 ## Used in $archlibdir.
35 configuration=@configuration@
36 EXEEXT=@EXEEXT@
37 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
38 C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
39 PROFILING_CFLAGS = @PROFILING_CFLAGS@
40 WARN_CFLAGS = @WARN_CFLAGS@
41 WERROR_CFLAGS = @WERROR_CFLAGS@
42
43 # Program name transformation.
44 TRANSFORM = @program_transform_name@
45
46 # ==================== Where To Install Things ====================
47
48 # Location to install Emacs.app under GNUstep / Mac OS X.
49 # Later values may use this.
50 ns_appbindir=@ns_appbindir@
51
52 # The default location for installation. Everything is placed in
53 # subdirectories of this directory. The default values for many of
54 # the variables below are expressed in terms of this one, so you may
55 # not need to change them. This is set with the --prefix option to
56 # `../configure'.
57 prefix=@prefix@
58
59 # Like `prefix', but used for architecture-specific files. This is
60 # set with the --exec-prefix option to `../configure'.
61 exec_prefix=@exec_prefix@
62
63 # Where to install Emacs and other binaries that people will want to
64 # run directly (like etags). This is set with the --bindir option
65 # to `../configure'.
66 bindir=@bindir@
67
68 # Where to install and expect executable files to be run by Emacs
69 # rather than directly by users, and other architecture-dependent
70 # data. ${archlibdir} is usually below this. This is set with the
71 # --libexecdir option to `../configure'.
72 libexecdir=@libexecdir@
73
74 # Directory for local state files for all programs.
75 localstatedir=@localstatedir@
76
77 # Where to find the source code. This is set by the configure
78 # script's `--srcdir' option. However, the value of ${srcdir} in
79 # this makefile is not identical to what was specified with --srcdir,
80 # since the variable here has `/lib-src' added at the end.
81
82 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
83 srcdir=@srcdir@
84 VPATH=@srcdir@
85
86 # The top-level source directory, also set by configure.
87 top_srcdir=@top_srcdir@
88
89 # ==================== Emacs-specific directories ====================
90
91 # These variables hold the values Emacs will actually use. They are
92 # based on the values of the standard Make variables above.
93
94 # Where to put executables to be run by Emacs rather than the user.
95 # This path usually includes the Emacs version and configuration name,
96 # so that multiple configurations for multiple versions of Emacs may
97 # be installed at once. This can be set with the --archlibdir option
98 # to `../configure'.
99 archlibdir=@archlibdir@
100
101 gamedir=@gamedir@
102 gameuser=@gameuser@
103
104 # ==================== Utility Programs for the Build =================
105
106 # ../configure figures out the correct values for these.
107 INSTALL = @INSTALL@
108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
109 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 # By default, we uphold the dignity of our programs.
111 INSTALL_STRIP =
112 MKDIR_P = @MKDIR_P@
113
114 # ========================== Lists of Files ===========================
115
116 # Things that a user might actually run, which should be installed in bindir.
117 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
118 ebrowse${EXEEXT}
119
120 INSTALLABLE_SCRIPTS = grep-changelog
121 STAMP_INST_SCRIPTS = stamp-grep-changelog
122
123 # Things that Emacs runs internally, or during the build process,
124 # which should not be installed in bindir.
125 UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \
126 update-game-score${EXEEXT}
127
128 DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
129
130 # Like UTILITIES, but they're not system-dependent, and should not be
131 # deleted by the distclean target.
132 SCRIPTS= rcs2log vcdiff
133 STAMP_SCRIPTS= stamp-rcs2log stamp-vcdiff
134
135 # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
136 EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
137
138 # Specify additional -D flags for movemail. Options:
139 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
140 # See the comments about locking in movemail.c. Normally the values
141 # set by configure should be correct and you should not need to do anything.
142 # If neither flag is set, you need to use blessmail.
143 MOVE_FLAGS=
144
145 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
146 BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
147
148 ## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4
149 KRB4LIB=@KRB4LIB@
150 ## -ldes if HAVE_LIBDES or -ldes425 if HAVE_LIBDES425
151 DESLIB=@DESLIB@
152 ## -lkrb5 if HAVE_LIBKRB5
153 KRB5LIB=@KRB5LIB@
154 ## -lk5crypto if HAVE_LIBK5CRYPTO or -lcrypto if HAVE_LIBCRYPTO
155 CRYPTOLIB=@CRYPTOLIB@
156 ## -lcom_err if HAVE_LIBCOM_ERR
157 COM_ERRLIB=@COM_ERRLIB@
158 ## -lhesiod if HAVE_LIBHESIOD
159 LIBHESIOD=@LIBHESIOD@
160 ## -lresolv if HAVE_LIBRESOLV
161 LIBRESOLV=@LIBRESOLV@
162 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
163 LIBS_MAIL=@LIBS_MAIL@
164
165 ## Extra libraries to use when linking movemail.
166 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
167 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
168
169 ## Some systems define this to request special libraries.
170 LIBS_SYSTEM = @LIBS_SYSTEM@
171
172 # Those files shared with other GNU utilities need HAVE_CONFIG_H
173 # defined before they know they can take advantage of the information
174 # in ../src/config.h.
175 BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
176 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
177 -DHAVE_CONFIG_H -I. -I../src -I../lib \
178 -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
179
180 ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
181 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
182 CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
183
184 all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
185
186 LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
187 $(EXE_FILES): ../lib/libgnu.a
188
189 ## These targets copy the scripts into the build directory so that
190 ## they can be run from there in an uninstalled Emacs.
191 ## Nothing to do if pwd = srcdir.
192 insrcdir=[ "`/bin/pwd`" = "`cd $(srcdir) && /bin/pwd`" ]
193
194 stamp-rcs2log: $(srcdir)/rcs2log
195 $(insrcdir) || cp -p $(srcdir)/rcs2log rcs2log
196 touch $@
197
198 stamp-grep-changelog: $(srcdir)/grep-changelog
199 $(insrcdir) || cp -p $(srcdir)/grep-changelog grep-changelog
200 touch $@
201
202 stamp-vcdiff: $(srcdir)/vcdiff
203 $(insrcdir) || 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; ${MKDIR_P} $(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; ${MKDIR_P} $(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 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
258 for file in ${INSTALLABLES} ; do \
259 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(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 done
264
265 uninstall:
266 (cd $(DESTDIR)${bindir}; \
267 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
268 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
269 done)
270 if [ -d $(DESTDIR)${archlibdir} ]; then \
271 (cd $(DESTDIR)${archlibdir} && \
272 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \
273 fi
274
275 mostlyclean:
276 -rm -f core *.o
277
278 clean: mostlyclean
279 -rm -f ${EXE_FILES}
280 -rm -f ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
281
282 distclean: clean
283 -rm -f TAGS
284 -rm -f Makefile blessmail
285
286 maintainer-clean: distclean
287 true
288
289 extraclean: maintainer-clean
290 -rm -f *~ \#*
291
292 ## Test the contents of the directory.
293 check:
294 @echo "We don't have any tests for the lib-src/ directory yet."
295
296 tags: TAGS
297 TAGS: etags${EXEEXT}
298 etags *.[ch]
299
300 ## This verifies that the non-ASCII characters in the file \`testfile\'
301 ## have not been clobbered by whatever means were used to copy and
302 ## distribute Emacs. If they were clobbered, all the .elc files were
303 ## clobbered too.
304 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
305 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
306 ./test-distrib ${srcdir}/testfile
307
308 ../lib/libgnu.a: ../src/config.h
309 cd ../lib && $(MAKE) libgnu.a
310
311 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
312 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
313 ${srcdir}/../src/regex.c
314
315 etags${EXEEXT}: ${srcdir}/etags.c regex.o ../src/config.h
316 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
317 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
318 regex.o $(LOADLIBES) -o etags
319
320 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h ../src/config.h
321 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
322 ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
323
324 ## We depend on etags to assure that parallel makes do not write two
325 ## etags.o files on top of each other.
326 ctags${EXEEXT}: etags${EXEEXT}
327 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
328 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
329 regex.o $(LOADLIBES) -o ctags
330
331 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
332 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
333
334 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
335 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
336 -o make-docfile
337
338 movemail${EXEEXT}: ${srcdir}/movemail.c pop.o ../src/config.h
339 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
340 $(LOADLIBES) $(LIBS_MOVE) -o movemail
341
342 pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h ../src/config.h
343 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
344
345 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h
346 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
347 -DVERSION="\"${version}\"" \
348 $(LOADLIBES) -o emacsclient
349
350 hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
351 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
352
353 update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h
354 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
355 ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
356
357 ## Makefile ends here.