3 # Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2016 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.
24 EMACS
= ..
/src
/emacs
${EXEEXT}
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 AM_V_GEN
= $(am__v_GEN_@AM_V@
)
62 am__v_GEN_
= $(am__v_GEN_@AM_DEFAULT_V@
)
63 am__v_GEN_0
= @echo
" GEN " $@
;
66 AM_V_RC
= $(am__v_RC_@AM_V@
)
67 am__v_RC_
= $(am__v_RC_@AM_DEFAULT_V@
)
68 am__v_RC_0
= @echo
" RC " $@
;
71 AM_V_at
= $(am__v_at_@AM_V@
)
72 am__v_at_
= $(am__v_at_@AM_DEFAULT_V@
)
76 # ==================== Where To Install Things ====================
78 # Location to install Emacs.app under GNUstep / Mac OS X.
79 # Later values may use this.
80 ns_appbindir
=@ns_appbindir@
82 # The default location for installation. Everything is placed in
83 # subdirectories of this directory. The default values for many of
84 # the variables below are expressed in terms of this one, so you may
85 # not need to change them. This is set with the --prefix option to
89 # Like 'prefix', but used for architecture-specific files. This is
90 # set with the --exec-prefix option to '../configure'.
91 exec_prefix=@
exec_prefix@
93 # Where to install Emacs and other binaries that people will want to
94 # run directly (like etags). This is set with the --bindir option
98 # Where to install and expect executable files to be run by Emacs
99 # rather than directly by users, and other architecture-dependent
100 # data. ${archlibdir} is usually below this. This is set with the
101 # --libexecdir option to '../configure'.
102 libexecdir
=@libexecdir@
104 # Directory for local state files for all programs.
105 localstatedir
=@localstatedir@
107 # Where to find the source code. This is set by the configure
108 # script's '--srcdir' option. However, the value of ${srcdir} in
109 # this makefile is not identical to what was specified with --srcdir,
110 # since the variable here has '/lib-src' added at the end.
112 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
116 # The top-level source directory, also set by configure.
117 top_srcdir
=@top_srcdir@
118 # MinGW CPPFLAGS may use this.
119 abs_top_srcdir
=@abs_top_srcdir@
121 # ==================== Emacs-specific directories ====================
123 # These variables hold the values Emacs will actually use. They are
124 # based on the values of the standard Make variables above.
126 # Where to put executables to be run by Emacs rather than the user.
127 # This path usually includes the Emacs version and configuration name,
128 # so that multiple configurations for multiple versions of Emacs may
129 # be installed at once. This can be set with the --archlibdir option
131 archlibdir
=@archlibdir@
135 gamegroup
=@gamegroup@
137 # ==================== Utility Programs for the Build =================
139 # ../configure figures out the correct values for these.
141 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
142 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
143 # By default, we uphold the dignity of our programs.
147 # ========================== Lists of Files ===========================
149 # emacsclientw.exe for MinGW, empty otherwise
152 # Things that a user might actually run, which should be installed in bindir.
153 INSTALLABLES
= etags
${EXEEXT} ctags
${EXEEXT} emacsclient
${EXEEXT} $(CLIENTW
) \
156 # Things that Emacs runs internally, or during the build process,
157 # which should not be installed in bindir.
158 UTILITIES
= profile
${EXEEXT} movemail
${EXEEXT} hexl
${EXEEXT} \
159 update-game-score
${EXEEXT}
161 DONT_INSTALL
= make-docfile
${EXEEXT}
163 # Like UTILITIES, but they're not system-dependent, and should not be
164 # deleted by the distclean target.
165 SCRIPTS
= rcs2log
$(UPDATE_MANIFEST
)
167 # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
168 EXE_FILES
= ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
170 # Specify additional -D flags for movemail. Options:
171 # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
172 # See the comments about locking in movemail.c. Normally the values
173 # set by configure should be correct and you should not need to do anything.
174 # If neither flag is set, you need to use blessmail.
177 ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
178 BLESSMAIL_TARGET
=@BLESSMAIL_TARGET@
180 ## -lkrb or -lkrb4 if needed
182 ## -ldes or -ldes425 if needed
186 ## -lk5crypto or -lcrypto if needed
187 CRYPTOLIB
=@CRYPTOLIB@
188 ## -lcom_err if needed
189 COM_ERRLIB
=@COM_ERRLIB@
190 ## -lhesiod if needed
191 LIBHESIOD
=@LIBHESIOD@
192 ## -lresolv if HAVE_LIBRESOLV
193 LIBRESOLV
=@LIBRESOLV@
194 ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
195 LIBS_MAIL
=@LIBS_MAIL@
196 ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
197 LIB_CLOCK_GETTIME
= @LIB_CLOCK_GETTIME@
198 ## empty or -lrt or -lposix4 if HAVE_FDATASYNC
199 LIB_FDATASYNC
= @LIB_FDATASYNC@
200 ## empty or -lwsock2 for MinGW
201 LIB_WSOCK32
=@LIB_WSOCK32@
203 ## Extra libraries to use when linking movemail.
204 LIBS_MOVE
= $(LIBS_MAIL
) $(KRB4LIB
) $(DESLIB
) $(KRB5LIB
) $(CRYPTOLIB
) \
205 $(COM_ERRLIB
) $(LIBHESIOD
) $(LIBRESOLV
) $(LIB_WSOCK32
)
207 ## Extra libraries when linking emacsclient
208 ## (empty or -lcomctl32 for MinGW)
209 LIBS_ECLIENT
= @LIBS_ECLIENT@
211 ## Extra object files for linking for MinGW
213 CLIENTRES
= @CLIENTRES@
216 ## Some systems define this to request special libraries.
217 LIBS_SYSTEM
= @LIBS_SYSTEM@
219 BASE_CFLAGS
= $(C_SWITCH_SYSTEM
) $(C_SWITCH_MACHINE
) \
220 $(WARN_CFLAGS
) $(WERROR_CFLAGS
) \
221 -I.
-I..
/src
-I..
/lib \
222 -I
${srcdir} -I
${srcdir}/..
/src
-I
${srcdir}/..
/lib
224 ALL_CFLAGS
= ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
226 LINK_CFLAGS
= ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
227 CPP_CFLAGS
= ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
229 # Configuration files for .o files to depend on.
230 config_h
= ..
/src
/config.h
$(srcdir)/..
/src
/conf_post.h
232 all: ${EXE_FILES} ${SCRIPTS}
234 .PHONY
: all need-blessmail maybe-blessmail
236 LOADLIBES
= ..
/lib
/libgnu.a
$(LIBS_SYSTEM
)
237 $(EXE_FILES
): ..
/lib
/libgnu.a
239 ## Only used if we need blessmail, but no harm in always defining.
240 ## This makes the actual blessmail executable.
241 blessmail
: $(srcdir)/..
/lisp
/mail
/blessmail.el
242 $(AM_V_GEN
)$(EMACS
) $(EMACSOPT
) -l
$<
243 $(AM_V_at
)chmod
+x
$@
245 ## This checks if we need to run blessmail.
246 ## Do not charge ahead and do it! Let the installer decide.
247 need-blessmail
: blessmail
248 @if
[ `wc -l <blessmail` != 2 ] ; then \
249 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
250 echo
"Assuming $$dir is really the mail spool directory, you should"; \
251 echo
"run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}"; \
252 echo
"as root, to give movemail${EXEEXT} appropriate permissions."; \
253 echo
"Do that after running make install."; \
256 ## This is the target invoked by the top-level Makefile.
257 maybe-blessmail
: $(BLESSMAIL_TARGET
)
259 ## Install the internal utilities. Until they are installed, we can
260 ## just run them directly from lib-src.
261 ## If the chown/chmod commands fail, that is not a big deal.
262 ## update-game-score will detect at runtime that it is not setuid,
263 ## and handle things accordingly.
264 $(DESTDIR
)${archlibdir}: all
266 @echo
"Installing utilities run internally by Emacs."
267 umask
022 && ${MKDIR_P} "$(DESTDIR)${archlibdir}"
268 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd` && \
269 if
[ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
270 for file in
${UTILITIES}; do \
271 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file \
272 "$(DESTDIR)${archlibdir}/$$file" || exit
; \
275 umask
022 && ${MKDIR_P} "$(DESTDIR)${gamedir}" && \
276 touch
"$(DESTDIR)${gamedir}/snake-scores" \
277 "$(DESTDIR)${gamedir}/tetris-scores"
279 if chown
${gameuser} \
280 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && \
282 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; \
284 chown
${gameuser} "$(DESTDIR)${gamedir}" && \
285 chmod u
=rwx
,g
=rx
,o
=rx
"$(DESTDIR)${gamedir}"; \
287 else ifneq ($(gamegroup
),)
288 if chgrp
${gamegroup} \
289 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && \
291 "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; \
293 chgrp
${gamegroup} "$(DESTDIR)${gamedir}" && \
294 chmod u
=rwx
,g
=rwx
,o
=rx
"$(DESTDIR)${gamedir}"; \
297 exp_archlibdir
=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd` && \
298 if
[ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
299 for file in
${SCRIPTS}; do \
300 $(INSTALL_SCRIPT
) ${srcdir}/$$file \
301 "$(DESTDIR)${archlibdir}/$$file" || exit
; \
305 .PHONY
: install uninstall mostlyclean clean distclean maintainer-clean
306 .PHONY
: bootstrap-clean extraclean
check tags
308 install: $(DESTDIR
)${archlibdir}
310 @echo
"Installing utilities for users to run."
311 umask
022 && ${MKDIR_P} "$(DESTDIR)${bindir}"
312 for file in
${INSTALLABLES} ; do \
313 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $${file} \
314 "$(DESTDIR)${bindir}"/` \
315 echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)' \
316 `${EXEEXT} || exit
; \
320 for file in
${INSTALLABLES}; do \
321 rm -f
"$(DESTDIR)${bindir}"/` \
322 echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)' \
325 if
[ -d
"$(DESTDIR)${archlibdir}" ]; then \
326 cd
"$(DESTDIR)${archlibdir}" && \
327 rm -f
${UTILITIES} ${SCRIPTS}; \
337 rm -f TAGS Makefile blessmail
339 bootstrap-clean maintainer-clean
: distclean
341 extraclean
: maintainer-clean
344 ## Test the contents of the directory.
346 @echo
"We don't have any tests for the lib-src/ directory yet."
348 tagsfiles
= $(wildcard ${srcdir}/*.
[ch
])
352 TAGS
: etags
${EXEEXT} ${tagsfiles}
355 ..
/lib
/libgnu.a
: $(config_h
)
356 $(MAKE
) -C ..
/lib
all
358 regex.o
: $(srcdir)/..
/src
/regex.c
$(srcdir)/..
/src
/regex.h
$(config_h
)
359 $(AM_V_CC
)$(CC
) -c
$(CPP_CFLAGS
) $<
362 etags_deps
= ${srcdir}/etags.c regex.o
$(NTLIB
) $(config_h
)
363 etags_cflags
= -DEMACS_NAME
="\"GNU Emacs\"" -DVERSION
="\"${version}\"" -o
$@
364 etags_libs
= regex.o
$(NTLIB
) $(LOADLIBES
)
366 etags
${EXEEXT}: ${etags_deps}
367 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $(etags_cflags
) $< $(etags_libs
)
369 ## ctags.c is distinct from etags.c so that parallel makes do not write two
370 ## etags.o files on top of each other.
372 ## Can't we use a wrapper that calls 'etags --ctags'?
373 ctags
${EXEEXT}: ${srcdir}/ctags.c
${etags_deps}
374 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $(etags_cflags
) $< $(etags_libs
)
376 ebrowse
${EXEEXT}: ${srcdir}/ebrowse.c
${srcdir}/..
/lib
/min-max.h
$(NTLIB
) \
378 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} -DVERSION
="\"${version}\"" \
379 $< $(NTLIB
) $(LOADLIBES
) -o
$@
381 profile
${EXEEXT}: ${srcdir}/profile.c
$(NTLIB
) $(config_h
)
382 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< \
383 $(NTLIB
) $(LOADLIBES
) $(LIB_CLOCK_GETTIME
) -o
$@
385 make-docfile
${EXEEXT}: ${srcdir}/make-docfile.c
$(NTLIB
) $(config_h
)
386 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< $(NTLIB
) $(LOADLIBES
) -o
$@
388 movemail
${EXEEXT}: ${srcdir}/movemail.c pop.o
$(NTLIB
) $(config_h
)
389 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
390 $(NTLIB
) $(LOADLIBES
) $(LIBS_MOVE
) -o
$@
392 pop.o
: ${srcdir}/pop.c
${srcdir}/pop.h
${srcdir}/..
/lib
/min-max.h
$(config_h
)
393 $(AM_V_CC
)$(CC
) -c
${CPP_CFLAGS} ${MOVE_FLAGS} $<
395 emacsclient
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(config_h
)
396 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< \
397 -DVERSION
="\"${version}\"" $(NTLIB
) $(LOADLIBES
) $(LIB_FDATASYNC
) \
398 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o
$@
400 emacsclientw
${EXEEXT}: ${srcdir}/emacsclient.c
$(NTLIB
) $(CLIENTRES
) $(config_h
)
401 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $(CLIENTRES
) -mwindows
$< \
402 -DVERSION
="\"${version}\"" $(LOADLIBES
) $(LIB_FDATASYNC
) \
403 $(LIB_WSOCK32
) $(LIBS_ECLIENT
) -o
$@
405 NTINC
= ${srcdir}/..
/nt
/inc
406 NTDEPS
= $(NTINC
)/ms-w32.h
$(NTINC
)/sys
/stat.h
$(NTINC
)/inttypes.h \
407 $(NTINC
)/stdint.h
$(NTINC
)/pwd.h
$(NTINC
)/sys
/time.h
$(NTINC
)/stdbool.h \
408 $(NTINC
)/sys
/wait.h
$(NTINC
)/unistd.h
$(NTINC
)/sys
/file.h
$(NTINC
)/netdb.h
410 # The dependency on $(NTDEPS) is a trick intended to cause recompile of
411 # programs on MinGW whenever some private header in nt/inc is modified.
412 ntlib.o
: ${srcdir}/ntlib.c
${srcdir}/ntlib.h
$(NTDEPS
)
413 $(AM_V_CC
)$(CC
) -c
${CPP_CFLAGS} $<
415 hexl
${EXEEXT}: ${srcdir}/hexl.c
$(NTLIB
) $(config_h
)
416 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} $< $(LOADLIBES
) -o
$@
418 update-game-score
${EXEEXT}: ${srcdir}/update-game-score.c
$(NTLIB
) $(config_h
)
419 $(AM_V_CCLD
)$(CC
) ${ALL_CFLAGS} \
420 -DHAVE_SHARED_GAME_DIR
="\"$(gamedir)\"" \
421 $< $(NTLIB
) $(LOADLIBES
) -o
$@
423 emacsclient.res
: ..
/nt
/emacsclient.rc
$(NTINC
)/..
/icons
/emacs.ico
424 $(AM_V_RC
)$(WINDRES
) -O coff
--include-dir
=$(NTINC
)/..
-o
$@
$<
426 ## Makefile ends here.