*** empty log message ***
[bpt/emacs.git] / msdos / mainmake.v2
CommitLineData
4a7c8265 1# Top-level Makefile for Emacs under MS-DOS/DJGPP v2.0 or higher. -*-makefile-*-
7121a5e1 2
162deabe
EZ
3# Copyright (C) 1996,1997,1998,1999,2000,2001,2002
4# Free Software Foundation, Inc.
7121a5e1
EZ
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 2, or (at your option)
11# 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; see the file COPYING. If not, write to
20# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21# Boston, MA 02111-1307, USA.
22
2d0300ef
RS
23# make all to compile and build Emacs.
24# make install to install it.
25# make TAGS to update tags tables.
26#
27# make clean or make mostlyclean
28# Delete all files from the current directory that are normally
29# created by building the program. Don't delete the files that
30# record the configuration. Also preserve files that could be made
31# by building, but normally aren't because the distribution comes
32# with them.
33#
34# Delete `.dvi' files here if they are not part of the distribution.
177c0ea7 35#
2d0300ef
RS
36# make distclean
37# Delete all files from the current directory that are created by
38# configuring or building the program. If you have unpacked the
39# source and built the program without creating any other files,
40# `make distclean' should leave only the files that were in the
41# distribution.
177c0ea7 42#
2d0300ef
RS
43# make realclean
44# Delete everything from the current directory that can be
45# reconstructed with this Makefile. This typically includes
46# everything deleted by distclean, plus more: C source files
47# produced by Bison, tags tables, info files, and so on.
48#
49# make extraclean
50# Still more severe - delete backup and autosave files, too.
51
32372ef8
EZ
52# This gork is required for those who use a Unix-style shell, and
53# have SHELL in the environment pointing to it. Here we force
54# Make to use COMMAND.COM instead. This Makefile won't work otherwise.
94b04180
EZ
55# (The /xyzzy directory is used to minimize the chance that someone
56# actually has such a directory with an incompatible command.com. We
57# used to have /dos there, but some Windows installations have an old
58# version of DOS stashed in that directory, and command.com from there
59# won't run on Windows, complaining about "Incorrect DOS version".
60# Make will look up PATH for the shell executable, so the directory name
61# is not important.)
62SHELL=/xyzzy/command
63MAKESHELL=/xyzzy/command
32372ef8 64
2d0300ef 65# Generate a full pathname of the top-level installation directory
de219b90
EZ
66top_srcdir := $(subst \,/,$(shell cd))
67
68# Find out which version of Emacs this is.
69version := ${shell sed -n -e '/(defconst emacs-version/s/^[^"]*\("[^"]*"\).*/\1/p' lisp/version.el}
2d0300ef 70
9cf57fc9 71all: maybe_bootstrap lib-src src man lispref lispintro
2d0300ef
RS
72
73lib-src: FRC
74 cd lib-src
de219b90 75 $(MAKE) top_srcdir=${top_srcdir} version=${version}
2d0300ef
RS
76 cd ..
77
78src: FRC
79 cd src
de219b90 80 $(MAKE) top_srcdir=${top_srcdir}
a9530035
EZ
81 djecho -s '/-geometry/s,^.*,set environment HOME $(top_srcdir),' \
82 '/environment *TERM/s/^.*/set environment TERM internal/' \
83 '/x_error_quitter/s/^.*/set environment NAME root/' >gdb.sed
84 sed -f gdb.sed _gdbinit >gdb.tmp
efb29aff
EZ
85 djecho -a gdb.tmp -s 'set environment USER root' \
86 'set environment EMACSPATH $(top_srcdir)/bin' \
87 'set environment SHELL $(subst \,/,$(COMSPEC))' \
88 'set environment PATH $(subst \,/,$(PATH))'
2d0300ef 89 update gdb.tmp gdb.ini
d04127d3 90 rm -f gdb.tmp gdb.sed
2d0300ef 91 cd ..
0ccc59eb 92 if exist leim\Makefile redir $(MAKE) -C leim top_srcdir=${top_srcdir}
2d0300ef 93
aae3cbdf 94man lispref lispintro: FRC
db441627 95 cd $@
ca39f6c1 96 $(MAKE) top_srcdir=${top_srcdir} info
9830885f
EZ
97 cd ..
98
2d0300ef 99install: all
9830885f 100 if not exist bin\nul md bin
2d0300ef 101 cd lib-src
a9530035
EZ
102 command.com /c >/dev/null for %p in (hexl etags ctags b2m ebrowse) do\
103 if exist %p.exe mv -f %p.exe ../bin
b712940a 104 if exist fns.el update fns.el ../bin/fns.el
2d0300ef
RS
105 cd ..
106 cd src
107 stubify emacs
108 stubedit emacs.exe minstack=512k
109 mv -f emacs.exe ../bin/
110 cd ..
fc406406
EZ
111 djecho -s "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)" \
112 " (normal-top-level-add-subdirs-to-load-path))" \
113 > ./subdirs.el
114 if not exist .\site-lisp\subdirs.el \
115 update ./subdirs.el ./site-lisp/subdirs.el
116 rm -f ./subdirs.el
2d0300ef
RS
117
118FRC:
119
838b9528
EZ
120# We cannot use [a-zA-Z]* like the mainline distribution does, because
121# that causes all file names to be returned in upper-case on DOS...
53f7e7ad
RS
122TAGS tags: lib-src FRC
123 cd lib-src
124 if exist etags.exe mv -f etags.exe ../bin
125 cd ..
2d0300ef 126 cd lisp
838b9528 127 ../bin/etags .../*.el
2d0300ef
RS
128 cd ..
129 cd src
130 ../bin/etags --include=../lisp/TAGS \
131 '--regex=/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' *.c *.h s/msdos.h m/intel386.h
132 cd ..
133 ./bin/etags --include=src/TAGS
134
135check:
136 @echo "We don't have any tests for GNU Emacs yet."
137
138clean:
139 cd lib-src
140 $(MAKE) clean
141 cd ..
142 cd src
143 $(MAKE) clean
144 cd ..
145 cd oldxmenu
146 -$(MAKE) clean
147 cd ..
0ccc59eb
EZ
148 cd leim
149 if exist Makefile redir $(MAKE) clean
150 cd ..
f72a0a4a
EZ
151
152.PHONY: bootstrap bootstrap-lisp-1 boostrap-src bootstrap-lisp bootstrap-clean
153.PHONY: maybe_bootstrap
154
155maybe_bootstrap:
b9c1fa2e 156 @if not exist lisp\abbrev.elc djecho \
f72a0a4a 157 "Some *.elc files are missing. You should do a `make bootstrap'."
b9c1fa2e 158 @if not exist lisp\abbrev.elc redir -e /dev/null -oe redir fail-this-make.exe
f72a0a4a
EZ
159
160bootstrap: bootstrap-clean-before bootstrap-lisp-1 bootstrap-src bootstrap-lisp bootstrap-clean-after all info
161
162bootstrap-lisp-1:
1af6e3a9 163 cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean; cd ..
f72a0a4a
EZ
164
165bootstrap-lisp:
fae44638 166 cd lisp; $(MAKE) $(MFLAGS) bootstrap EMACS=${top_srcdir}/src/b-emacs.exe lisp=${top_srcdir}/lisp; cd ..
f72a0a4a
EZ
167
168bootstrap-src:
1af6e3a9 169 cd src; $(MAKE) $(MFLAGS) bootstrap; cd ..
f72a0a4a
EZ
170
171### Used for `bootstrap' to avoid deleting existing dumped Emacs executables.
172bootstrap-clean-before: FRC
1af6e3a9
EZ
173 cd src; $(MAKE) $(MFLAGS) mostlyclean; cd ..
174 cd lib-src; $(MAKE) $(MFLAGS) clean; cd ..
175 cd leim; $(MAKE) $(MFLAGS) clean; cd ..
f72a0a4a
EZ
176
177bootstrap-clean-after:
1af6e3a9 178 cd src; $(MAKE) $(MFLAGS) mostlyclean; cd ..
ab5796a9
MB
179
180# arch-tag: 6fee5130-4c53-46c6-93d3-d0ea852298b9