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