3 # Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2014
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/>.
23 # Following ../lisp/Makefile.in.
25 EMACSOPT
= -batch
--no-site-file
--no-site-lisp
27 # ==================== Things `configure' will edit ====================
35 ## Used in $archlibdir.
36 configuration
=@configuration@
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@
49 AM_DEFAULT_VERBOSITY
= @AM_DEFAULT_VERBOSITY@
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 " $@
;
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 " $@
;
61 # ==================== Where To Install Things ====================
63 # Location to install Emacs.app under GNUstep / Mac OS X.
64 # Later values may use this.
65 ns_appbindir
=@ns_appbindir@
67 # The default location for installation. Everything is placed in
68 # subdirectories of this directory. The default values for many of
69 # the variables below are expressed in terms of this one, so you may
70 # not need to change them. This is set with the --prefix option to
74 # Like `prefix', but used for architecture-specific files. This is
75 # set with the --exec-prefix option to `../configure'.
76 exec_prefix=@
exec_prefix@
78 # Where to install Emacs and other binaries that people will want to
79 # run directly (like etags). This is set with the --bindir option
83 # Where to install and expect executable files to be run by Emacs
84 # rather than directly by users, and other architecture-dependent
85 # data. ${archlibdir} is usually below this. This is set with the
86 # --libexecdir option to `../configure'.
87 libexecdir
=@libexecdir@
89 # Directory for local state files for all programs.
90 localstatedir
=@localstatedir@
92 # Where to find the source code. This is set by the configure
93 # script's `--srcdir' option. However, the value of ${srcdir} in
94 # this makefile is not identical to what was specified with --srcdir,
95 # since the variable here has `/lib-src' added at the end.
97 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
101 # The top-level source directory, also set by configure.
102 top_srcdir
=@top_srcdir@
103 # MinGW CPPFLAGS may use this.
104 abs_top_srcdir
=@abs_top_srcdir@
106 # ==================== Emacs-specific directories ====================
108 # These variables hold the values Emacs will actually use. They are
109 # based on the values of the standard Make variables above.
111 # Where to put executables to be run by Emacs rather than the user.
112 # This path usually includes the Emacs version and configuration name,
113 # so that multiple configurations for multiple versions of Emacs may
114 # be installed at once. This can be set with the --archlibdir option
116 archlibdir
=@archlibdir@
121 # ==================== Utility Programs for the Build =================
123 # ../configure figures out the correct values for these.
125 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
126 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
127 # By default, we uphold the dignity of our programs.
131 # ========================== Lists of Files ===========================
133 # emacsclientw.exe for MinGW, empty otherwise
136 # Things that a user might actually run, which should be installed in bindir.
137 INSTALLABLES
= etags
${EXEEXT} ctags
${EXEEXT} emacsclient
${EXEEXT} $(CLIENTW
) \
140 INSTALLABLE_SCRIPTS
= grep-changelog
142 # Things that Emacs runs internally, or during the build process,
143 # which should not be installed in bindir.
144 UTILITIES
= profile
${EXEEXT} movemail
${EXEEXT} hexl
${EXEEXT} \
145 update-game-score
${EXEEXT}
147 DONT_INSTALL
= make-docfile
${EXEEXT}
149 # Like UTILITIES, but they're not system-dependent, and should not be
150 # deleted by the distclean target.
151 SCRIPTS
= rcs2log
$(UPDATE_MANIFEST
)
153 # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
154 EXE_FILES
= ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
156 # Specify additional -D flags for movemail. Options:
157 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
158 # See the comments about locking in movemail.c. Normally the values
159 # set by configure should be correct and you should not need to do anything.
160 # If neither flag is set, you need to use blessmail.
163 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
164 BLESSMAIL_TARGET
=@BLESSMAIL_TARGET@
166 ## -lkrb or -lkrb4 if needed
168 ## -ldes or -ldes425 if needed
172 ## -lk5crypto or -lcrypto if needed
173 CRYPTOLIB
=@CRYPTOLIB@
174 ## -lcom_err if needed
175 COM_ERRLIB
=@COM_ERRLIB@
176 ## -lhesiod if needed
177 LIBHESIOD
=@LIBHESIOD@
178 ## -lresolv if HAVE_LIBRESOLV
179 LIBRESOLV
=@LIBRESOLV@
180 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
181 LIBS_MAIL
=@LIBS_MAIL@
182 ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
183 LIB_CLOCK_GETTIME
= @LIB_CLOCK_GETTIME@
184 ## empty or -lrt or -lposix4 if HAVE_FDATASYNC
185 LIB_FDATASYNC
= @LIB_FDATASYNC@
186 ## empty or -lwsock2 for MinGW
187 LIB_WSOCK32
=@LIB_WSOCK32@
189 ## Extra libraries to use when linking movemail.
190 LIBS_MOVE
= $(LIBS_MAIL
) $(KRB4LIB
) $(DESLIB
) $(KRB5LIB
) $(CRYPTOLIB
) \
191 $(COM_ERRLIB
) $(LIBHESIOD
) $(LIBRESOLV
) $(LIB_WSOCK32
)
193 ## Extra libraries when linking emacsclient
194 ## (empty or -lcomctl32 for MinGW)
195 LIBS_ECLIENT
= @LIBS_ECLIENT@
197 ## Extra object files for linking for MinGW
199 CLIENTRES
= @CLIENTRES@
202 ## Some systems define this to request special libraries.
203 LIBS_SYSTEM
= @LIBS_SYSTEM@
205 BASE_CFLAGS
= $(C_SWITCH_SYSTEM
) $(C_SWITCH_MACHINE
) \
206 $(WARN_CFLAGS
) $(WERROR_CFLAGS
) \
207 -I.
-I..
/src
-I..
/lib \
208 -I
${srcdir} -I
${srcdir}/..
/src
-I
${srcdir}/..
/lib
210 ALL_CFLAGS
= ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
212 LINK_CFLAGS
= ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
213 CPP_CFLAGS
= ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
215 # Configuration files for .o files to depend on.
216 config_h
= ..
/src
/config.h
$(srcdir)/..
/src
/conf_post.h
218 all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
220 .PHONY
: all need-blessmail maybe-blessmail
222 LOADLIBES
= ..
/lib
/libgnu.a
$(LIBS_SYSTEM
)
223 $(EXE_FILES
): ..
/lib
/libgnu.a
225 ## Only used if we need blessmail, but no harm in always defining.
226 ## This makes the actual blessmail executable.
227 blessmail
: $(srcdir)/..
/lisp
/mail
/blessmail.el
228 $(EMACS
) $(EMACSOPT
) -l
$<
231 ## This checks if we need to run blessmail.
232 ## Do not charge ahead and do it! Let the installer decide.
233 need-blessmail
: blessmail
234 @if
[ `wc -l <blessmail` != 2 ] ; then \
235 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
236 echo
"Assuming $$dir is really the mail spool directory, you should"; \
237 echo
"run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}"; \
238 echo
"as root, to give movemail${EXEEXT} appropriate permissions."; \
239 echo
"Do that after running make install."; \
242 ## This is the target invoked by the top-level Makefile.
243 maybe-blessmail
: $(BLESSMAIL_TARGET
)
245 ## Install the internal utilities. Until they are installed, we can
246 ## just run them directly from lib-src.
247 ## If the chown/chmod commands fail, that is not a big deal.
248 ## update-game-score will detect at runtime that it is not setuid,
249 ## and handle things accordingly.
250 $(DESTDIR
)${archlibdir}: all
252 @echo
"Installing utilities run internally by Emacs."
253 umask
022; ${MKDIR_P} "$(DESTDIR)${archlibdir}"
254 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
255 if
[ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
256 for file in
${UTILITIES}; do \
257 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file "$(DESTDIR)${archlibdir}/$$file" ; \
260 umask
022; ${MKDIR_P} "$(DESTDIR)${gamedir}"; \
261 touch
"$(DESTDIR)${gamedir}/snake-scores"; \
262 touch
"$(DESTDIR)${gamedir}/tetris-scores"
263 -if chown
${gameuser} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && chmod u
+s
"$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; then \
264 chown
${gameuser} "$(DESTDIR)${gamedir}"; \
265 chmod u
=rwx
,g
=rwx
,o
=rx
"$(DESTDIR)${gamedir}"; \
267 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
268 if
[ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
269 for file in
${SCRIPTS}; do \
270 $(INSTALL_SCRIPT
) ${srcdir}/$$file "$(DESTDIR)${archlibdir}/$$file"; \
274 .PHONY
: install uninstall mostlyclean clean distclean maintainer-clean
275 .PHONY
: bootstrap-clean extraclean
check tags
277 install: $(DESTDIR
)${archlibdir}
279 @echo
"Installing utilities for users to run."
280 umask
022; ${MKDIR_P} "$(DESTDIR)${bindir}"
281 for file in
${INSTALLABLES} ; do \
282 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
284 for file in
${INSTALLABLE_SCRIPTS} ; do \
285 $(INSTALL_SCRIPT
) ${srcdir}/$${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \
289 for file in
${INSTALLABLES}; do \
290 rm -f
"$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
292 for file in
${INSTALLABLE_SCRIPTS}; do \
293 rm -f
"$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \
295 if
[ -d
"$(DESTDIR)${archlibdir}" ]; then \
296 (cd
"$(DESTDIR)${archlibdir}" && rm -f
${UTILITIES} ${SCRIPTS}) \
300 -rm -f core
*.o
*.res
307 -rm -f Makefile blessmail
309 bootstrap-clean maintainer-clean
: distclean
312 extraclean
: maintainer-clean
315 ## Test the contents of the directory.
317 @echo
"We don't have any tests for the lib-src/ directory yet."
323 ..
/lib
/libgnu.a
: $(config_h
)
324 $(MAKE
) -C ..
/lib libgnu.a
326 regex.o
: $(srcdir)/..
/src
/regex.c
$(srcdir)/..
/src
/regex.h
$(config_h
)
327 $(AM_V_CC
)$(CC
) -c
$(CPP_CFLAGS
) $<
330 etags_deps
= ${srcdir}/etags.c regex.o
$(NTLIB
) $(config_h
)
331 etags_cflags
= -DEMACS_NAME
="\"GNU Emacs\"" -DVERSION
="\"${version}\"" -o
$@
332 etags_libs
= regex.o
$(LOADLIBES
) $(NTLIB
)
334 etags
${EXEEXT}: ${etags_deps}
335 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $(etags_cflags
) $< $(etags_libs
)
337 ## ctags.c is distinct from etags.c so that parallel makes do not write two
338 ## etags.o files on top of each other.
340 ## Can't we use a wrapper that calls 'etags --ctags'?
341 ctags
${EXEEXT}: ${srcdir}/ctags.c
${etags_deps}
342 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $(etags_cflags
) $< $(etags_libs
)
344 ebrowse
${EXEEXT}: ${srcdir}/ebrowse.c
${srcdir}/..
/lib
/min-max.h
$(NTLIB
) \
346 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} -DVERSION
="\"${version}\"" \
347 $< $(LOADLIBES
) $(NTLIB
) -o
$@
349 profile
${EXEEXT}: ${srcdir}/profile.c
$(NTLIB
) $(config_h
)
350 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< \
351 $(LOADLIBES
) $(NTLIB
) $(LIB_CLOCK_GETTIME
) -o
$@
353 make-docfile
${EXEEXT}: ${srcdir}/make-docfile.c
$(NTLIB
) $(config_h
)
354 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< $(LOADLIBES
) $(NTLIB
) -o
$@
356 movemail
${EXEEXT}: ${srcdir}/movemail.c pop.o
$(NTLIB
) $(config_h
)
357 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
358 $(LOADLIBES
) $(NTLIB
) $(LIBS_MOVE
) -o
$@
360 pop.o
: ${srcdir}/pop.c
${srcdir}/pop.h
${srcdir}/..
/lib
/min-max.h
$(config_h
)
361 $(AM_V_CC
)$(CC
) -c
${CPP_CFLAGS} ${MOVE_FLAGS} $<
363 emacsclient
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(config_h
)
364 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< \
365 -DVERSION
="\"${version}\"" $(NTLIB
) $(LOADLIBES
) $(LIB_FDATASYNC
) \
366 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o
$@
368 emacsclientw
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(CLIENTRES
) $(config_h
)
369 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $(CLIENTRES
) -mwindows
$< \
370 -DVERSION
="\"${version}\"" $(LOADLIBES
) $(LIB_FDATASYNC
) \
371 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o
$@
373 NTINC
= ${srcdir}/..
/nt
/inc
374 NTDEPS
= $(NTINC
)/ms-w32.h
$(NTINC
)/sys
/stat.h
$(NTINC
)/inttypes.h \
375 $(NTINC
)/stdint.h
$(NTINC
)/pwd.h
$(NTINC
)/sys
/time.h
$(NTINC
)/stdbool.h \
376 $(NTINC
)/sys
/wait.h
$(NTINC
)/unistd.h
$(NTINC
)/sys
/file.h
$(NTINC
)/netdb.h
378 # The dependency on $(NTDEPS) is a trick intended to cause recompile of
379 # programs on MinGW whenever some private header in nt/inc is modified.
380 ntlib.o
: ${srcdir}/ntlib.c
${srcdir}/ntlib.h
$(NTDEPS
)
381 $(AM_V_CC
)$(CC
) -c
${CPP_CFLAGS} $<
383 hexl
${EXEEXT}: ${srcdir}/hexl.c
$(NTLIB
) $(config_h
)
384 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< $(LOADLIBES
) -o
$@
386 update-game-score
${EXEEXT}: ${srcdir}/update-game-score.c
$(NTLIB
) $(config_h
)
387 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} \
388 -DHAVE_SHARED_GAME_DIR
="\"$(gamedir)\"" \
389 $< $(LOADLIBES
) $(NTLIB
) -o
$@
391 emacsclient.res
: ..
/nt
/emacsclient.rc
${srcdir}/icons
/emacs.ico
392 $(WINDRES
) -O coff
--include-dir
=$(NTINC
)/..
-o
$@
$<
394 ## Makefile ends here.