New directory
[bpt/emacs.git] / nt / makefile.w32-in
CommitLineData
8af54a64
AI
1# Makefile for GNU Emacs on the Microsoft W32 API.\r
2# Copyright (c) 2000-2001 Free Software Foundation, Inc.\r
3#\r
4# Top level makefile for building GNU Emacs on Windows NT\r
5#\r
6# This file is part of GNU Emacs.\r
177c0ea7 7#\r
8af54a64
AI
8# GNU Emacs is free software; you can redistribute it and/or modify\r
9# it under the terms of the GNU General Public License as published by\r
10# the Free Software Foundation; either version 2, or (at your option)\r
11# any later version.\r
177c0ea7 12#\r
8af54a64
AI
13# GNU Emacs is distributed in the hope that it will be useful,\r
14# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
16# GNU General Public License for more details.\r
177c0ea7 17#\r
8af54a64
AI
18# You should have received a copy of the GNU General Public License\r
19# along with GNU Emacs; see the file COPYING. If not, write to\r
20# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
21# Boston, MA 02111-1307, USA.\r
22\r
23ALL = addpm ddeclient runemacs cmdproxy addsection preprep\r
24\r
25.PHONY: $(ALL)\r
26\r
27TRES = $(BLD)/emacs.res\r
28\r
29addpm: $(BLD) $(BLD)/addpm.exe\r
30$(BLD)/addpm.exe: $(BLD)/addpm.$(O)\r
31 $(LINK) $(LINK_OUT)$@ \\r
32 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r
33\r
34ddeclient: $(BLD) $(BLD)/ddeclient.exe\r
35$(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)\r
36 $(LINK) $(LINK_OUT)$@ \\r
37 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r
38\r
39cmdproxy: $(BLD) $(BLD)/cmdproxy.exe\r
40$(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)\r
41 $(LINK) $(LINK_OUT)$@ \\r
42 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)\r
43\r
44addsection: $(BLD) $(BLD)/addsection.exe\r
45$(BLD)/addsection.exe: $(BLD)/addsection.$(O)\r
46 $(LINK) $(LINK_OUT)$@ \\r
47 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)\r
48\r
49preprep: $(BLD) $(BLD)/preprep.exe\r
50$(BLD)/preprep.exe: $(BLD)/preprep.$(O)\r
51 $(LINK) $(LINK_OUT)$@ \\r
52 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)\r
53\r
54#\r
55# The resource file. NT 3.10 requires the use of cvtres; even though\r
56# it is not necessary on later versions, it is still ok to use it.\r
57#\r
58$(TRES): emacs.rc\r
59 $(RC) $(RC_OUT)$(BLD)/emacs.res $(ALL_DEPS)\r
60\r
61runemacs: $(BLD) $(BLD)/runemacs.exe\r
62$(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)\r
63 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \\r
64 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r
65\r
66which-sh:\r
67 @echo Using $(THE_SHELL) as shell.\r
68\r
69#\r
70# Build emacs\r
71#\r
c3c57777 72all: which-sh $(BLD) $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)\r
8af54a64
AI
73\r
74all-other-dirs-nmake:\r
75 cd ..\lib-src\r
76 $(MAKE) $(MFLAGS) all\r
77 cd ..\src\r
78 $(MAKE) $(MFLAGS) all\r
79 cd ..\lisp\r
80 $(MAKE) $(MFLAGS) all\r
81 cd ..\leim\r
82 $(MAKE) $(MFLAGS) all\r
83 cd ..\nt\r
84\r
85all-other-dirs-gmake:\r
86 $(MAKE) $(MFLAGS) -C ../lib-src all\r
87 $(MAKE) $(MFLAGS) -C ../src all\r
88 $(MAKE) $(MFLAGS) -C ../lisp all\r
89 $(MAKE) $(MFLAGS) -C ../leim all\r
90\r
91recompile: recompile-$(MAKETYPE)\r
92\r
93recompile-nmake:\r
94 cd ..\lisp\r
95 $(MAKE) $(MFLAGS) recompile\r
96 cd ..\nt\r
97\r
98recompile-gmake:\r
99 $(MAKE) $(MFLAGS) -C ../lisp recompile\r
100\r
101#### Bootstrapping.\r
102\r
103### This is meant for Emacs maintainers only. It first cleans the\r
104### lisp subdirectory, removing all compiled Lisp files. Then a\r
105### special emacs executable is built from Lisp sources, which is then\r
106### used to compile Lisp files. The last step is a "normal" make.\r
107\r
c3c57777
JR
108maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)\r
109\r
110# dummy target to force other targets to be evaluated.\r
111doit:\r
112\r
113maybe-bootstrap-CMD: doit\r
114 @echo.\r
115 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either\r
116 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow\r
117 @echo.\r
118 @if not EXIST ..\lisp\abbrev.elc exit -1\r
119\r
120maybe-bootstrap-SH: doit\r
121 @if [ ! -f ../lisp/abbrev.elc ] ; then \\r
122 echo; \\r
123 echo "Essential Lisp files seem to be missing. You should either"; \\r
124 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \\r
125 echo; \\r
126 exit -1; \\r
127 fi\r
128\r
0e4435be 129bootstrap: addsection bootstrap-$(MAKETYPE) all\r
8af54a64
AI
130\r
131bootstrap-nmake:\r
132 cd ..\lisp\r
133 $(MAKE) $(MFLAGS) bootstrap-clean\r
134 cd ..\src\r
135 $(MAKE) $(MFLAGS) clean\r
136 cd ..\lib-src\r
dc728514 137 $(MAKE) $(MFLAGS) clean\r
8af54a64
AI
138 cd ..\src\r
139 $(MAKE) $(MFLAGS) bootstrap\r
140 $(MAKE) $(MFLAGS) bootstrap-clean\r
141 cd ..\lisp\r
142 $(MAKE) $(MFLAGS) bootstrap\r
dc728514
JB
143 cd ..\lib-src\r
144 $(MAKE) $(MFLAGS) DOC\r
8af54a64
AI
145 cd ..\nt\r
146\r
147bootstrap-gmake:\r
148 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean\r
149 $(MAKE) $(MFLAGS) -C ../src clean\r
dc728514 150 $(MAKE) $(MFLAGS) -C ../lib-src clean\r
8af54a64
AI
151 $(MAKE) $(MFLAGS) -C ../src bootstrap\r
152 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean\r
153 $(MAKE) $(MFLAGS) -C ../lisp bootstrap\r
dc728514 154 $(MAKE) $(MFLAGS) -C ../lib-src DOC\r
8af54a64
AI
155\r
156bootstrap-clean: bootstrap-clean-$(MAKETYPE)\r
157\r
158bootstrap-clean-nmake:\r
159 cd ..\src\r
160 $(MAKE) $(MFLAGS) bootstrap-clean\r
161 cd ..\lisp\r
162 $(MAKE) $(MFLAGS) bootstrap-clean\r
163\r
164bootstrap-clean-gmake:\r
165 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean\r
166 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean\r
167\r
168$(INSTALL_DIR):\r
169 - mkdir "$(INSTALL_DIR)"\r
170\r
171$(INSTALL_DIR)/bin: $(INSTALL_DIR)\r
172 - mkdir "$(INSTALL_DIR)/bin"\r
173\r
174#\r
175# Build and install emacs in INSTALL_DIR\r
176#\r
177install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)\r
178 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin\r
179 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin\r
180 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin\r
181 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin\r
182 - $(CP) ../lib-src/fns-*.el $(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
199\r
200install-other-dirs-nmake:\r
201 cd ..\lib-src\r
202 $(MAKE) $(MFLAGS) install\r
203 cd ..\src\r
204 $(MAKE) $(MFLAGS) install\r
205 cd ..\lisp\r
206 $(MAKE) $(MFLAGS) install\r
207 cd ..\leim\r
208 $(MAKE) $(MFLAGS) install\r
209 cd ..\nt\r
210\r
211install-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
216\r
217#\r
218# Maintenance\r
177c0ea7 219#\r
8af54a64
AI
220clean: clean-other-dirs-$(MAKETYPE)\r
221 - $(DEL) *~ $(COMPILER_TEMP_FILES)\r
222 - $(DEL_TREE) $(OBJDIR)\r
223 - $(DEL) ../etc/DOC ../etc/DOC-X\r
224\r
225clean-other-dirs-nmake:\r
226 cd ..\lib-src\r
227 $(MAKE) $(MFLAGS) clean\r
228 cd ..\src\r
229 $(MAKE) $(MFLAGS) clean\r
230 cd ..\lisp\r
231 $(MAKE) $(MFLAGS) clean\r
232 cd ..\leim\r
233 $(MAKE) $(MFLAGS) clean\r
234 cd ..\nt\r
235\r
236clean-other-dirs-gmake:\r
237 $(MAKE) $(MFLAGS) -C ../lib-src clean\r
238 $(MAKE) $(MFLAGS) -C ../src clean\r
239 $(MAKE) $(MFLAGS) -C ../lisp clean\r
240 $(MAKE) $(MFLAGS) -C ../leim clean\r
241\r
242cleanall-other-dirs-nmake:\r
243 cd ..\lib-src\r
244 $(MAKE) $(MFLAGS) cleanall\r
245 cd ..\src\r
246 $(MAKE) $(MFLAGS) cleanall\r
247 cd ..\nt\r
248\r
249cleanall-other-dirs-gmake:\r
250 $(MAKE) $(MFLAGS) -C ../lib-src cleanall\r
251 $(MAKE) $(MFLAGS) -C ../src cleanall\r
252\r
253cleanall: clean cleanall-other-dirs-$(MAKETYPE)\r
254 - $(DEL_TREE) obj\r
255 - $(DEL_TREE) obj-spd\r
256 - $(DEL_TREE) oo\r
257 - $(DEL_TREE) oo-spd\r
258\r
259realclean: cleanall\r
260 - $(DEL_TREE) ../bin\r