3 # Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2015 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 ====================
32 ## Used in $archlibdir.
33 configuration
=@configuration@
35 C_SWITCH_SYSTEM
=@C_SWITCH_SYSTEM@
36 C_SWITCH_MACHINE
=@C_SWITCH_MACHINE@
37 PROFILING_CFLAGS
= @PROFILING_CFLAGS@
38 WARN_CFLAGS
= @WARN_CFLAGS@
39 WERROR_CFLAGS
= @WERROR_CFLAGS@
40 UPDATE_MANIFEST
= @UPDATE_MANIFEST@
42 # Program name transformation.
43 TRANSFORM
= @program_transform_name@
45 # ==================== Where To Install Things ====================
47 # Location to install Emacs.app under GNUstep / Mac OS X.
48 # Later values may use this.
49 ns_appbindir
=@ns_appbindir@
51 # The default location for installation. Everything is placed in
52 # subdirectories of this directory. The default values for many of
53 # the variables below are expressed in terms of this one, so you may
54 # not need to change them. This is set with the --prefix option to
58 # Like `prefix', but used for architecture-specific files. This is
59 # set with the --exec-prefix option to `../configure'.
60 exec_prefix=@
exec_prefix@
62 # Where to install Emacs and other binaries that people will want to
63 # run directly (like etags). This is set with the --bindir option
67 # Where to install and expect executable files to be run by Emacs
68 # rather than directly by users, and other architecture-dependent
69 # data. ${archlibdir} is usually below this. This is set with the
70 # --libexecdir option to `../configure'.
71 libexecdir
=@libexecdir@
73 # Directory for local state files for all programs.
74 localstatedir
=@localstatedir@
76 # Where to find the source code. This is set by the configure
77 # script's `--srcdir' option. However, the value of ${srcdir} in
78 # this makefile is not identical to what was specified with --srcdir,
79 # since the variable here has `/lib-src' added at the end.
81 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
85 # The top-level source directory, also set by configure.
86 top_srcdir
=@top_srcdir@
87 # MinGW CPPFLAGS may use this.
88 abs_top_srcdir
=@abs_top_srcdir@
90 # ==================== Emacs-specific directories ====================
92 # These variables hold the values Emacs will actually use. They are
93 # based on the values of the standard Make variables above.
95 # Where to put executables to be run by Emacs rather than the user.
96 # This path usually includes the Emacs version and configuration name,
97 # so that multiple configurations for multiple versions of Emacs may
98 # be installed at once. This can be set with the --archlibdir option
100 archlibdir
=@archlibdir@
105 # ==================== Utility Programs for the Build =================
107 # ../configure figures out the correct values for these.
109 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
110 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
111 # By default, we uphold the dignity of our programs.
115 # ========================== Lists of Files ===========================
117 # emacsclientw.exe for MinGW, empty otherwise
120 # Things that a user might actually run, which should be installed in bindir.
121 INSTALLABLES
= etags
${EXEEXT} ctags
${EXEEXT} emacsclient
${EXEEXT} $(CLIENTW
) \
124 INSTALLABLE_SCRIPTS
= grep-changelog
126 # Things that Emacs runs internally, or during the build process,
127 # which should not be installed in bindir.
128 UTILITIES
= profile
${EXEEXT} movemail
${EXEEXT} hexl
${EXEEXT} \
129 update-game-score
${EXEEXT}
131 DONT_INSTALL
= test-distrib
${EXEEXT} make-docfile
${EXEEXT}
133 # Like UTILITIES, but they're not system-dependent, and should not be
134 # deleted by the distclean target.
135 SCRIPTS
= rcs2log
$(UPDATE_MANIFEST
)
137 # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
138 EXE_FILES
= ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
140 # Specify additional -D flags for movemail. Options:
141 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
142 # See the comments about locking in movemail.c. Normally the values
143 # set by configure should be correct and you should not need to do anything.
144 # If neither flag is set, you need to use blessmail.
147 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
148 BLESSMAIL_TARGET
=@BLESSMAIL_TARGET@
150 ## -lkrb or -lkrb4 if needed
152 ## -ldes or -ldes425 if needed
156 ## -lk5crypto or -lcrypto if needed
157 CRYPTOLIB
=@CRYPTOLIB@
158 ## -lcom_err if needed
159 COM_ERRLIB
=@COM_ERRLIB@
160 ## -lhesiod if needed
161 LIBHESIOD
=@LIBHESIOD@
162 ## -lresolv if HAVE_LIBRESOLV
163 LIBRESOLV
=@LIBRESOLV@
164 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
165 LIBS_MAIL
=@LIBS_MAIL@
166 ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
167 LIB_CLOCK_GETTIME
= @LIB_CLOCK_GETTIME@
168 ## empty or -lrt or -lposix4 if HAVE_FDATASYNC
169 LIB_FDATASYNC
= @LIB_FDATASYNC@
170 ## empty or -lwsock2 for MinGW
171 LIB_WSOCK32
=@LIB_WSOCK32@
173 ## Extra libraries to use when linking movemail.
174 LIBS_MOVE
= $(LIBS_MAIL
) $(KRB4LIB
) $(DESLIB
) $(KRB5LIB
) $(CRYPTOLIB
) \
175 $(COM_ERRLIB
) $(LIBHESIOD
) $(LIBRESOLV
) $(LIB_WSOCK32
)
177 ## Extra libraries when linking emacsclient
178 ## (empty or -lcomctl32 for MinGW)
179 LIBS_ECLIENT
= @LIBS_ECLIENT@
181 ## Extra object files for linking for MinGW
183 CLIENTRES
= @CLIENTRES@
186 ## Some systems define this to request special libraries.
187 LIBS_SYSTEM
= @LIBS_SYSTEM@
189 BASE_CFLAGS
= $(C_SWITCH_SYSTEM
) $(C_SWITCH_MACHINE
) \
190 $(WARN_CFLAGS
) $(WERROR_CFLAGS
) \
191 -I.
-I..
/src
-I..
/lib \
192 -I
${srcdir} -I
${srcdir}/..
/src
-I
${srcdir}/..
/lib
194 ALL_CFLAGS
= ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
195 LINK_CFLAGS
= ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
196 CPP_CFLAGS
= ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
198 # Configuration files for .o files to depend on.
199 config_h
= ..
/src
/config.h
$(srcdir)/..
/src
/conf_post.h
201 all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
203 .PHONY
: all need-blessmail maybe-blessmail
205 LOADLIBES
= ..
/lib
/libgnu.a
$(LIBS_SYSTEM
)
206 $(EXE_FILES
): ..
/lib
/libgnu.a
208 ## Only used if we need blessmail, but no harm in always defining.
209 ## This makes the actual blessmail executable.
211 $(EMACS
) $(EMACSOPT
) -l
$(srcdir)/..
/lisp
/mail
/blessmail.el
214 ## This checks if we need to run blessmail.
215 ## Do not charge ahead and do it! Let the installer decide.
216 need-blessmail
: blessmail
217 @if
[ `wc -l <blessmail` != 2 ] ; then \
218 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
219 echo
"Assuming $$dir is really the mail spool directory, you should"; \
220 echo
"run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}"; \
221 echo
"as root, to give movemail${EXEEXT} appropriate permissions."; \
222 echo
"Do that after running make install."; \
225 ## This is the target invoked by the top-level Makefile.
226 maybe-blessmail
: $(BLESSMAIL_TARGET
)
228 ## Install the internal utilities. Until they are installed, we can
229 ## just run them directly from lib-src.
230 ## If the chown/chmod commands fail, that is not a big deal.
231 ## update-game-score will detect at runtime that it is not setuid,
232 ## and handle things accordingly.
233 $(DESTDIR
)${archlibdir}: all
235 @echo
"Installing utilities run internally by Emacs."
236 umask
022; ${MKDIR_P} "$(DESTDIR)${archlibdir}"
237 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
238 if
[ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
239 for file in
${UTILITIES}; do \
240 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file "$(DESTDIR)${archlibdir}/$$file" ; \
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 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
251 if
[ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
252 for file in
${SCRIPTS}; do \
253 $(INSTALL_SCRIPT
) ${srcdir}/$$file "$(DESTDIR)${archlibdir}/$$file"; \
257 .PHONY
: install uninstall mostlyclean clean distclean maintainer-clean
258 .PHONY
: extraclean
check tags
260 install: $(DESTDIR
)${archlibdir}
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} ; \
267 for file in
${INSTALLABLE_SCRIPTS} ; do \
268 $(INSTALL_SCRIPT
) ${srcdir}/$${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \
272 for file in
${INSTALLABLES}; do \
273 rm -f
"$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
275 for file in
${INSTALLABLE_SCRIPTS}; do \
276 rm -f
"$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \
278 if
[ -d
"$(DESTDIR)${archlibdir}" ]; then \
279 (cd
"$(DESTDIR)${archlibdir}" && rm -f
${UTILITIES} ${SCRIPTS}) \
283 -rm -f core
*.o
*.res
290 -rm -f Makefile blessmail
292 maintainer-clean
: distclean
295 extraclean
: maintainer-clean
298 ## Test the contents of the directory.
300 @echo
"We don't have any tests for the lib-src/ directory yet."
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
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} ${srcdir}/..
/src
/regex.c
320 etags
${EXEEXT}: ${srcdir}/etags.c regex.o
$(NTLIB
) $(config_h
)
321 $(CC
) ${ALL_CFLAGS} -DEMACS_NAME
="\"GNU Emacs\"" \
322 -DVERSION
="\"${version}\"" ${srcdir}/etags.c \
323 regex.o
$(LOADLIBES
) $(NTLIB
) -o etags
${EXEEXT}
325 ebrowse
${EXEEXT}: ${srcdir}/ebrowse.c
${srcdir}/..
/lib
/min-max.h
$(NTLIB
) \
327 $(CC
) ${ALL_CFLAGS} -DVERSION
="\"${version}\"" \
328 ${srcdir}/ebrowse.c
$(LOADLIBES
) $(NTLIB
) -o ebrowse
${EXEEXT}
330 ## We depend on etags to assure that parallel makes do not write two
331 ## etags.o files on top of each other.
332 ctags
${EXEEXT}: etags
${EXEEXT}
333 $(CC
) ${ALL_CFLAGS} -DCTAGS
-DEMACS_NAME
="\"GNU Emacs\"" \
334 -DVERSION
="\"${version}\"" ${srcdir}/etags.c \
335 regex.o
$(LOADLIBES
) $(NTLIB
) -o ctags
${EXEEXT}
337 profile
${EXEEXT}: ${srcdir}/profile.c
$(NTLIB
) $(config_h
)
338 $(CC
) ${ALL_CFLAGS} ${srcdir}/profile.c \
339 $(LOADLIBES
) $(NTLIB
) $(LIB_CLOCK_GETTIME
) -o profile
${EXEEXT}
341 make-docfile
${EXEEXT}: ${srcdir}/make-docfile.c
$(NTLIB
) $(config_h
)
342 $(CC
) ${ALL_CFLAGS} ${srcdir}/make-docfile.c
$(LOADLIBES
) $(NTLIB
) \
343 -o make-docfile
${EXEEXT}
345 movemail
${EXEEXT}: ${srcdir}/movemail.c pop.o
$(NTLIB
) $(config_h
)
346 $(CC
) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
347 $(LOADLIBES
) $(NTLIB
) $(LIBS_MOVE
) -o movemail
${EXEEXT}
349 pop.o
: ${srcdir}/pop.c
${srcdir}/pop.h
${srcdir}/..
/lib
/min-max.h
$(config_h
)
350 $(CC
) -c
${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
352 emacsclient
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(config_h
)
353 $(CC
) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
354 -DVERSION
="\"${version}\"" $(NTLIB
) $(LOADLIBES
) $(LIB_FDATASYNC
) \
355 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o emacsclient
${EXEEXT}
357 emacsclientw
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(CLIENTRES
) $(config_h
)
358 $(CC
) ${ALL_CFLAGS} $(CLIENTRES
) -mwindows
${srcdir}/emacsclient.c \
359 -DVERSION
="\"${version}\"" $(LOADLIBES
) $(LIB_FDATASYNC
) \
360 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o emacsclientw
${EXEEXT}
362 NTINC
= ${srcdir}/..
/nt
/inc
363 NTDEPS
= $(NTINC
)/ms-w32.h
$(NTINC
)/sys
/stat.h
$(NTINC
)/inttypes.h \
364 $(NTINC
)/stdint.h
$(NTINC
)/pwd.h
$(NTINC
)/sys
/time.h
$(NTINC
)/stdbool.h \
365 $(NTINC
)/sys
/wait.h
$(NTINC
)/unistd.h
$(NTINC
)/sys
/file.h
$(NTINC
)/netdb.h
367 # The dependency on $(NTDEPS) is a trick intended to cause recompile of
368 # programs on MinGW whenever some private header in nt/inc is modified.
369 ntlib.o
: ${srcdir}/ntlib.c
${srcdir}/ntlib.h
$(NTDEPS
)
370 $(CC
) -c
${CPP_CFLAGS} ${srcdir}/ntlib.c
372 hexl
${EXEEXT}: ${srcdir}/hexl.c
$(NTLIB
) $(config_h
)
373 $(CC
) ${ALL_CFLAGS} ${srcdir}/hexl.c
$(LOADLIBES
) -o hexl
${EXEEXT}
375 update-game-score
${EXEEXT}: ${srcdir}/update-game-score.c
$(NTLIB
) $(config_h
)
376 $(CC
) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR
="\"$(gamedir)\"" \
377 ${srcdir}/update-game-score.c
$(LOADLIBES
) $(NTLIB
) \
378 -o update-game-score
${EXEEXT}
380 emacsclient.res
: $(NTINC
)/..
/emacsclient.rc
381 $(WINDRES
) -O coff
--include-dir
=$(NTINC
)/..
-o emacsclient.res \
382 $(NTINC
)/..
/emacsclient.rc
384 ## Makefile ends here.