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