1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
\r
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
\r
3 # 2005, 2006, 2007 Free Software Foundation, Inc.
\r
5 # Top level makefile for building GNU Emacs on Windows NT
\r
7 # This file is part of GNU Emacs.
\r
9 # GNU Emacs is free software; you can redistribute it and/or modify
\r
10 # it under the terms of the GNU General Public License as published by
\r
11 # the Free Software Foundation; either version 3, or (at your option)
\r
12 # any later version.
\r
14 # GNU Emacs is distributed in the hope that it will be useful,
\r
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 # GNU General Public License for more details.
\r
19 # You should have received a copy of the GNU General Public License
\r
20 # along with GNU Emacs; see the file COPYING. If not, write to
\r
21 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
\r
22 # Boston, MA 02110-1301, USA.
\r
24 # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out
\r
25 # (and remove or replace this comment).
\r
27 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
\r
31 TRES = $(BLD)/emacs.res
\r
35 addpm: stamp_BLD $(BLD)/addpm.exe
\r
36 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
\r
37 $(LINK) $(LINK_OUT)$@ \
\r
38 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
40 ddeclient: stamp_BLD $(BLD)/ddeclient.exe
\r
41 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
\r
42 $(LINK) $(LINK_OUT)$@ \
\r
43 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
45 cmdproxy: stamp_BLD $(BLD)/cmdproxy.exe
\r
46 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
\r
47 $(LINK) $(LINK_OUT)$@ \
\r
48 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
50 addsection: stamp_BLD $(BLD)/addsection.exe
\r
51 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
\r
52 $(LINK) $(LINK_OUT)$@ \
\r
53 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
55 preprep: stamp_BLD $(BLD)/preprep.exe
\r
56 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
\r
57 $(LINK) $(LINK_OUT)$@ \
\r
58 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
\r
61 # The resource file. NT 3.10 requires the use of cvtres; even though
\r
62 # it is not necessary on later versions, it is still ok to use it.
\r
64 $(TRES): emacs.rc stamp_BLD
\r
65 $(RC) $(RC_OUT)$(BLD)/emacs.res emacs.rc
\r
67 runemacs: stamp_BLD $(BLD)/runemacs.exe
\r
68 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
\r
69 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
\r
70 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
73 @echo Using $(THE_SHELL) as shell.
\r
75 # These depend on stamp_BLD to make sure the $(BLD) directory is created
\r
76 # before the compilation begins, even if Make runs several commands
\r
77 # in parallel under "make -j".
\r
79 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
\r
84 all: which-sh stamp_BLD $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)
\r
86 all-other-dirs-nmake: addsection
\r
88 $(MAKE) $(MFLAGS) all
\r
90 $(MAKE) $(MFLAGS) all
\r
92 $(MAKE) $(MFLAGS) all
\r
94 $(MAKE) $(MFLAGS) all
\r
97 all-other-dirs-gmake: addsection
\r
98 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all
\r
99 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all
\r
100 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all
\r
101 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all
\r
103 recompile: recompile-$(MAKETYPE)
\r
107 $(MAKE) $(MFLAGS) recompile
\r
111 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile
\r
113 #### Bootstrapping.
\r
115 ### This is meant for Emacs maintainers only. It first cleans the
\r
116 ### lisp subdirectory, removing all compiled Lisp files. Then a
\r
117 ### special emacs executable is built from Lisp sources, which is then
\r
118 ### used to compile Lisp files. The last step is a "normal" make.
\r
120 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
\r
122 # dummy target to force other targets to be evaluated.
\r
125 maybe-bootstrap-CMD: doit
\r
127 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
\r
128 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
\r
130 @if not EXIST ..\lisp\abbrev.elc exit -1
\r
132 maybe-bootstrap-SH: doit
\r
133 @if [ ! -f ../lisp/abbrev.elc ] ; then \
\r
135 echo "Essential Lisp files seem to be missing. You should either"; \
\r
136 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
\r
141 # Bootstrap depends on cmdproxy because some Lisp functions
\r
142 # loaded during bootstrap may need to run shell commands.
\r
143 bootstrap: addsection cmdproxy bootstrap-$(MAKETYPE)
\r
144 $(MAKE) $(MFLAGS) $(XMFLAGS) all
\r
146 bootstrap-nmake: addsection cmdproxy
\r
148 $(MAKE) $(MFLAGS) bootstrap-clean
\r
150 $(MAKE) $(MFLAGS) clean
\r
152 $(MAKE) $(MFLAGS) clean
\r
154 $(MAKE) $(MFLAGS) bootstrap
\r
155 $(MAKE) $(MFLAGS) bootstrap-clean
\r
157 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
159 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
\r
161 $(MAKE) $(MFLAGS) DOC
\r
164 bootstrap-gmake: addsection cmdproxy
\r
165 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
166 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
167 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
168 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap
\r
169 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
170 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
171 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap
\r
172 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC
\r
174 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
\r
176 bootstrap-clean-nmake:
\r
178 $(MAKE) $(MFLAGS) bootstrap-clean
\r
180 $(MAKE) $(MFLAGS) bootstrap-clean
\r
182 bootstrap-clean-gmake:
\r
183 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
184 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
187 - mkdir "$(INSTALL_DIR)"
\r
189 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
\r
190 - mkdir "$(INSTALL_DIR)/bin"
\r
193 # Build and install emacs in INSTALL_DIR
\r
195 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
\r
196 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
\r
197 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
\r
198 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
\r
199 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
\r
200 - "$(INSTALL_DIR)/bin/addpm" -q
\r
201 - $(DEL) ../same-dir.tst
\r
202 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
203 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
\r
204 - mkdir "$(INSTALL_DIR)/etc"
\r
205 - mkdir "$(INSTALL_DIR)/info"
\r
206 - mkdir "$(INSTALL_DIR)/lock"
\r
207 - mkdir "$(INSTALL_DIR)/data"
\r
208 - mkdir "$(INSTALL_DIR)/site-lisp"
\r
209 - mkdir "$(INSTALL_DIR)/etc/icons"
\r
210 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
\r
211 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
\r
212 - $(CP_DIR) icons $(INSTALL_DIR)/etc
\r
213 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
\r
214 - $(DEL) ../same-dir.tst
\r
215 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
217 install-other-dirs-nmake:
\r
219 $(MAKE) $(MFLAGS) install
\r
221 $(MAKE) $(MFLAGS) install
\r
223 $(MAKE) $(MFLAGS) install
\r
225 $(MAKE) $(MFLAGS) install
\r
228 install-other-dirs-gmake:
\r
229 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install
\r
230 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install
\r
231 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install
\r
232 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
\r
235 # Note that man/makefile knows how to
\r
236 # put the info files in $(infodir),
\r
237 # so we can do ok running make in the build dir.
\r
238 info: force-info info-$(MAKETYPE)
\r
242 $(MAKE) $(MFLAGS) info
\r
244 $(MAKE) $(MFLAGS) info
\r
246 $(MAKE) $(MFLAGS) info
\r
249 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../man info
\r
250 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispref info
\r
251 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispintro info
\r
255 clean: clean-other-dirs-$(MAKETYPE)
\r
256 - $(DEL) $(COMPILER_TEMP_FILES)
\r
257 - $(DEL_TREE) $(OBJDIR)
\r
259 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
261 clean-other-dirs-nmake:
\r
263 $(MAKE) $(MFLAGS) clean
\r
265 $(MAKE) $(MFLAGS) clean
\r
267 $(MAKE) $(MFLAGS) clean
\r
269 $(MAKE) $(MFLAGS) clean
\r
271 $(MAKE) $(MFLAGS) clean
\r
273 $(MAKE) $(MFLAGS) clean
\r
275 $(MAKE) $(MFLAGS) clean
\r
278 clean-other-dirs-gmake:
\r
279 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
280 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
281 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp clean
\r
282 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean
\r
284 cleanall-other-dirs-nmake:
\r
286 $(MAKE) $(MFLAGS) cleanall
\r
288 $(MAKE) $(MFLAGS) cleanall
\r
291 cleanall-other-dirs-gmake:
\r
292 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall
\r
293 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall
\r
295 # We used to delete *~ here, but that might inadvertently remove
\r
296 # precious files if it happens to match their short 8+3 aliases.
\r
297 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
\r
299 - $(DEL_TREE) obj-spd
\r
301 - $(DEL_TREE) oo-spd
\r
303 realclean: cleanall
\r
304 - $(DEL_TREE) ../bin
\r