3 # Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2014 Free Software
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/>.
23 # Following ../lisp/Makefile.in.
25 EMACSOPT
= -batch
--no-site-file
--no-site-lisp
27 # ==================== Things `configure' will edit ====================
33 ## Used in $archlibdir.
34 configuration
=@configuration@
36 C_SWITCH_SYSTEM
=@C_SWITCH_SYSTEM@
37 C_SWITCH_MACHINE
=@C_SWITCH_MACHINE@
38 PROFILING_CFLAGS
= @PROFILING_CFLAGS@
39 WARN_CFLAGS
= @WARN_CFLAGS@
40 WERROR_CFLAGS
= @WERROR_CFLAGS@
41 UPDATE_MANIFEST
= @UPDATE_MANIFEST@
43 # Program name transformation.
44 TRANSFORM
= @program_transform_name@
46 # ==================== Where To Install Things ====================
48 # Location to install Emacs.app under GNUstep / Mac OS X.
49 # Later values may use this.
50 ns_appbindir
=@ns_appbindir@
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
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@
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
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@
74 # Directory for local state files for all programs.
75 localstatedir
=@localstatedir@
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.
82 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
86 # The top-level source directory, also set by configure.
87 top_srcdir
=@top_srcdir@
88 # MinGW CPPFLAGS may use this.
89 abs_top_srcdir
=@abs_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
101 archlibdir
=@archlibdir@
106 # ==================== Utility Programs for the Build =================
108 # ../configure figures out the correct values for these.
110 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
111 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
112 # By default, we uphold the dignity of our programs.
116 # ========================== Lists of Files ===========================
118 # emacsclientw.exe for MinGW, empty otherwise
121 # Things that a user might actually run, which should be installed in bindir.
122 INSTALLABLES
= etags
${EXEEXT} ctags
${EXEEXT} emacsclient
${EXEEXT} $(CLIENTW
) \
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
= 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.
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
153 ## -ldes or -ldes425 if needed
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
184 CLIENTRES
= @CLIENTRES@
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.
212 $(EMACS
) $(EMACSOPT
) -l
$(srcdir)/..
/lisp
/mail
/blessmail.el
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
236 @echo
"Installing utilities run internally by Emacs."
237 umask
022; ${MKDIR_P} "$(DESTDIR)${archlibdir}"
238 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
239 if
[ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
240 for file in
${UTILITIES}; do \
241 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file "$(DESTDIR)${archlibdir}/$$file" ; \
244 umask
022; ${MKDIR_P} "$(DESTDIR)${gamedir}"; \
245 touch
"$(DESTDIR)${gamedir}/snake-scores"; \
246 touch
"$(DESTDIR)${gamedir}/tetris-scores"
247 -if chown
${gameuser} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && chmod u
+s
"$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; then \
248 chown
${gameuser} "$(DESTDIR)${gamedir}"; \
249 chmod u
=rwx
,g
=rwx
,o
=rx
"$(DESTDIR)${gamedir}"; \
251 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
252 if
[ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
253 for file in
${SCRIPTS}; do \
254 $(INSTALL_SCRIPT
) ${srcdir}/$$file "$(DESTDIR)${archlibdir}/$$file"; \
258 .PHONY
: install uninstall mostlyclean clean distclean maintainer-clean
259 .PHONY
: bootstrap-clean extraclean
check tags
261 install: $(DESTDIR
)${archlibdir}
263 @echo
"Installing utilities for users to run."
264 umask
022; ${MKDIR_P} "$(DESTDIR)${bindir}"
265 for file in
${INSTALLABLES} ; do \
266 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
268 for file in
${INSTALLABLE_SCRIPTS} ; do \
269 $(INSTALL_SCRIPT
) ${srcdir}/$${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \
273 for file in
${INSTALLABLES}; do \
274 rm -f
"$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
276 for file in
${INSTALLABLE_SCRIPTS}; do \
277 rm -f
"$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \
279 if
[ -d
"$(DESTDIR)${archlibdir}" ]; then \
280 (cd
"$(DESTDIR)${archlibdir}" && rm -f
${UTILITIES} ${SCRIPTS}) \
284 -rm -f core
*.o
*.res
291 -rm -f Makefile blessmail
293 bootstrap-clean maintainer-clean
: distclean
296 extraclean
: maintainer-clean
299 ## Test the contents of the directory.
301 @echo
"We don't have any tests for the lib-src/ directory yet."
307 ..
/lib
/libgnu.a
: $(config_h
)
308 $(MAKE
) -C ..
/lib libgnu.a
310 regex.o
: $(srcdir)/..
/src
/regex.c
$(srcdir)/..
/src
/regex.h
$(config_h
)
311 ${CC} -c
${CPP_CFLAGS} ${srcdir}/..
/src
/regex.c
314 etags_deps
= ${srcdir}/etags.c regex.o
$(NTLIB
) $(config_h
)
315 etags_cflags
= -DEMACS_NAME
="\"GNU Emacs\"" -DVERSION
="\"${version}\"" -o
$@
316 etags_libs
= regex.o
$(LOADLIBES
) $(NTLIB
)
318 etags
${EXEEXT}: ${etags_deps}
319 $(CC
) ${ALL_CFLAGS} $(etags_cflags
) $(srcdir)/etags.c
$(etags_libs
)
321 ## ctags.c is distinct from etags.c so that parallel makes do not write two
322 ## etags.o files on top of each other.
324 ## Can't we use a wrapper that calls 'etags --ctags'?
325 ctags
${EXEEXT}: ctags.c
${etags_deps}
326 $(CC
) ${ALL_CFLAGS} $(etags_cflags
) $(srcdir)/ctags.c
$(etags_libs
)
328 ebrowse
${EXEEXT}: ${srcdir}/ebrowse.c
${srcdir}/..
/lib
/min-max.h
$(NTLIB
) \
330 $(CC
) ${ALL_CFLAGS} -DVERSION
="\"${version}\"" \
331 ${srcdir}/ebrowse.c
$(LOADLIBES
) $(NTLIB
) -o
$@
333 profile
${EXEEXT}: ${srcdir}/profile.c
$(NTLIB
) $(config_h
)
334 $(CC
) ${ALL_CFLAGS} ${srcdir}/profile.c \
335 $(LOADLIBES
) $(NTLIB
) $(LIB_CLOCK_GETTIME
) -o
$@
337 make-docfile
${EXEEXT}: ${srcdir}/make-docfile.c
$(NTLIB
) $(config_h
)
338 $(CC
) ${ALL_CFLAGS} ${srcdir}/make-docfile.c
$(LOADLIBES
) $(NTLIB
) \
341 movemail
${EXEEXT}: ${srcdir}/movemail.c pop.o
$(NTLIB
) $(config_h
)
342 $(CC
) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
343 $(LOADLIBES
) $(NTLIB
) $(LIBS_MOVE
) -o
$@
345 pop.o
: ${srcdir}/pop.c
${srcdir}/pop.h
${srcdir}/..
/lib
/min-max.h
$(config_h
)
346 $(CC
) -c
${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
348 emacsclient
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(config_h
)
349 $(CC
) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
350 -DVERSION
="\"${version}\"" $(NTLIB
) $(LOADLIBES
) $(LIB_FDATASYNC
) \
351 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o
$@
353 emacsclientw
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(CLIENTRES
) $(config_h
)
354 $(CC
) ${ALL_CFLAGS} $(CLIENTRES
) -mwindows
${srcdir}/emacsclient.c \
355 -DVERSION
="\"${version}\"" $(LOADLIBES
) $(LIB_FDATASYNC
) \
356 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o
$@
358 NTINC
= ${srcdir}/..
/nt
/inc
359 NTDEPS
= $(NTINC
)/ms-w32.h
$(NTINC
)/sys
/stat.h
$(NTINC
)/inttypes.h \
360 $(NTINC
)/stdint.h
$(NTINC
)/pwd.h
$(NTINC
)/sys
/time.h
$(NTINC
)/stdbool.h \
361 $(NTINC
)/sys
/wait.h
$(NTINC
)/unistd.h
$(NTINC
)/sys
/file.h
$(NTINC
)/netdb.h
363 # The dependency on $(NTDEPS) is a trick intended to cause recompile of
364 # programs on MinGW whenever some private header in nt/inc is modified.
365 ntlib.o
: ${srcdir}/ntlib.c
${srcdir}/ntlib.h
$(NTDEPS
)
366 $(CC
) -c
${CPP_CFLAGS} ${srcdir}/ntlib.c
368 hexl
${EXEEXT}: ${srcdir}/hexl.c
$(NTLIB
) $(config_h
)
369 $(CC
) ${ALL_CFLAGS} ${srcdir}/hexl.c
$(LOADLIBES
) -o
$@
371 update-game-score
${EXEEXT}: ${srcdir}/update-game-score.c
$(NTLIB
) $(config_h
)
372 $(CC
) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR
="\"$(gamedir)\"" \
373 ${srcdir}/update-game-score.c
$(LOADLIBES
) $(NTLIB
) \
376 emacsclient.res
: $(NTINC
)/..
/emacsclient.rc
377 $(WINDRES
) -O coff
--include-dir
=$(NTINC
)/..
-o
$@ \
378 $(NTINC
)/..
/emacsclient.rc
380 ## Makefile ends here.