]> code.delx.au - gnu-emacs/blob - nt/makefile.nt
Use icons/gnu2a32.ico as the default icon.
[gnu-emacs] / nt / makefile.nt
1 #
2 # Top level makefile for building GNU Emacs on Windows NT
3 #
4 # This file is part of GNU Emacs.
5 #
6 # GNU Emacs is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10 #
11 # GNU Emacs is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Emacs; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
20 #
21 # Geoff Voelker (voelker@cs.washington.edu) 11-20-93
22 # 9-6-94
23 !include makefile.def
24
25 ALL = addpm ddeclient runemacs cmdproxy addsection
26 !if $(MSVCNT11)
27 TRES = $(BLD)\emacs.res
28 !else
29 TRES = $(BLD)\emacs.rbj
30 !endif
31
32 !IF ($(_NMAKE_VER) == $(_NMAKE_VER_4))
33 .c{$(BLD)}.obj:
34 $(CC) $(CFLAGS) -Fo$(OBJDIR)\i386\ $<
35 !ELSE
36 .c{$(BLD)}.obj::
37 $(CC) $(CFLAGS) -Fo$(OBJDIR)\i386\ $<
38 !ENDIF
39
40 addpm: $(BLD) $(BLD)\addpm.exe
41 $(BLD)\addpm.obj: addpm.c
42 $(BLD)\addpm.exe: $(BLD)\addpm.obj
43 $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \
44 $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib
45
46 ddeclient: $(BLD) $(BLD)\ddeclient.exe
47 $(BLD)\ddeclient.obj: ddeclient.c
48 $(BLD)\ddeclient.exe: $(BLD)\ddeclient.obj
49 $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \
50 $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib
51
52 cmdproxy: $(BLD) $(BLD)\cmdproxy.exe
53 $(BLD)\cmdproxy.obj: cmdproxy.c
54 $(BLD)\cmdproxy.exe: $(BLD)\cmdproxy.obj
55 $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \
56 $(SYS_LDFLAGS) $** $(BASE_LIBS) user32.lib
57
58 addsection: $(BLD) $(BLD)\addsection.exe
59 $(BLD)\addsection.obj: addsection.c
60 $(BLD)\addsection.exe: $(BLD)\addsection.obj
61 $(LINK) -debug:full -out:$@ -subsystem:console -entry:mainCRTStartup \
62 $(SYS_LDFLAGS) $** $(BASE_LIBS) user32.lib
63
64 #
65 # The resource file. NT 3.10 requires the use of cvtres; even though
66 # it is not necessary on later versions, it is still ok to use it.
67 #
68 $(TRES): emacs.rc
69 $(RC) -Fo$(BLD)\emacs.res $**
70 !if !$(MSVCNT11)
71 $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res
72 !endif
73
74 runemacs: $(BLD) $(BLD)\runemacs.exe
75 $(BLD)\runemacs.obj: runemacs.c
76 $(BLD)\runemacs.exe: $(BLD)\runemacs.obj $(TRES)
77 $(LINK) -out:$@ -subsystem:windows -entry:WinMainCRTStartup \
78 $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib
79
80 # Since Windows 95 does not support multiple commands on one command line
81 # (e.g., in for loops), we cannot use for loops any more.
82 # SUBDIRS = lib-src src lisp
83
84 #
85 # Build emacs
86 #
87 BUILD_CMD = $(MAKE) -f makefile.nt all
88 all: $(BLD) $(ALL)
89 cd ..\lib-src
90 $(BUILD_CMD)
91 cd ..\src
92 $(BUILD_CMD)
93 cd ..\lisp
94 $(BUILD_CMD)
95 cd ..\nt
96
97 $(INSTALL_DIR)\bin:
98 - mkdir $(INSTALL_DIR)\bin
99
100 $(INSTALL_DIR)\bin\emacs.bat: emacs.bat.in
101 echo @echo off > $@
102 echo REM !!! Warning: This file automatically generated !!! >> emacs.bat
103 echo set emacs_dir=$(INSTALL_DIR)>> $@
104 type emacs.bat.in >> $@
105
106 $(INSTALL_DIR)\bin\debug.bat: debug.bat.in
107 echo @echo off > $@
108 echo REM !!! Warning: This file automatically generated !!! >> debug.bat
109 echo set emacs_dir=$(INSTALL_DIR)>> $@
110 type debug.bat.in >> $@
111
112 batch_files: $(INSTALL_DIR)\bin \
113 $(INSTALL_DIR)\bin\emacs.bat \
114 $(INSTALL_DIR)\bin\debug.bat
115
116 #
117 # Build and install emacs in INSTALL_DIR
118 #
119 INSTALL_CMD = $(MAKE) -f makefile.nt install
120 install: all batch_files
121 - mkdir $(INSTALL_DIR)
122 cd ..\lib-src
123 $(INSTALL_CMD)
124 cd ..\src
125 $(INSTALL_CMD)
126 cd ..\lisp
127 $(INSTALL_CMD)
128 cd ..\nt
129 - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin
130 - $(CP) $(BLD)\ddeclient.exe $(INSTALL_DIR)\bin
131 - $(CP) $(BLD)\cmdproxy.exe $(INSTALL_DIR)\bin
132 - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin
133 - $(CP) ..\lib-src\fns-*.el $(INSTALL_DIR)\bin
134 - $(ADDPM) $(INSTALL_DIR)
135 - $(DEL) ..\same-dir.tst
136 - $(DEL) $(INSTALL_DIR)\same-dir.tst
137 - mkdir $(INSTALL_DIR)\etc\icons
138 - $(CP_DIR) icons $(INSTALL_DIR)\etc\icons
139 echo SameDirTest > $(INSTALL_DIR)\same-dir.tst
140 if not exist ..\same-dir.tst $(MAKE) -f makefile.nt real_install
141 - $(DEL) ..\same-dir.tst
142 - $(DEL) $(INSTALL_DIR)\same-dir.tst
143
144 #
145 # This installs executables from ..\bin into the installation directory
146 # without building anything.
147 #
148 fast_install: batch_files
149 - mkdir $(INSTALL_DIR)\data
150 $(CP) ..\lib-src\DOC $(INSTALL_DIR)\etc
151 - mkdir $(INSTALL_DIR)\bin
152 - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin
153 - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin
154 - $(DEL) ..\same-dir.tst
155 - $(DEL) $(INSTALL_DIR)\same-dir.tst
156 echo SameDirTest > $(INSTALL_DIR)\same-dir.tst
157 if not exist ..\same-dir.tst $(CP) ..\bin\emacs.exe $(INSTALL_DIR)\bin
158 if not exist ..\same-dir.tst $(CP) ..\bin\etags.exe $(INSTALL_DIR)\bin
159 if not exist ..\same-dir.tst $(CP) ..\bin\ctags.exe $(INSTALL_DIR)\bin
160 if not exist ..\same-dir.tst nmake -f $(MAKE) real_install
161 - $(DEL) ..\same-dir.tst
162 - $(DEL) $(INSTALL_DIR)\same-dir.tst
163
164 real_install:
165 - $(DEL) ..\same-dir.tst
166 - $(DEL) $(INSTALL_DIR)\same-dir.tst
167 echo SameDirTest > $(INSTALL_DIR)\same-dir.tst
168 - mkdir $(INSTALL_DIR)\etc
169 - mkdir $(INSTALL_DIR)\info
170 - mkdir $(INSTALL_DIR)\lock
171 - mkdir $(INSTALL_DIR)\data
172 - mkdir $(INSTALL_DIR)\site-lisp
173 - mkdir $(INSTALL_DIR)\etc\icons
174 - $(CP_DIR) icons $(INSTALL_DIR)\etc\icons
175 if not exist ..\same-dir.tst $(CP_DIR) ..\etc $(INSTALL_DIR)\etc
176 if not exist ..\same-dir.tst $(CP_DIR) ..\info $(INSTALL_DIR)\info
177 - $(DEL) ..\same-dir.tst
178 - $(DEL) $(INSTALL_DIR)\same-dir.tst
179
180 #
181 # Maintenance
182 #
183 CLEAN_CMD = $(MAKE) -f makefile.nt clean
184 clean:; - $(DEL) *~ *.pdb
185 - $(DEL) *.orig
186 - $(DEL) *.rej
187 - $(DEL) *.crlf
188 - $(DEL_TREE) deleted
189 - $(DEL_TREE) obj
190 - $(DEL_TREE) obj-spd
191 - $(DEL_TREE) ..\bin
192 - $(DEL) ..\etc\DOC ..\etc\DOC-X
193 - $(DEL) emacs.bat
194 - $(DEL) debug.bat
195 cd ..\lib-src
196 $(CLEAN_CMD)
197 cd ..\src
198 $(CLEAN_CMD)
199 cd ..\lisp
200 $(CLEAN_CMD)
201 cd ..\nt