1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
\r
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
\r
3 # 2005 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 2, 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 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
\r
28 TRES = $(BLD)/emacs.res
\r
30 addpm: $(BLD) $(BLD)/addpm.exe
\r
31 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
\r
32 $(LINK) $(LINK_OUT)$@ \
\r
33 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
35 ddeclient: $(BLD) $(BLD)/ddeclient.exe
\r
36 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
\r
37 $(LINK) $(LINK_OUT)$@ \
\r
38 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
40 cmdproxy: $(BLD) $(BLD)/cmdproxy.exe
\r
41 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
\r
42 $(LINK) $(LINK_OUT)$@ \
\r
43 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
45 addsection: $(BLD) $(BLD)/addsection.exe
\r
46 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
\r
47 $(LINK) $(LINK_OUT)$@ \
\r
48 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
50 preprep: $(BLD) $(BLD)/preprep.exe
\r
51 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
\r
52 $(LINK) $(LINK_OUT)$@ \
\r
53 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
\r
56 # The resource file. NT 3.10 requires the use of cvtres; even though
\r
57 # it is not necessary on later versions, it is still ok to use it.
\r
60 $(RC) $(RC_OUT)$(BLD)/emacs.res $(ALL_DEPS)
\r
62 runemacs: $(BLD) $(BLD)/runemacs.exe
\r
63 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
\r
64 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
\r
65 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
68 @echo Using $(THE_SHELL) as shell.
\r
73 all: which-sh $(BLD) $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)
\r
75 all-other-dirs-nmake:
\r
77 $(MAKE) $(MFLAGS) all
\r
79 $(MAKE) $(MFLAGS) all
\r
81 $(MAKE) $(MFLAGS) all
\r
83 $(MAKE) $(MFLAGS) all
\r
86 all-other-dirs-gmake:
\r
87 $(MAKE) $(MFLAGS) -C ../lib-src all
\r
88 $(MAKE) $(MFLAGS) -C ../src all
\r
89 $(MAKE) $(MFLAGS) -C ../lisp all
\r
90 $(MAKE) $(MFLAGS) -C ../leim all
\r
92 recompile: recompile-$(MAKETYPE)
\r
96 $(MAKE) $(MFLAGS) recompile
\r
100 $(MAKE) $(MFLAGS) -C ../lisp recompile
\r
102 #### Bootstrapping.
\r
104 ### This is meant for Emacs maintainers only. It first cleans the
\r
105 ### lisp subdirectory, removing all compiled Lisp files. Then a
\r
106 ### special emacs executable is built from Lisp sources, which is then
\r
107 ### used to compile Lisp files. The last step is a "normal" make.
\r
109 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
\r
111 # dummy target to force other targets to be evaluated.
\r
114 maybe-bootstrap-CMD: doit
\r
116 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
\r
117 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
\r
119 @if not EXIST ..\lisp\abbrev.elc exit -1
\r
121 maybe-bootstrap-SH: doit
\r
122 @if [ ! -f ../lisp/abbrev.elc ] ; then \
\r
124 echo "Essential Lisp files seem to be missing. You should either"; \
\r
125 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
\r
130 bootstrap: addsection bootstrap-$(MAKETYPE) all
\r
134 $(MAKE) $(MFLAGS) bootstrap-clean
\r
136 $(MAKE) $(MFLAGS) clean
\r
138 $(MAKE) $(MFLAGS) clean
\r
140 $(MAKE) $(MFLAGS) bootstrap
\r
141 $(MAKE) $(MFLAGS) bootstrap-clean
\r
143 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
\r
145 $(MAKE) $(MFLAGS) DOC
\r
149 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean
\r
150 $(MAKE) $(MFLAGS) -C ../src clean
\r
151 $(MAKE) $(MFLAGS) -C ../lib-src clean
\r
152 $(MAKE) $(MFLAGS) -C ../src bootstrap
\r
153 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean
\r
154 $(MAKE) $(MFLAGS) -C ../lisp bootstrap
\r
155 $(MAKE) $(MFLAGS) -C ../lib-src DOC
\r
157 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
\r
159 bootstrap-clean-nmake:
\r
161 $(MAKE) $(MFLAGS) bootstrap-clean
\r
163 $(MAKE) $(MFLAGS) bootstrap-clean
\r
165 bootstrap-clean-gmake:
\r
166 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean
\r
167 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean
\r
170 - mkdir "$(INSTALL_DIR)"
\r
172 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
\r
173 - mkdir "$(INSTALL_DIR)/bin"
\r
176 # Build and install emacs in INSTALL_DIR
\r
178 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
\r
179 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
\r
180 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
\r
181 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
\r
182 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
\r
183 - "$(INSTALL_DIR)/bin/addpm" /q
\r
184 - $(DEL) ../same-dir.tst
\r
185 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
186 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
\r
187 - mkdir "$(INSTALL_DIR)/etc"
\r
188 - mkdir "$(INSTALL_DIR)/info"
\r
189 - mkdir "$(INSTALL_DIR)/lock"
\r
190 - mkdir "$(INSTALL_DIR)/data"
\r
191 - mkdir "$(INSTALL_DIR)/site-lisp"
\r
192 - mkdir "$(INSTALL_DIR)/etc/icons"
\r
193 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
\r
194 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
\r
195 - $(CP_DIR) icons $(INSTALL_DIR)/etc
\r
196 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
\r
197 - $(DEL) ../same-dir.tst
\r
198 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
200 install-other-dirs-nmake:
\r
202 $(MAKE) $(MFLAGS) install
\r
204 $(MAKE) $(MFLAGS) install
\r
206 $(MAKE) $(MFLAGS) install
\r
208 $(MAKE) $(MFLAGS) install
\r
211 install-other-dirs-gmake:
\r
212 $(MAKE) $(MFLAGS) -C ../lib-src install
\r
213 $(MAKE) $(MFLAGS) -C ../src install
\r
214 $(MAKE) $(MFLAGS) -C ../lisp install
\r
215 $(MAKE) $(MFLAGS) -C ../leim install
\r
218 # Note that man/makefile knows how to
\r
219 # put the info files in $(infodir),
\r
220 # so we can do ok running make in the build dir.
\r
221 info: force-info info-$(MAKETYPE)
\r
225 $(MAKE) $(MFLAGS) info
\r
227 $(MAKE) $(MFLAGS) info
\r
229 $(MAKE) $(MFLAGS) info
\r
232 $(MAKE) $(MFLAGS) -C ../man info
\r
233 $(MAKE) $(MFLAGS) -C ../lispref info
\r
234 $(MAKE) $(MFLAGS) -C ../lispintro info
\r
238 clean: clean-other-dirs-$(MAKETYPE)
\r
239 - $(DEL) *~ $(COMPILER_TEMP_FILES)
\r
240 - $(DEL_TREE) $(OBJDIR)
\r
241 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
243 clean-other-dirs-nmake:
\r
245 $(MAKE) $(MFLAGS) clean
\r
247 $(MAKE) $(MFLAGS) clean
\r
249 $(MAKE) $(MFLAGS) clean
\r
251 $(MAKE) $(MFLAGS) clean
\r
253 $(MAKE) $(MFLAGS) clean
\r
255 $(MAKE) $(MFLAGS) clean
\r
257 $(MAKE) $(MFLAGS) clean
\r
260 clean-other-dirs-gmake:
\r
261 $(MAKE) $(MFLAGS) -C ../lib-src clean
\r
262 $(MAKE) $(MFLAGS) -C ../src clean
\r
263 $(MAKE) $(MFLAGS) -C ../lisp clean
\r
264 $(MAKE) $(MFLAGS) -C ../leim clean
\r
266 cleanall-other-dirs-nmake:
\r
268 $(MAKE) $(MFLAGS) cleanall
\r
270 $(MAKE) $(MFLAGS) cleanall
\r
273 cleanall-other-dirs-gmake:
\r
274 $(MAKE) $(MFLAGS) -C ../lib-src cleanall
\r
275 $(MAKE) $(MFLAGS) -C ../src cleanall
\r
277 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
\r
279 - $(DEL_TREE) obj-spd
\r
281 - $(DEL_TREE) oo-spd
\r
283 realclean: cleanall
\r
284 - $(DEL_TREE) ../bin
\r