Commit | Line | Data |
---|---|---|
4a7c8265 | 1 | # Top-level Makefile for Emacs under MS-DOS/DJGPP v2.0 or higher. -*-makefile-*- |
7121a5e1 | 2 | |
b65d8176 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
b9b14d13 | 4 | # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
7121a5e1 EZ |
5 | |
6 | # This file is part of GNU Emacs. | |
7 | ||
ff0cdfb9 | 8 | # GNU Emacs is free software: you can redistribute it and/or modify |
7121a5e1 | 9 | # it under the terms of the GNU General Public License as published by |
ff0cdfb9 GM |
10 | # the Free Software Foundation, either version 3 of the License, or |
11 | # (at your option) any later version. | |
7121a5e1 EZ |
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 | |
ff0cdfb9 | 19 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
7121a5e1 | 20 | |
2d0300ef | 21 | # make all to compile and build Emacs. |
406865b8 | 22 | # make install to install it (installs in-place, in `bin' subdir of top dir). |
2d0300ef RS |
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. | |
177c0ea7 | 33 | # |
2d0300ef RS |
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. | |
177c0ea7 | 40 | # |
406865b8 | 41 | # make maintainer-clean |
2d0300ef RS |
42 | # Delete everything from the current directory that can be |
43 | # reconstructed with this Makefile. This typically includes | |
406865b8 EZ |
44 | # everything deleted by distclean, plus more: *.elc files, |
45 | # C source files produced by Bison, tags tables, info files, | |
46 | # and so on. | |
2d0300ef RS |
47 | # |
48 | # make extraclean | |
49 | # Still more severe - delete backup and autosave files, too. | |
50 | ||
32372ef8 EZ |
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. | |
94b04180 EZ |
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 | |
32372ef8 | 63 | |
2d0300ef | 64 | # Generate a full pathname of the top-level installation directory |
de219b90 EZ |
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} | |
2d0300ef | 69 | |
d945fac6 | 70 | all: maybe_bootstrap lib-src src emacs lispref lispintro |
2d0300ef RS |
71 | |
72 | lib-src: FRC | |
73 | cd lib-src | |
de219b90 | 74 | $(MAKE) top_srcdir=${top_srcdir} version=${version} |
2d0300ef RS |
75 | cd .. |
76 | ||
77 | src: FRC | |
78 | cd src | |
d945fac6 | 79 | $(MAKE) top_srcdir=${top_srcdir} BOOTSTRAPEMACS="" |
a9530035 EZ |
80 | djecho -s '/-geometry/s,^.*,set environment HOME $(top_srcdir),' \ |
81 | '/environment *TERM/s/^.*/set environment TERM internal/' \ | |
82 | '/x_error_quitter/s/^.*/set environment NAME root/' >gdb.sed | |
83 | sed -f gdb.sed _gdbinit >gdb.tmp | |
efb29aff EZ |
84 | djecho -a gdb.tmp -s 'set environment USER root' \ |
85 | 'set environment EMACSPATH $(top_srcdir)/bin' \ | |
86 | 'set environment SHELL $(subst \,/,$(COMSPEC))' \ | |
87 | 'set environment PATH $(subst \,/,$(PATH))' | |
2d0300ef | 88 | update gdb.tmp gdb.ini |
d04127d3 | 89 | rm -f gdb.tmp gdb.sed |
2d0300ef | 90 | cd .. |
0ccc59eb | 91 | if exist leim\Makefile redir $(MAKE) -C leim top_srcdir=${top_srcdir} |
2d0300ef | 92 | |
d945fac6 EZ |
93 | emacs lispref lispintro: FRC |
94 | cd doc/$@ | |
ca39f6c1 | 95 | $(MAKE) top_srcdir=${top_srcdir} info |
d945fac6 | 96 | cd ../.. |
9830885f | 97 | |
2d0300ef | 98 | install: all |
9830885f | 99 | if not exist bin\nul md bin |
2d0300ef | 100 | cd lib-src |
a9530035 EZ |
101 | command.com /c >/dev/null for %p in (hexl etags ctags b2m ebrowse) do\ |
102 | if exist %p.exe mv -f %p.exe ../bin | |
b712940a | 103 | if exist fns.el update fns.el ../bin/fns.el |
2d0300ef RS |
104 | cd .. |
105 | cd src | |
2d0300ef RS |
106 | mv -f emacs.exe ../bin/ |
107 | cd .. | |
fc406406 EZ |
108 | djecho -s "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)" \ |
109 | " (normal-top-level-add-subdirs-to-load-path))" \ | |
110 | > ./subdirs.el | |
111 | if not exist .\site-lisp\subdirs.el \ | |
112 | update ./subdirs.el ./site-lisp/subdirs.el | |
113 | rm -f ./subdirs.el | |
2d0300ef RS |
114 | |
115 | FRC: | |
116 | ||
838b9528 EZ |
117 | # We cannot use [a-zA-Z]* like the mainline distribution does, because |
118 | # that causes all file names to be returned in upper-case on DOS... | |
53f7e7ad RS |
119 | TAGS tags: lib-src FRC |
120 | cd lib-src | |
121 | if exist etags.exe mv -f etags.exe ../bin | |
122 | cd .. | |
2d0300ef | 123 | cd lisp |
838b9528 | 124 | ../bin/etags .../*.el |
2d0300ef RS |
125 | cd .. |
126 | cd src | |
127 | ../bin/etags --include=../lisp/TAGS \ | |
128 | '--regex=/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' *.c *.h s/msdos.h m/intel386.h | |
129 | cd .. | |
130 | ./bin/etags --include=src/TAGS | |
131 | ||
132 | check: | |
133 | @echo "We don't have any tests for GNU Emacs yet." | |
134 | ||
406865b8 | 135 | clean mostlyclean: |
2d0300ef | 136 | cd lib-src |
406865b8 | 137 | $(MAKE) $(MFLAGS) $@ |
2d0300ef RS |
138 | cd .. |
139 | cd src | |
406865b8 | 140 | $(MAKE) $(MFLAGS) $@ |
2d0300ef RS |
141 | cd .. |
142 | cd oldxmenu | |
406865b8 EZ |
143 | -$(MAKE) $(MFLAGS) $@ |
144 | cd .. | |
d945fac6 EZ |
145 | cd doc |
146 | cd emacs | |
147 | -$(MAKE) $(MFLAGS) $@ | |
148 | cd .. | |
149 | cd misc | |
406865b8 EZ |
150 | -$(MAKE) $(MFLAGS) $@ |
151 | cd .. | |
152 | cd lispref | |
153 | -$(MAKE) $(MFLAGS) $@ | |
154 | cd .. | |
155 | cd lispintro | |
156 | -$(MAKE) $(MFLAGS) $@ | |
2d0300ef | 157 | cd .. |
d945fac6 | 158 | cd .. |
0ccc59eb | 159 | cd leim |
406865b8 | 160 | if exist Makefile redir $(MAKE) $(MFLAGS) $@ |
0ccc59eb | 161 | cd .. |
406865b8 | 162 | -$(MAKE) $(MFLAGS) $@ |
f72a0a4a | 163 | |
406865b8 EZ |
164 | top_distclean=rm -f Makefile */Makefile src/_gdbinit |
165 | ||
166 | distclean maintainer-clean: FRC | |
167 | cd src | |
168 | $(MAKE) $(MFLAGS) $@ | |
169 | cd .. | |
170 | cd oldxmenu | |
171 | -$(MAKE) $(MFLAGS) $@ | |
172 | cd .. | |
173 | cd lib-src | |
174 | $(MAKE) $(MFLAGS) $@ | |
175 | cd .. | |
d945fac6 EZ |
176 | cd doc |
177 | cd emacs | |
178 | -$(MAKE) $(MFLAGS) $@ | |
179 | cd .. | |
180 | cd misc | |
406865b8 EZ |
181 | -$(MAKE) $(MFLAGS) $@ |
182 | cd .. | |
183 | cd lispref | |
184 | -$(MAKE) $(MFLAGS) $@ | |
185 | cd .. | |
186 | cd lispintro | |
187 | -$(MAKE) $(MFLAGS) $@ | |
188 | cd .. | |
d945fac6 | 189 | cd .. |
406865b8 EZ |
190 | cd leim |
191 | if exist Makefile redir $(MAKE) $(MFLAGS) $@ | |
192 | cd .. | |
193 | cd lisp | |
194 | $(MAKE) $(MFLAGS) $@ | |
195 | cd .. | |
196 | ${top_distclean} | |
197 | ||
198 | extraclean: | |
199 | cd src | |
200 | $(MAKE) $(MFLAGS) $@ | |
201 | cd .. | |
202 | cd oldxmenu | |
203 | -$(MAKE) $(MFLAGS) $@ | |
204 | cd .. | |
205 | cd lib-src | |
206 | $(MAKE) $(MFLAGS) $@ | |
207 | cd .. | |
d945fac6 EZ |
208 | cd doc |
209 | cd emacs | |
210 | -$(MAKE) $(MFLAGS) $@ | |
211 | cd .. | |
212 | cd misc | |
406865b8 EZ |
213 | -$(MAKE) $(MFLAGS) $@ |
214 | cd .. | |
215 | cd lispref | |
216 | -$(MAKE) $(MFLAGS) $@ | |
217 | cd .. | |
218 | cd lispintro | |
219 | -$(MAKE) $(MFLAGS) $@ | |
220 | cd .. | |
d945fac6 | 221 | cd .. |
406865b8 EZ |
222 | cd leim |
223 | if exist Makefile redir $(MAKE) $(MFLAGS) $@ | |
224 | cd .. | |
225 | cd lisp | |
226 | $(MAKE) $(MFLAGS) $@ | |
227 | cd .. | |
228 | ${top_distclean} | |
229 | -rm -f *~ #* | |
230 | ||
231 | .PHONY: bootstrap bootstrap-lisp-1 bootstrap-src bootstrap-lisp bootstrap-clean | |
232 | .PHONY: maybe_bootstrap bootfast | |
f72a0a4a EZ |
233 | |
234 | maybe_bootstrap: | |
b9c1fa2e | 235 | @if not exist lisp\abbrev.elc djecho \ |
f72a0a4a | 236 | "Some *.elc files are missing. You should do a `make bootstrap'." |
b9c1fa2e | 237 | @if not exist lisp\abbrev.elc redir -e /dev/null -oe redir fail-this-make.exe |
f72a0a4a EZ |
238 | |
239 | bootstrap: bootstrap-clean-before bootstrap-lisp-1 bootstrap-src bootstrap-lisp bootstrap-clean-after all info | |
406865b8 EZ |
240 | cd lisp; $(MAKE) $(MFLAGS) bootstrap-after; cd .. |
241 | ||
242 | bootfast: bootstrap-clean-before bootstrap-src bootstrap-lisp bootstrap-clean-after all info | |
243 | cd lisp; $(MAKE) $(MFLAGS) bootstrap-after; cd .. | |
f72a0a4a EZ |
244 | |
245 | bootstrap-lisp-1: | |
1af6e3a9 | 246 | cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean; cd .. |
f72a0a4a EZ |
247 | |
248 | bootstrap-lisp: | |
fae44638 | 249 | cd lisp; $(MAKE) $(MFLAGS) bootstrap EMACS=${top_srcdir}/src/b-emacs.exe lisp=${top_srcdir}/lisp; cd .. |
f72a0a4a EZ |
250 | |
251 | bootstrap-src: | |
1af6e3a9 | 252 | cd src; $(MAKE) $(MFLAGS) bootstrap; cd .. |
f72a0a4a EZ |
253 | |
254 | ### Used for `bootstrap' to avoid deleting existing dumped Emacs executables. | |
255 | bootstrap-clean-before: FRC | |
1af6e3a9 EZ |
256 | cd src; $(MAKE) $(MFLAGS) mostlyclean; cd .. |
257 | cd lib-src; $(MAKE) $(MFLAGS) clean; cd .. | |
d945fac6 EZ |
258 | -cd doc/emacs; $(MAKE) $(MFLAGS) clean; cd .. |
259 | -cd misc; $(MAKE) $(MFLAGS) clean; cd .. | |
406865b8 | 260 | -cd lispref; $(MAKE) $(MFLAGS) clean; cd .. |
d945fac6 | 261 | -cd lispintro; $(MAKE) $(MFLAGS) clean; cd ..; cd .. |
406865b8 | 262 | cd leim; if exist Makefile redir $(MAKE) $(MFLAGS) clean; cd .. |
f72a0a4a EZ |
263 | |
264 | bootstrap-clean-after: | |
1af6e3a9 | 265 | cd src; $(MAKE) $(MFLAGS) mostlyclean; cd .. |
ab5796a9 MB |
266 | |
267 | # arch-tag: 6fee5130-4c53-46c6-93d3-d0ea852298b9 |