Commit | Line | Data |
---|---|---|
bd6766d3 | 1 | # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.\r |
b65d8176 | 2 | # Copyright (C) 2000, 2001, 2002, 2003, 2004,\r |
ceb4c4d3 | 3 | # 2005, 2006 Free Software Foundation, Inc.\r |
8af54a64 AI |
4 | #\r |
5 | # Top level makefile for building GNU Emacs on Windows NT\r | |
6 | #\r | |
7 | # This file is part of GNU Emacs.\r | |
177c0ea7 | 8 | #\r |
8af54a64 AI |
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 | |
177c0ea7 | 13 | #\r |
8af54a64 AI |
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 | |
177c0ea7 | 18 | #\r |
8af54a64 AI |
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 | |
364c38d3 LK |
21 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\r |
22 | # Boston, MA 02110-1301, USA.\r | |
8af54a64 AI |
23 | \r |
24 | ALL = addpm ddeclient runemacs cmdproxy addsection preprep\r | |
25 | \r | |
26 | .PHONY: $(ALL)\r | |
27 | \r | |
28 | TRES = $(BLD)/emacs.res\r | |
29 | \r | |
b47342e3 EZ |
30 | XMFLAGS =\r |
31 | \r | |
32 | addpm: stamp_BLD $(BLD)/addpm.exe\r | |
8af54a64 AI |
33 | $(BLD)/addpm.exe: $(BLD)/addpm.$(O)\r |
34 | $(LINK) $(LINK_OUT)$@ \\r | |
35 | $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r | |
36 | \r | |
b47342e3 | 37 | ddeclient: stamp_BLD $(BLD)/ddeclient.exe\r |
8af54a64 AI |
38 | $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)\r |
39 | $(LINK) $(LINK_OUT)$@ \\r | |
40 | $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r | |
41 | \r | |
b47342e3 | 42 | cmdproxy: stamp_BLD $(BLD)/cmdproxy.exe\r |
8af54a64 AI |
43 | $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)\r |
44 | $(LINK) $(LINK_OUT)$@ \\r | |
45 | $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)\r | |
46 | \r | |
b47342e3 | 47 | addsection: stamp_BLD $(BLD)/addsection.exe\r |
8af54a64 AI |
48 | $(BLD)/addsection.exe: $(BLD)/addsection.$(O)\r |
49 | $(LINK) $(LINK_OUT)$@ \\r | |
50 | $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)\r | |
51 | \r | |
b47342e3 | 52 | preprep: stamp_BLD $(BLD)/preprep.exe\r |
8af54a64 AI |
53 | $(BLD)/preprep.exe: $(BLD)/preprep.$(O)\r |
54 | $(LINK) $(LINK_OUT)$@ \\r | |
55 | $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)\r | |
56 | \r | |
57 | #\r | |
58 | # The resource file. NT 3.10 requires the use of cvtres; even though\r | |
59 | # it is not necessary on later versions, it is still ok to use it.\r | |
60 | #\r | |
b47342e3 | 61 | $(TRES): emacs.rc stamp_BLD\r |
32d0013e | 62 | $(RC) $(RC_OUT)$(BLD)/emacs.res $<\r |
8af54a64 | 63 | \r |
b47342e3 | 64 | runemacs: stamp_BLD $(BLD)/runemacs.exe\r |
8af54a64 AI |
65 | $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)\r |
66 | $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \\r | |
67 | $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r | |
68 | \r | |
69 | which-sh:\r | |
70 | @echo Using $(THE_SHELL) as shell.\r | |
71 | \r | |
b47342e3 EZ |
72 | # These depend on stamp_BLD to make sure the $(BLD) directory is created\r |
73 | # before the compilation begins, even if Make runs several commands\r | |
74 | # in parallel under "make -j".\r | |
75 | #\r | |
76 | $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD\r | |
32d0013e | 77 | \r |
8af54a64 AI |
78 | #\r |
79 | # Build emacs\r | |
80 | #\r | |
b47342e3 | 81 | all: which-sh stamp_BLD $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)\r |
8af54a64 | 82 | \r |
32d0013e | 83 | all-other-dirs-nmake: addsection\r |
8af54a64 | 84 | cd ..\lib-src\r |
b47342e3 | 85 | $(MAKE) $(MFLAGS) $(XMFLAGS) all\r |
8af54a64 | 86 | cd ..\src\r |
b47342e3 | 87 | $(MAKE) $(MFLAGS) $(XMFLAGS) all\r |
8af54a64 | 88 | cd ..\lisp\r |
b47342e3 | 89 | $(MAKE) $(MFLAGS) $(XMFLAGS) all\r |
8af54a64 | 90 | cd ..\leim\r |
b47342e3 | 91 | $(MAKE) $(MFLAGS) $(XMFLAGS) all\r |
8af54a64 AI |
92 | cd ..\nt\r |
93 | \r | |
32d0013e | 94 | all-other-dirs-gmake: addsection\r |
b47342e3 EZ |
95 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all\r |
96 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all\r | |
97 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all\r | |
98 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all\r | |
8af54a64 AI |
99 | \r |
100 | recompile: recompile-$(MAKETYPE)\r | |
101 | \r | |
102 | recompile-nmake:\r | |
103 | cd ..\lisp\r | |
b47342e3 | 104 | $(MAKE) $(MFLAGS) $(XMFLAGS) recompile\r |
8af54a64 AI |
105 | cd ..\nt\r |
106 | \r | |
107 | recompile-gmake:\r | |
b47342e3 | 108 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile\r |
8af54a64 AI |
109 | \r |
110 | #### Bootstrapping.\r | |
111 | \r | |
112 | ### This is meant for Emacs maintainers only. It first cleans the\r | |
113 | ### lisp subdirectory, removing all compiled Lisp files. Then a\r | |
114 | ### special emacs executable is built from Lisp sources, which is then\r | |
115 | ### used to compile Lisp files. The last step is a "normal" make.\r | |
116 | \r | |
c3c57777 JR |
117 | maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)\r |
118 | \r | |
119 | # dummy target to force other targets to be evaluated.\r | |
120 | doit:\r | |
121 | \r | |
122 | maybe-bootstrap-CMD: doit\r | |
d5ef6196 | 123 | @echo .\r |
c3c57777 JR |
124 | @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either\r |
125 | @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow\r | |
d5ef6196 | 126 | @echo .\r |
c3c57777 JR |
127 | @if not EXIST ..\lisp\abbrev.elc exit -1\r |
128 | \r | |
129 | maybe-bootstrap-SH: doit\r | |
130 | @if [ ! -f ../lisp/abbrev.elc ] ; then \\r | |
131 | echo; \\r | |
132 | echo "Essential Lisp files seem to be missing. You should either"; \\r | |
133 | echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \\r | |
134 | echo; \\r | |
135 | exit -1; \\r | |
136 | fi\r | |
137 | \r | |
0e4435be | 138 | bootstrap: addsection bootstrap-$(MAKETYPE) all\r |
8af54a64 | 139 | \r |
32d0013e | 140 | bootstrap-nmake: addsection\r |
8af54a64 AI |
141 | cd ..\lisp\r |
142 | $(MAKE) $(MFLAGS) bootstrap-clean\r | |
143 | cd ..\src\r | |
144 | $(MAKE) $(MFLAGS) clean\r | |
145 | cd ..\lib-src\r | |
dc728514 | 146 | $(MAKE) $(MFLAGS) clean\r |
8af54a64 AI |
147 | cd ..\src\r |
148 | $(MAKE) $(MFLAGS) bootstrap\r | |
149 | $(MAKE) $(MFLAGS) bootstrap-clean\r | |
150 | cd ..\lisp\r | |
73dfa0bf | 151 | $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap\r |
dc728514 JB |
152 | cd ..\lib-src\r |
153 | $(MAKE) $(MFLAGS) DOC\r | |
8af54a64 AI |
154 | cd ..\nt\r |
155 | \r | |
32d0013e | 156 | bootstrap-gmake: addsection\r |
b47342e3 EZ |
157 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean\r |
158 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean\r | |
159 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean\r | |
01b3b0dd | 160 | $(MAKE) $(MFLAGS) $(XMFLAGS) XMFLAGS="$(XMFLAGS)" -C ../src bootstrap\r |
b47342e3 EZ |
161 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean\r |
162 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap\r | |
163 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC\r | |
8af54a64 AI |
164 | \r |
165 | bootstrap-clean: bootstrap-clean-$(MAKETYPE)\r | |
166 | \r | |
167 | bootstrap-clean-nmake:\r | |
168 | cd ..\src\r | |
169 | $(MAKE) $(MFLAGS) bootstrap-clean\r | |
170 | cd ..\lisp\r | |
171 | $(MAKE) $(MFLAGS) bootstrap-clean\r | |
172 | \r | |
173 | bootstrap-clean-gmake:\r | |
b47342e3 EZ |
174 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean\r |
175 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean\r | |
8af54a64 AI |
176 | \r |
177 | $(INSTALL_DIR):\r | |
178 | - mkdir "$(INSTALL_DIR)"\r | |
179 | \r | |
180 | $(INSTALL_DIR)/bin: $(INSTALL_DIR)\r | |
181 | - mkdir "$(INSTALL_DIR)/bin"\r | |
182 | \r | |
183 | #\r | |
184 | # Build and install emacs in INSTALL_DIR\r | |
185 | #\r | |
186 | install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)\r | |
187 | - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin\r | |
188 | - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin\r | |
189 | - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin\r | |
190 | - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin\r | |
f8985061 | 191 | - "$(INSTALL_DIR)/bin/addpm" -q\r |
8af54a64 AI |
192 | - $(DEL) ../same-dir.tst\r |
193 | - $(DEL) $(INSTALL_DIR)/same-dir.tst\r | |
194 | echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"\r | |
195 | - mkdir "$(INSTALL_DIR)/etc"\r | |
196 | - mkdir "$(INSTALL_DIR)/info"\r | |
197 | - mkdir "$(INSTALL_DIR)/lock"\r | |
198 | - mkdir "$(INSTALL_DIR)/data"\r | |
199 | - mkdir "$(INSTALL_DIR)/site-lisp"\r | |
200 | - mkdir "$(INSTALL_DIR)/etc/icons"\r | |
201 | $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)\r | |
202 | $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)\r | |
203 | - $(CP_DIR) icons $(INSTALL_DIR)/etc\r | |
204 | $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)\r | |
205 | - $(DEL) ../same-dir.tst\r | |
206 | - $(DEL) $(INSTALL_DIR)/same-dir.tst\r | |
207 | \r | |
208 | install-other-dirs-nmake:\r | |
209 | cd ..\lib-src\r | |
210 | $(MAKE) $(MFLAGS) install\r | |
211 | cd ..\src\r | |
212 | $(MAKE) $(MFLAGS) install\r | |
213 | cd ..\lisp\r | |
214 | $(MAKE) $(MFLAGS) install\r | |
215 | cd ..\leim\r | |
216 | $(MAKE) $(MFLAGS) install\r | |
217 | cd ..\nt\r | |
218 | \r | |
219 | install-other-dirs-gmake:\r | |
b47342e3 EZ |
220 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install\r |
221 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install\r | |
222 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install\r | |
223 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install\r | |
8af54a64 | 224 | \r |
fd1f2f1e JR |
225 | force-info:\r |
226 | # Note that man/makefile knows how to\r | |
227 | # put the info files in $(infodir),\r | |
228 | # so we can do ok running make in the build dir.\r | |
5eb3d2a5 JR |
229 | info: force-info info-$(MAKETYPE)\r |
230 | \r | |
231 | info-nmake:\r | |
232 | cd ..\man\r | |
233 | $(MAKE) $(MFLAGS) info\r | |
234 | cd ..\lispref\r | |
235 | $(MAKE) $(MFLAGS) info\r | |
236 | cd ..\lispintro\r | |
237 | $(MAKE) $(MFLAGS) info\r | |
238 | \r | |
239 | info-gmake:\r | |
b47342e3 EZ |
240 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../man info\r |
241 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispref info\r | |
242 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lispintro info\r | |
8af54a64 AI |
243 | #\r |
244 | # Maintenance\r | |
177c0ea7 | 245 | #\r |
8af54a64 AI |
246 | clean: clean-other-dirs-$(MAKETYPE)\r |
247 | - $(DEL) *~ $(COMPILER_TEMP_FILES)\r | |
248 | - $(DEL_TREE) $(OBJDIR)\r | |
249 | - $(DEL) ../etc/DOC ../etc/DOC-X\r | |
250 | \r | |
251 | clean-other-dirs-nmake:\r | |
252 | cd ..\lib-src\r | |
253 | $(MAKE) $(MFLAGS) clean\r | |
254 | cd ..\src\r | |
255 | $(MAKE) $(MFLAGS) clean\r | |
256 | cd ..\lisp\r | |
257 | $(MAKE) $(MFLAGS) clean\r | |
fd1f2f1e JR |
258 | cd ..\lispintro\r |
259 | $(MAKE) $(MFLAGS) clean\r | |
260 | cd ..\lispref\r | |
261 | $(MAKE) $(MFLAGS) clean\r | |
8af54a64 AI |
262 | cd ..\leim\r |
263 | $(MAKE) $(MFLAGS) clean\r | |
fd1f2f1e JR |
264 | cd ..\man\r |
265 | $(MAKE) $(MFLAGS) clean\r | |
8af54a64 AI |
266 | cd ..\nt\r |
267 | \r | |
268 | clean-other-dirs-gmake:\r | |
b47342e3 EZ |
269 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean\r |
270 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean\r | |
271 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp clean\r | |
272 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean\r | |
8af54a64 AI |
273 | \r |
274 | cleanall-other-dirs-nmake:\r | |
275 | cd ..\lib-src\r | |
276 | $(MAKE) $(MFLAGS) cleanall\r | |
277 | cd ..\src\r | |
278 | $(MAKE) $(MFLAGS) cleanall\r | |
279 | cd ..\nt\r | |
280 | \r | |
281 | cleanall-other-dirs-gmake:\r | |
b47342e3 EZ |
282 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall\r |
283 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall\r | |
8af54a64 AI |
284 | \r |
285 | cleanall: clean cleanall-other-dirs-$(MAKETYPE)\r | |
286 | - $(DEL_TREE) obj\r | |
287 | - $(DEL_TREE) obj-spd\r | |
288 | - $(DEL_TREE) oo\r | |
289 | - $(DEL_TREE) oo-spd\r | |
290 | \r | |
291 | realclean: cleanall\r | |
292 | - $(DEL_TREE) ../bin\r |