Makefile.in 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. # Makefile for lib-src subdirectory in GNU Emacs.
  2. # Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2012
  3. # Free Software Foundation, Inc.
  4. # This file is part of GNU Emacs.
  5. # GNU Emacs is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU Emacs is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  15. # Avoid trouble on systems where the `SHELL' variable might be
  16. # inherited from the environment.
  17. SHELL = /bin/sh
  18. # Following ../lisp/Makefile.in.
  19. EMACS = ../src/emacs
  20. EMACSOPT = -batch --no-site-file --no-site-lisp
  21. # ==================== Things `configure' will edit ====================
  22. CC=@CC@
  23. CFLAGS=@CFLAGS@
  24. version=@version@
  25. ## Used in $archlibdir.
  26. configuration=@configuration@
  27. EXEEXT=@EXEEXT@
  28. C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
  29. C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
  30. C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
  31. PROFILING_CFLAGS = @PROFILING_CFLAGS@
  32. # Program name transformation.
  33. TRANSFORM = @program_transform_name@
  34. # ==================== Where To Install Things ====================
  35. # The default location for installation. Everything is placed in
  36. # subdirectories of this directory. The default values for many of
  37. # the variables below are expressed in terms of this one, so you may
  38. # not need to change them. This is set with the --prefix option to
  39. # `../configure'.
  40. prefix=@prefix@
  41. # Like `prefix', but used for architecture-specific files. This is
  42. # set with the --exec-prefix option to `../configure'.
  43. exec_prefix=@exec_prefix@
  44. # Where to install Emacs and other binaries that people will want to
  45. # run directly (like etags). This is set with the --bindir option
  46. # to `../configure'.
  47. bindir=@bindir@
  48. # Where to install and expect executable files to be run by Emacs
  49. # rather than directly by users, and other architecture-dependent
  50. # data. ${archlibdir} is usually below this. This is set with the
  51. # --libexecdir option to `../configure'.
  52. libexecdir=@libexecdir@
  53. # Directory for local state files for all programs.
  54. localstatedir=@localstatedir@
  55. # Where to find the source code. This is set by the configure
  56. # script's `--srcdir' option. However, the value of ${srcdir} in
  57. # this makefile is not identical to what was specified with --srcdir,
  58. # since the variable here has `/lib-src' added at the end.
  59. # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
  60. srcdir=@srcdir@
  61. VPATH=@srcdir@
  62. # The top-level source directory, also set by configure.
  63. top_srcdir=@top_srcdir@
  64. # ==================== Emacs-specific directories ====================
  65. # These variables hold the values Emacs will actually use. They are
  66. # based on the values of the standard Make variables above.
  67. # Where to put executables to be run by Emacs rather than the user.
  68. # This path usually includes the Emacs version and configuration name,
  69. # so that multiple configurations for multiple versions of Emacs may
  70. # be installed at once. This can be set with the --archlibdir option
  71. # to `../configure'.
  72. archlibdir=@archlibdir@
  73. gamedir=@gamedir@
  74. gameuser=@gameuser@
  75. # ==================== Utility Programs for the Build =================
  76. # ../configure figures out the correct values for these.
  77. INSTALL = @INSTALL@
  78. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  79. INSTALL_DATA = @INSTALL_DATA@
  80. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  81. # By default, we uphold the dignity of our programs.
  82. INSTALL_STRIP =
  83. # ========================== Lists of Files ===========================
  84. # Things that a user might actually run, which should be installed in bindir.
  85. INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
  86. ebrowse${EXEEXT}
  87. INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
  88. STAMP_INST_SCRIPTS = stamp-rcs-checkin stamp-grep-changelog
  89. # Things that Emacs runs internally, or during the build process,
  90. # which should not be installed in bindir.
  91. UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \
  92. update-game-score${EXEEXT}
  93. DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
  94. # Like UTILITIES, but they're not system-dependent, and should not be
  95. # deleted by the distclean target.
  96. SCRIPTS= rcs2log vcdiff
  97. STAMP_SCRIPTS= stamp-rcs2log stamp-vcdiff
  98. # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
  99. EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
  100. # Specify additional -D flags for movemail. Options:
  101. # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
  102. # See the comments about locking in movemail.c. Normally the values
  103. # set by configure should be correct and you should not need to do anything.
  104. # If neither flag is set, you need to use blessmail.
  105. MOVE_FLAGS=
  106. ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
  107. BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
  108. ## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4
  109. KRB4LIB=@KRB4LIB@
  110. ## -ldes if HAVE_LIBDES or -ldes425 if HAVE_LIBDES425
  111. DESLIB=@DESLIB@
  112. ## -lkrb5 if HAVE_LIBKRB5
  113. KRB5LIB=@KRB5LIB@
  114. ## -lk5crypto if HAVE_LIBK5CRYPTO or -lcrypto if HAVE_LIBCRYPTO
  115. CRYPTOLIB=@CRYPTOLIB@
  116. ## -lcom_err if HAVE_LIBCOM_ERR
  117. COM_ERRLIB=@COM_ERRLIB@
  118. ## -lhesiod if HAVE_LIBHESIOD
  119. LIBHESIOD=@LIBHESIOD@
  120. ## -lresolv if HAVE_LIBRESOLV
  121. LIBRESOLV=@LIBRESOLV@
  122. ## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
  123. LIBS_MAIL=@LIBS_MAIL@
  124. ## Extra libraries to use when linking movemail.
  125. LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
  126. $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
  127. ## Some systems define this to request special libraries.
  128. LIBS_SYSTEM = @LIBS_SYSTEM@
  129. # Those files shared with other GNU utilities need HAVE_CONFIG_H
  130. # defined before they know they can take advantage of the information
  131. # in ../src/config.h.
  132. BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) ${C_WARNINGS_SWITCH} \
  133. -DHAVE_CONFIG_H -I. -I../src -I../lib \
  134. -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
  135. ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
  136. LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
  137. CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
  138. all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
  139. LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
  140. $(EXE_FILES): ../lib/libgnu.a
  141. ## These targets copy the scripts into the build directory so that
  142. ## they can be run from there in an uninstalled Emacs.
  143. ## Nothing to do if pwd = srcdir.
  144. insrcdir=[ "`/bin/pwd`" = "`(cd $(srcdir) && /bin/pwd)`" ]
  145. stamp-rcs2log: $(srcdir)/rcs2log
  146. $(insrcdir) || cp -p $(srcdir)/rcs2log rcs2log
  147. touch $@
  148. stamp-rcs-checkin: $(srcdir)/rcs-checkin
  149. $(insrcdir) || cp -p $(srcdir)/rcs-checkin rcs-checkin
  150. touch $@
  151. stamp-grep-changelog: $(srcdir)/grep-changelog
  152. $(insrcdir) || cp -p $(srcdir)/grep-changelog grep-changelog
  153. touch $@
  154. stamp-vcdiff: $(srcdir)/vcdiff
  155. $(insrcdir) || cp -p $(srcdir)/vcdiff vcdiff
  156. touch $@
  157. ## Only used if we need blessmail, but no harm in always defining.
  158. ## This makes the actual blessmail executable.
  159. blessmail:
  160. $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
  161. chmod +x blessmail
  162. ## This checks if we need to run blessmail.
  163. ## Do not charge ahead and do it! Let the installer decide.
  164. need-blessmail: blessmail
  165. @if [ `wc -l <blessmail` != 2 ] ; then \
  166. dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
  167. echo Assuming $$dir is really the mail spool directory, you should; \
  168. echo run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}; \
  169. echo as root, to give movemail${EXEEXT} appropriate permissions.; \
  170. echo Do that after running make install.; \
  171. fi
  172. ## This is the target invoked by the top-level Makefile.
  173. maybe-blessmail: $(BLESSMAIL_TARGET)
  174. ## Install the internal utilities. Until they are installed, we can
  175. ## just run them directly from lib-src.
  176. ## If the chown/chmod commands fail, that is not a big deal.
  177. ## update-game-score will detect at runtime that it is not setuid,
  178. ## and handle things accordingly.
  179. $(DESTDIR)${archlibdir}: all
  180. @echo
  181. @echo "Installing utilities run internally by Emacs."
  182. umask 022; $(top_srcdir)/build-aux/install-sh -d $(DESTDIR)${archlibdir}
  183. if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
  184. for file in ${UTILITIES}; do \
  185. $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
  186. done ; \
  187. fi
  188. umask 022; $(top_srcdir)/build-aux/install-sh -d $(DESTDIR)${gamedir}; \
  189. touch $(DESTDIR)${gamedir}/snake-scores; \
  190. touch $(DESTDIR)${gamedir}/tetris-scores
  191. -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
  192. chown ${gameuser} $(DESTDIR)${gamedir}; \
  193. chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
  194. fi
  195. if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
  196. != `(cd ${srcdir} && /bin/pwd)` ]; then \
  197. for file in ${SCRIPTS}; do \
  198. $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
  199. done ; \
  200. fi
  201. install: $(DESTDIR)${archlibdir}
  202. @echo
  203. @echo "Installing utilities for users to run."
  204. for file in ${INSTALLABLES} ; do \
  205. $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
  206. chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
  207. done
  208. for file in ${INSTALLABLE_SCRIPTS} ; do \
  209. $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
  210. chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
  211. done
  212. uninstall:
  213. (cd $(DESTDIR)${bindir}; \
  214. for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
  215. rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
  216. done)
  217. if [ -d $(DESTDIR)${archlibdir} ]; then \
  218. (cd $(DESTDIR)${archlibdir} && \
  219. rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \
  220. fi
  221. mostlyclean:
  222. -rm -f core *.o
  223. clean: mostlyclean
  224. -rm -f ${EXE_FILES}
  225. -rm -f ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
  226. distclean: clean
  227. -rm -f TAGS
  228. -rm -f Makefile blessmail
  229. maintainer-clean: distclean
  230. true
  231. extraclean: maintainer-clean
  232. -rm -f *~ \#*
  233. ## Test the contents of the directory.
  234. check:
  235. @echo "We don't have any tests for the lib-src/ directory yet."
  236. tags: TAGS
  237. TAGS: etags${EXEEXT}
  238. etags *.[ch]
  239. ## This verifies that the non-ASCII characters in the file \`testfile\'
  240. ## have not been clobbered by whatever means were used to copy and
  241. ## distribute Emacs. If they were clobbered, all the .elc files were
  242. ## clobbered too.
  243. test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
  244. $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
  245. ./test-distrib ${srcdir}/testfile
  246. ../lib/libgnu.a: ../src/config.h
  247. cd ../lib && $(MAKE) libgnu.a
  248. regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
  249. ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
  250. ${srcdir}/../src/regex.c
  251. etags${EXEEXT}: ${srcdir}/etags.c regex.o ../src/config.h
  252. $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
  253. -DVERSION="\"${version}\"" ${srcdir}/etags.c \
  254. regex.o $(LOADLIBES) -o etags
  255. ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h ../src/config.h
  256. $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
  257. ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
  258. ## We depend on etags to assure that parallel makes do not write two
  259. ## etags.o files on top of each other.
  260. ctags${EXEEXT}: etags${EXEEXT}
  261. $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
  262. -DVERSION="\"${version}\"" ${srcdir}/etags.c \
  263. regex.o $(LOADLIBES) -o ctags
  264. profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
  265. $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
  266. make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
  267. $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
  268. -o make-docfile
  269. movemail${EXEEXT}: ${srcdir}/movemail.c pop.o ../src/config.h
  270. $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
  271. $(LOADLIBES) $(LIBS_MOVE) -o movemail
  272. pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h ../src/config.h
  273. $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
  274. emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h
  275. $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
  276. -DVERSION="\"${version}\"" \
  277. $(LOADLIBES) -o emacsclient
  278. hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
  279. $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
  280. update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h
  281. $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
  282. ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
  283. ## Makefile ends here.