mainmake.v2 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. # Top-level Makefile for Emacs under MS-DOS/DJGPP v2.0 or higher. -*-makefile-*-
  2. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  3. # This file is part of GNU Emacs.
  4. # GNU Emacs is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. # GNU Emacs is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  14. # make all to compile and build Emacs.
  15. # make install to install it (installs in-place, in `bin' subdir of top dir).
  16. # make TAGS to update tags tables.
  17. #
  18. # make clean or make mostlyclean
  19. # Delete all files from the current directory that are normally
  20. # created by building the program. Don't delete the files that
  21. # record the configuration. Also preserve files that could be made
  22. # by building, but normally aren't because the distribution comes
  23. # with them.
  24. #
  25. # Delete `.dvi' files here if they are not part of the distribution.
  26. #
  27. # make distclean
  28. # Delete all files from the current directory that are created by
  29. # configuring or building the program. If you have unpacked the
  30. # source and built the program without creating any other files,
  31. # `make distclean' should leave only the files that were in the
  32. # distribution.
  33. #
  34. # make maintainer-clean
  35. # Delete everything from the current directory that can be
  36. # reconstructed with this Makefile. This typically includes
  37. # everything deleted by distclean, plus more: *.elc files,
  38. # C source files produced by Bison, tags tables, info files,
  39. # and so on.
  40. #
  41. # make extraclean
  42. # Still more severe - delete backup and autosave files, too.
  43. # This gork is required for those who use a Unix-style shell, and
  44. # have SHELL in the environment pointing to it. Here we force
  45. # Make to use COMMAND.COM instead. This Makefile won't work otherwise.
  46. # (The /xyzzy directory is used to minimize the chance that someone
  47. # actually has such a directory with an incompatible command.com. We
  48. # used to have /dos there, but some Windows installations have an old
  49. # version of DOS stashed in that directory, and command.com from there
  50. # won't run on Windows, complaining about "Incorrect DOS version".
  51. # Make will look up PATH for the shell executable, so the directory name
  52. # is not important.)
  53. SHELL=/xyzzy/command
  54. MAKESHELL=/xyzzy/command
  55. # Generate a full pathname of the top-level installation directory
  56. top_srcdir := $(subst \,/,$(shell cd))
  57. # Q: Do we need to bootstrap?
  58. # A: Only if we find autogen/README, i.e. we are building out of
  59. # a VCS-checkout (not a release), and src/b-emacs.exe does not exist.
  60. # This avoids building a bootstrap-emacs and recompiling Lisp files
  61. # when building a pretest/release tarball. Recompiling Lisp files
  62. # is BAD because lisp/Makefile.in requires a Unixy shell.
  63. boot :=
  64. ifneq ($(wildcard autogen/README),)
  65. ifeq ($(wildcard src/b-emacs.exe),)
  66. boot := b-emacs.exe
  67. endif
  68. endif
  69. # Subdirectories to run Make. `lisp' is not included because the
  70. # compiled lisp files are part of the distribution. (If we are
  71. # bootstrapping, the src target will run Make in `lisp' as well.)
  72. # leim is not included because it is part of the src target.
  73. all: lib lib-src src emacs misc lispref lispintro
  74. lib: FRC
  75. cd lib
  76. $(MAKE) top_srcdir=${top_srcdir} all
  77. cd ..
  78. lib-src: lib FRC
  79. cd lib-src
  80. $(MAKE) top_srcdir=${top_srcdir} all
  81. cd ..
  82. # Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which
  83. # is either set to b-emacs.exe (in case bootstrap-emacs has not been
  84. # constructed yet) or the empty string (otherwise).
  85. # src/Makefile.in uses it to implement conditional dependencies, so that
  86. # files that need bootstrap-emacs to be built do not additionally need
  87. # to be kept fresher than b-emacs.exe. Otherwise changing a single
  88. # file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling
  89. # all preloaded elisp files, and only then dump the actual src/emacs, which
  90. # is not wrong, but is overkill in 99.99% of the cases.
  91. src: lib lib-src FRC
  92. cd src
  93. $(MAKE) top_srcdir=${top_srcdir} BOOTSTRAPEMACS="${boot}" all
  94. djecho -s '/-geometry/s,^.*,set environment HOME $(top_srcdir),' \
  95. '/environment *TERM/s/^.*/set environment TERM internal/' \
  96. >gdb.sed
  97. sed -f gdb.sed _gdbinit >gdb.tmp
  98. djecho -a gdb.tmp -s 'set environment USER root' \
  99. 'set environment NAME root' \
  100. 'set environment USERNAME root' \
  101. 'set environment EMACSPATH $(top_srcdir)/bin' \
  102. 'set environment SHELL $(subst \,/,$(COMSPEC))' \
  103. 'set environment PATH $(subst \,/,$(PATH))'
  104. update gdb.tmp gdb.ini
  105. rm -f gdb.tmp gdb.sed
  106. cd ..
  107. if exist src\bootlisp redir $(MAKE) -C lisp top_srcdir=${top_srcdir}
  108. rm -f src/bootlisp
  109. if exist leim\Makefile redir $(MAKE) -C leim top_srcdir=${top_srcdir}
  110. info: emacs misc lispref lispintro
  111. emacs misc lispref lispintro: FRC
  112. cd doc/$@
  113. $(MAKE) top_srcdir=${top_srcdir} info
  114. cd ../..
  115. install: all
  116. if not exist bin\nul md bin
  117. cd lib-src
  118. command.com /c >/dev/null for %p in (hexl etags ctags ebrowse) do\
  119. if exist %p.exe mv -f %p.exe ../bin
  120. cd ..
  121. cd src
  122. mv -f emacs.exe ../bin/
  123. cd ..
  124. djecho -s "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)" \
  125. " (normal-top-level-add-subdirs-to-load-path))" \
  126. > ./subdirs.el
  127. if not exist .\site-lisp\subdirs.el \
  128. update ./subdirs.el ./site-lisp/subdirs.el
  129. rm -f ./subdirs.el
  130. FRC:
  131. # We cannot use [a-zA-Z]* like the mainline distribution does, because
  132. # that causes all file names to be returned in upper-case on DOS...
  133. # Must use `find' to filter out loaddefs files; ignore errors if `find'
  134. # is not available or is an MS `find'.
  135. # The "cd $(CURDIR)" gork is for when `find' fails and leaves us inside
  136. # `lisp' or one of its subdirectories.
  137. TAGS tags: lib-src FRC
  138. cd lib-src
  139. if exist etags.exe mv -f etags.exe ../bin
  140. cd ..
  141. - find $(CURDIR)/lisp -iname "*.el" -a -! -( -iname "*loaddefs.el" -o -iname "ldefs-boot.el" -) | ./bin/etags -o lisp/TAGS -
  142. cd $(CURDIR)
  143. cd src
  144. ../bin/etags --include=../lisp/TAGS \
  145. --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
  146. $(CURDIR)/src/*.c $(CURDIR)/src/*.h \
  147. $(CURDIR)/src/s/msdos.h $(CURDIR)/src/m/intel386.h
  148. cd ..
  149. ./bin/etags --include=src/TAGS
  150. check:
  151. @echo "We don't have any tests for GNU Emacs yet."
  152. clean mostlyclean:
  153. cd lib
  154. $(MAKE) $(MFLAGS) $@
  155. cd ..
  156. cd lib-src
  157. $(MAKE) $(MFLAGS) $@
  158. cd ..
  159. cd src
  160. $(MAKE) $(MFLAGS) $@
  161. cd ..
  162. cd doc
  163. cd emacs
  164. -$(MAKE) $(MFLAGS) $@
  165. cd ..
  166. cd misc
  167. -$(MAKE) $(MFLAGS) $@
  168. cd ..
  169. cd lispref
  170. -$(MAKE) $(MFLAGS) $@
  171. cd ..
  172. cd lispintro
  173. -$(MAKE) $(MFLAGS) $@
  174. cd ..
  175. cd ..
  176. cd leim
  177. if exist Makefile redir $(MAKE) $(MFLAGS) $@
  178. cd ..
  179. top_distclean=rm -f Makefile */Makefile src/_gdbinit
  180. distclean maintainer-clean: FRC
  181. cd src
  182. $(MAKE) $(MFLAGS) $@
  183. if exist bootlisp rm -f bootlisp
  184. cd ..
  185. cd lib
  186. $(MAKE) $(MFLAGS) $@
  187. cd ..
  188. cd lib-src
  189. $(MAKE) $(MFLAGS) $@
  190. cd ..
  191. cd doc
  192. cd emacs
  193. -$(MAKE) $(MFLAGS) $@
  194. cd ..
  195. cd misc
  196. -$(MAKE) $(MFLAGS) $@
  197. cd ..
  198. cd lispref
  199. -$(MAKE) $(MFLAGS) $@
  200. cd ..
  201. cd lispintro
  202. -$(MAKE) $(MFLAGS) $@
  203. cd ..
  204. cd ..
  205. cd leim
  206. if exist Makefile redir $(MAKE) $(MFLAGS) $@
  207. cd ..
  208. cd lisp
  209. $(MAKE) $(MFLAGS) $@
  210. cd ..
  211. ${top_distclean}
  212. extraclean:
  213. cd src
  214. $(MAKE) $(MFLAGS) $@
  215. cd ..
  216. cd lib
  217. $(MAKE) $(MFLAGS) $@
  218. cd ..
  219. cd lib-src
  220. $(MAKE) $(MFLAGS) $@
  221. cd ..
  222. cd doc
  223. cd emacs
  224. -$(MAKE) $(MFLAGS) $@
  225. cd ..
  226. cd misc
  227. -$(MAKE) $(MFLAGS) $@
  228. cd ..
  229. cd lispref
  230. -$(MAKE) $(MFLAGS) $@
  231. cd ..
  232. cd lispintro
  233. -$(MAKE) $(MFLAGS) $@
  234. cd ..
  235. cd ..
  236. cd leim
  237. if exist Makefile redir $(MAKE) $(MFLAGS) $@
  238. cd ..
  239. cd lisp
  240. $(MAKE) $(MFLAGS) $@
  241. cd ..
  242. ${top_distclean}
  243. -rm -f *~ #*
  244. .PHONY: bootstrap
  245. bootstrap-clean: FRC
  246. cd lib
  247. $(MAKE) $(MFLAGS) $@
  248. cd ..
  249. cd src
  250. $(MAKE) $(MFLAGS) $@
  251. cd ..
  252. cd lib-src
  253. $(MAKE) $(MFLAGS) maintainer-clean
  254. cd ..
  255. cd doc
  256. cd emacs
  257. -$(MAKE) $(MFLAGS) maintainer-clean
  258. cd ../misc
  259. -$(MAKE) $(MFLAGS) maintainer-clean
  260. cd ../lispref
  261. -$(MAKE) $(MFLAGS) maintainer-clean
  262. cd ../lispintro
  263. -$(MAKE) $(MFLAGS) maintainer-clean
  264. cd ..
  265. cd ..
  266. cd leim
  267. $(MAKE) $(MFLAGS) maintainer-clean
  268. cd ..
  269. cd lisp
  270. $(MAKE) $(MFLAGS) bootstrap-clean
  271. cd ..
  272. ${top_bootclean}
  273. bootstrap: bootstrap-clean FRC
  274. command.com /e:2048 /c config msdos
  275. $(MAKE) $(MFLAGS) info all