]> code.delx.au - gnu-emacs/blob - lib-src/Makefile.in
merge master
[gnu-emacs] / lib-src / Makefile.in
1 ### @configure_input@
2
3 # Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2015 Free Software
4 # 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 SHELL = @SHELL@
22
23 # Following ../lisp/Makefile.in.
24 EMACS = ../src/emacs
25 EMACSOPT = -batch --no-site-file --no-site-lisp
26
27 # ==================== Things `configure' will edit ====================
28
29 CC=@CC@
30 CFLAGS=@CFLAGS@
31 CPPFLAGS = @CPPFLAGS@
32 LDFLAGS = @LDFLAGS@
33
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 PROFILING_CFLAGS = @PROFILING_CFLAGS@
41 WARN_CFLAGS = @WARN_CFLAGS@
42 WERROR_CFLAGS = @WERROR_CFLAGS@
43 UPDATE_MANIFEST = @UPDATE_MANIFEST@
44
45 # Program name transformation.
46 TRANSFORM = @program_transform_name@
47
48 # 'make' verbosity.
49 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
50
51 AM_V_CC = $(am__v_CC_@AM_V@)
52 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
53 am__v_CC_0 = @echo " CC " $@;
54 am__v_CC_1 =
55
56 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
57 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
58 am__v_CCLD_0 = @echo " CCLD " $@;
59 am__v_CCLD_1 =
60
61 AM_V_RC = $(am__v_RC_@AM_V@)
62 am__v_RC_ = $(am__v_RC_@AM_DEFAULT_V@)
63 am__v_RC_0 = @echo " RC " $@;
64 am__v_RC_1 =
65
66 # ==================== Where To Install Things ====================
67
68 # Location to install Emacs.app under GNUstep / Mac OS X.
69 # Later values may use this.
70 ns_appbindir=@ns_appbindir@
71
72 # The default location for installation. Everything is placed in
73 # subdirectories of this directory. The default values for many of
74 # the variables below are expressed in terms of this one, so you may
75 # not need to change them. This is set with the --prefix option to
76 # `../configure'.
77 prefix=@prefix@
78
79 # Like `prefix', but used for architecture-specific files. This is
80 # set with the --exec-prefix option to `../configure'.
81 exec_prefix=@exec_prefix@
82
83 # Where to install Emacs and other binaries that people will want to
84 # run directly (like etags). This is set with the --bindir option
85 # to `../configure'.
86 bindir=@bindir@
87
88 # Where to install and expect executable files to be run by Emacs
89 # rather than directly by users, and other architecture-dependent
90 # data. ${archlibdir} is usually below this. This is set with the
91 # --libexecdir option to `../configure'.
92 libexecdir=@libexecdir@
93
94 # Directory for local state files for all programs.
95 localstatedir=@localstatedir@
96
97 # Where to find the source code. This is set by the configure
98 # script's `--srcdir' option. However, the value of ${srcdir} in
99 # this makefile is not identical to what was specified with --srcdir,
100 # since the variable here has `/lib-src' added at the end.
101
102 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
103 srcdir=@srcdir@
104 VPATH=@srcdir@
105
106 # The top-level source directory, also set by configure.
107 top_srcdir=@top_srcdir@
108 # MinGW CPPFLAGS may use this.
109 abs_top_srcdir=@abs_top_srcdir@
110
111 # ==================== Emacs-specific directories ====================
112
113 # These variables hold the values Emacs will actually use. They are
114 # based on the values of the standard Make variables above.
115
116 # Where to put executables to be run by Emacs rather than the user.
117 # This path usually includes the Emacs version and configuration name,
118 # so that multiple configurations for multiple versions of Emacs may
119 # be installed at once. This can be set with the --archlibdir option
120 # to `../configure'.
121 archlibdir=@archlibdir@
122
123 gamedir=@gamedir@
124 gameuser=@gameuser@
125 gamegroup=@gamegroup@
126
127 # ==================== Utility Programs for the Build =================
128
129 # ../configure figures out the correct values for these.
130 INSTALL = @INSTALL@
131 INSTALL_PROGRAM = @INSTALL_PROGRAM@
132 INSTALL_SCRIPT = @INSTALL_SCRIPT@
133 # By default, we uphold the dignity of our programs.
134 INSTALL_STRIP =
135 MKDIR_P = @MKDIR_P@
136
137 # ========================== Lists of Files ===========================
138
139 # emacsclientw.exe for MinGW, empty otherwise
140 CLIENTW = @CLIENTW@
141
142 # Things that a user might actually run, which should be installed in bindir.
143 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \
144 ebrowse${EXEEXT}
145
146 # Things that Emacs runs internally, or during the build process,
147 # which should not be installed in bindir.
148 UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \
149 update-game-score${EXEEXT}
150
151 DONT_INSTALL= make-docfile${EXEEXT}
152
153 # Like UTILITIES, but they're not system-dependent, and should not be
154 # deleted by the distclean target.
155 SCRIPTS= rcs2log $(UPDATE_MANIFEST)
156
157 # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
158 EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
159
160 # Specify additional -D flags for movemail. Options:
161 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
162 # See the comments about locking in movemail.c. Normally the values
163 # set by configure should be correct and you should not need to do anything.
164 # If neither flag is set, you need to use blessmail.
165 MOVE_FLAGS=
166
167 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
168 BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
169
170 ## -lkrb or -lkrb4 if needed
171 KRB4LIB=@KRB4LIB@
172 ## -ldes or -ldes425 if needed
173 DESLIB=@DESLIB@
174 ## -lkrb5 if needed
175 KRB5LIB=@KRB5LIB@
176 ## -lk5crypto or -lcrypto if needed
177 CRYPTOLIB=@CRYPTOLIB@
178 ## -lcom_err if needed
179 COM_ERRLIB=@COM_ERRLIB@
180 ## -lhesiod if needed
181 LIBHESIOD=@LIBHESIOD@
182 ## -lresolv if HAVE_LIBRESOLV
183 LIBRESOLV=@LIBRESOLV@
184 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
185 LIBS_MAIL=@LIBS_MAIL@
186 ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
187 LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
188 ## empty or -lrt or -lposix4 if HAVE_FDATASYNC
189 LIB_FDATASYNC = @LIB_FDATASYNC@
190 ## empty or -lwsock2 for MinGW
191 LIB_WSOCK32=@LIB_WSOCK32@
192
193 ## Extra libraries to use when linking movemail.
194 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
195 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32)
196
197 ## Extra libraries when linking emacsclient
198 ## (empty or -lcomctl32 for MinGW)
199 LIBS_ECLIENT = @LIBS_ECLIENT@
200
201 ## Extra object files for linking for MinGW
202 NTLIB = @NTLIB@
203 CLIENTRES = @CLIENTRES@
204 WINDRES = @WINDRES@
205
206 ## Some systems define this to request special libraries.
207 LIBS_SYSTEM = @LIBS_SYSTEM@
208
209 BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
210 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
211 -I. -I../src -I../lib \
212 -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
213
214 ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
215 ## Unused.
216 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
217 CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
218
219 # Configuration files for .o files to depend on.
220 config_h = ../src/config.h $(srcdir)/../src/conf_post.h
221
222 all: ${EXE_FILES} ${SCRIPTS}
223
224 .PHONY: all need-blessmail maybe-blessmail
225
226 LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
227 $(EXE_FILES): ../lib/libgnu.a
228
229 ## Only used if we need blessmail, but no harm in always defining.
230 ## This makes the actual blessmail executable.
231 blessmail: $(srcdir)/../lisp/mail/blessmail.el
232 $(AM_V_GEN)$(EMACS) $(EMACSOPT) -l $<
233 $(AM_V_at)chmod +x $@
234
235 ## This checks if we need to run blessmail.
236 ## Do not charge ahead and do it! Let the installer decide.
237 need-blessmail: blessmail
238 @if [ `wc -l <blessmail` != 2 ] ; then \
239 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
240 echo "Assuming $$dir is really the mail spool directory, you should"; \
241 echo "run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}"; \
242 echo "as root, to give movemail${EXEEXT} appropriate permissions."; \
243 echo "Do that after running make install."; \
244 fi
245
246 ## This is the target invoked by the top-level Makefile.
247 maybe-blessmail: $(BLESSMAIL_TARGET)
248
249 ## Install the internal utilities. Until they are installed, we can
250 ## just run them directly from lib-src.
251 ## If the chown/chmod commands fail, that is not a big deal.
252 ## update-game-score will detect at runtime that it is not setuid,
253 ## and handle things accordingly.
254 $(DESTDIR)${archlibdir}: all
255 @echo
256 @echo "Installing utilities run internally by Emacs."
257 umask 022 && ${MKDIR_P} "$(DESTDIR)${archlibdir}"
258 exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd` && \
259 if [ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
260 for file in ${UTILITIES}; do \
261 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file \
262 "$(DESTDIR)${archlibdir}/$$file" || exit; \
263 done ; \
264 fi
265 umask 022 && ${MKDIR_P} "$(DESTDIR)${gamedir}" && \
266 touch "$(DESTDIR)${gamedir}/snake-scores" \
267 "$(DESTDIR)${gamedir}/tetris-scores"
268 ifneq ($(gameuser),)
269 if chown ${gameuser} \
270 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && \
271 chmod u+s,go-r \
272 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; \
273 then \
274 chown ${gameuser} "$(DESTDIR)${gamedir}" && \
275 chmod u=rwx,g=rx,o=rx "$(DESTDIR)${gamedir}"; \
276 fi
277 else ifneq ($(gamegroup),)
278 if chgrp ${gamegroup} \
279 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && \
280 chmod g+s,o-r \
281 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; \
282 then \
283 chgrp ${gamegroup} "$(DESTDIR)${gamedir}" && \
284 chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}"; \
285 fi
286 endif
287 exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd` && \
288 if [ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
289 for file in ${SCRIPTS}; do \
290 $(INSTALL_SCRIPT) ${srcdir}/$$file \
291 "$(DESTDIR)${archlibdir}/$$file" || exit; \
292 done ; \
293 fi
294
295 .PHONY: install uninstall mostlyclean clean distclean maintainer-clean
296 .PHONY: bootstrap-clean extraclean check tags
297
298 install: $(DESTDIR)${archlibdir}
299 @echo
300 @echo "Installing utilities for users to run."
301 umask 022 && ${MKDIR_P} "$(DESTDIR)${bindir}"
302 for file in ${INSTALLABLES} ; do \
303 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} \
304 "$(DESTDIR)${bindir}"/` \
305 echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)' \
306 `${EXEEXT} || exit; \
307 done
308
309 uninstall:
310 for file in ${INSTALLABLES}; do \
311 rm -f "$(DESTDIR)${bindir}"/` \
312 echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)' \
313 `${EXEEXT}; \
314 done
315 if [ -d "$(DESTDIR)${archlibdir}" ]; then \
316 cd "$(DESTDIR)${archlibdir}" && \
317 rm -f ${UTILITIES} ${SCRIPTS}; \
318 fi
319
320 mostlyclean:
321 rm -f core *.o *.res
322
323 clean: mostlyclean
324 rm -f ${EXE_FILES}
325
326 distclean: clean
327 rm -f TAGS Makefile blessmail
328
329 bootstrap-clean maintainer-clean: distclean
330
331 extraclean: maintainer-clean
332 rm -f *~ \#*
333
334 ## Test the contents of the directory.
335 check:
336 @echo "We don't have any tests for the lib-src/ directory yet."
337
338 tags: TAGS
339 TAGS: etags${EXEEXT}
340 etags *.[ch]
341
342 ../lib/libgnu.a: $(config_h)
343 $(MAKE) -C ../lib libgnu.a
344
345 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
346 $(AM_V_CC)$(CC) -c $(CPP_CFLAGS) $<
347
348
349 etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
350 etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
351 etags_libs = regex.o $(NTLIB) $(LOADLIBES)
352
353 etags${EXEEXT}: ${etags_deps}
354 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
355
356 ## ctags.c is distinct from etags.c so that parallel makes do not write two
357 ## etags.o files on top of each other.
358 ## FIXME?
359 ## Can't we use a wrapper that calls 'etags --ctags'?
360 ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps}
361 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
362
363 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
364 $(config_h)
365 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
366 $< $(NTLIB) $(LOADLIBES) -o $@
367
368 profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
369 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
370 $(NTLIB) $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o $@
371
372 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
373 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(NTLIB) $(LOADLIBES) -o $@
374
375 movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
376 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
377 $(NTLIB) $(LOADLIBES) $(LIBS_MOVE) -o $@
378
379 pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
380 $(AM_V_CC)$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $<
381
382 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
383 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
384 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
385 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
386
387 emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
388 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \
389 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
390 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
391
392 NTINC = ${srcdir}/../nt/inc
393 NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
394 $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \
395 $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h
396
397 # The dependency on $(NTDEPS) is a trick intended to cause recompile of
398 # programs on MinGW whenever some private header in nt/inc is modified.
399 ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
400 $(AM_V_CC)$(CC) -c ${CPP_CFLAGS} $<
401
402 hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
403 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LOADLIBES) -o $@
404
405 update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
406 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} \
407 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
408 $< $(NTLIB) $(LOADLIBES) -o $@
409
410 emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico
411 $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<
412
413 ## Makefile ends here.