1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 # 2005, 2006 Free Software Foundation, Inc.
5 # Top level makefile for building GNU Emacs on Windows NT
7 # This file is part of GNU Emacs.
9 # GNU Emacs is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # GNU Emacs is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Emacs; see the file COPYING. If not, write to
21 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 # Boston, MA 02110-1301, USA.
24 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
28 TRES = $(BLD)/emacs.res
32 addpm: stamp_BLD $(BLD)/addpm.exe
33 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
34 $(LINK) $(LINK_OUT)$@ \
35 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
37 ddeclient: stamp_BLD $(BLD)/ddeclient.exe
38 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
39 $(LINK) $(LINK_OUT)$@ \
40 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
42 cmdproxy: stamp_BLD $(BLD)/cmdproxy.exe
43 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
44 $(LINK) $(LINK_OUT)$@ \
45 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
47 addsection: stamp_BLD $(BLD)/addsection.exe
48 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
49 $(LINK) $(LINK_OUT)$@ \
50 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
52 preprep: stamp_BLD $(BLD)/preprep.exe
53 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
54 $(LINK) $(LINK_OUT)$@ \
55 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
58 # The resource file. NT 3.10 requires the use of cvtres; even though
59 # it is not necessary on later versions, it is still ok to use it.
61 $(TRES): emacs.rc stamp_BLD
62 $(RC) $(RC_OUT)$(BLD)/emacs.res $<
64 runemacs: stamp_BLD $(BLD)/runemacs.exe
65 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
66 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
67 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
70 @echo Using $(THE_SHELL) as shell.
72 # These depend on stamp_BLD to make sure the $(BLD) directory is created
73 # before the compilation begins, even if Make runs several commands
74 # in parallel under "make -j".
76 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
81 all: which-sh stamp_BLD $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)
83 all-other-dirs-nmake: addsection
85 $(MAKE) $(MFLAGS) $(XMFLAGS) all
87 $(MAKE) $(MFLAGS) $(XMFLAGS) all
89 $(MAKE) $(MFLAGS) $(XMFLAGS) all
91 $(MAKE) $(MFLAGS) $(XMFLAGS) all
94 all-other-dirs-gmake: addsection
95 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all
96 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all
97 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all
98 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all
100 recompile: recompile-$(MAKETYPE)
104 $(MAKE) $(MFLAGS) $(XMFLAGS) recompile
108 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile
112 ### This is meant for Emacs maintainers only. It first cleans the
113 ### lisp subdirectory, removing all compiled Lisp files. Then a
114 ### special emacs executable is built from Lisp sources, which is then
115 ### used to compile Lisp files. The last step is a "normal" make.
117 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
119 # dummy target to force other targets to be evaluated.
122 maybe-bootstrap-CMD: doit
124 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
125 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
127 @if not EXIST ..\lisp\abbrev.elc exit -1
129 maybe-bootstrap-SH: doit
130 @if [ ! -f ../lisp/abbrev.elc ] ; then \
132 echo "Essential Lisp files seem to be missing. You should either"; \
133 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
138 bootstrap: addsection bootstrap-$(MAKETYPE) all
140 bootstrap-nmake: addsection
142 $(MAKE) $(MFLAGS) bootstrap-clean
144 $(MAKE) $(MFLAGS) clean
146 $(MAKE) $(MFLAGS) clean
148 $(MAKE) $(MFLAGS) bootstrap
149 $(MAKE) $(MFLAGS) bootstrap-clean
151 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
153 $(MAKE) $(MFLAGS) DOC
156 bootstrap-gmake: addsection
157 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
158 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
159 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
160 $(MAKE) $(MFLAGS) $(XMFLAGS) XMFLAGS="$(XMFLAGS)" -C ../src bootstrap
161 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
162 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap
163 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC
165 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
167 bootstrap-clean-nmake:
169 $(MAKE) $(MFLAGS) bootstrap-clean
171 $(MAKE) $(MFLAGS) bootstrap-clean
173 bootstrap-clean-gmake:
174 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
175 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
178 - mkdir "$(INSTALL_DIR)"
180 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
181 - mkdir "$(INSTALL_DIR)/bin"
184 # Build and install emacs in INSTALL_DIR
186 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
187 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
188 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
189 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
190 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
191 - "$(INSTALL_DIR)/bin/addpm" -q
192 - $(DEL) ../same-dir.tst
193 - $(DEL) $(INSTALL_DIR)/same-dir.tst
194 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
195 - mkdir "$(INSTALL_DIR)/etc"
196 - mkdir "$(INSTALL_DIR)/info"
197 - mkdir "$(INSTALL_DIR)/lock"
198 - mkdir "$(INSTALL_DIR)/data"
199 - mkdir "$(INSTALL_DIR)/site-lisp"
200 - mkdir "$(INSTALL_DIR)/etc/icons"
201 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
202 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
203 - $(CP_DIR) icons $(INSTALL_DIR)/etc
204 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
205 - $(DEL) ../same-dir.tst
206 - $(DEL) $(INSTALL_DIR)/same-dir.tst
208 install-other-dirs-nmake:
210 $(MAKE) $(MFLAGS) install
212 $(MAKE) $(MFLAGS) install
214 $(MAKE) $(MFLAGS) install
216 $(MAKE) $(MFLAGS) install
219 install-other-dirs-gmake:
220 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install
221 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install
222 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install
223 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
226 # Note that man/makefile knows how to
227 # put the info files in $(infodir),
228 # so we can do ok running make in the build dir.
229 info: force-info info-$(MAKETYPE)
233 $(MAKE) $(MFLAGS) info
235 $(MAKE) $(MFLAGS) info
237 $(MAKE) $(MFLAGS) info
240 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../man info
241 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispref info
242 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispintro info
246 clean: clean-other-dirs-$(MAKETYPE)
247 - $(DEL) *~ $(COMPILER_TEMP_FILES)
248 - $(DEL_TREE) $(OBJDIR)
249 - $(DEL) ../etc/DOC ../etc/DOC-X
251 clean-other-dirs-nmake:
253 $(MAKE) $(MFLAGS) clean
255 $(MAKE) $(MFLAGS) clean
257 $(MAKE) $(MFLAGS) clean
259 $(MAKE) $(MFLAGS) clean
261 $(MAKE) $(MFLAGS) clean
263 $(MAKE) $(MFLAGS) clean
265 $(MAKE) $(MFLAGS) clean
268 clean-other-dirs-gmake:
269 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
270 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
271 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp clean
272 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean
274 cleanall-other-dirs-nmake:
276 $(MAKE) $(MFLAGS) cleanall
278 $(MAKE) $(MFLAGS) cleanall
281 cleanall-other-dirs-gmake:
282 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall
283 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall
285 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
287 - $(DEL_TREE) obj-spd