Commit | Line | Data |
---|---|---|
efdeeb2b GV |
1 | # |
2 | # Makefile definition file for building GNU Emacs on Windows NT | |
3 | # | |
4 | # GNU Emacs is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2, or (at your option) | |
7 | # any later version. | |
8 | # | |
9 | # GNU Emacs is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with GNU Emacs; see the file COPYING. If not, write to | |
bf2b146b EN |
16 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | # Boston, MA 02111-1307, USA. | |
efdeeb2b GV |
18 | # |
19 | # Geoff Voelker (voelker@cs.washington.edu) 9-6-94 | |
20 | ||
21 | # | |
22 | # BEGIN CONFIGURATION | |
23 | # | |
24 | ||
0492cf29 GV |
25 | # Define the following to build the GUI version |
26 | # | |
27 | NTGUI=1 | |
28 | ||
43648015 | 29 | # Set INSTALL_DIR to be the directory into which you want emacs installed. |
efdeeb2b | 30 | # |
43648015 GV |
31 | !ifndef INSTALL_DIR |
32 | INSTALL_DIR = C:\emacs | |
33 | !endif | |
efdeeb2b | 34 | |
d51bca10 RS |
35 | # Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment. |
36 | # MSVCNT11 = 1 | |
d7a4f4fe | 37 | !ifndef MSVCNT11 |
d51bca10 | 38 | MSVCNT11 = 0 |
d7a4f4fe | 39 | !endif |
d51bca10 | 40 | |
efdeeb2b GV |
41 | # |
42 | # END CONFIGURATION | |
43 | # | |
43648015 | 44 | |
ec465548 GV |
45 | # |
46 | # Allow detection of builds with MSVC 5 or later | |
47 | # | |
48 | _NMAKE_VER_5=162 | |
49 | _NMAKE_VER_4=0 | |
50 | ||
51 | !IFNDEF _NMAKE_VER | |
52 | _NMAKE_VER=$(_NMAKE_VER_4) | |
53 | !ENDIF | |
54 | ||
43648015 GV |
55 | # Check that the INCLUDE and LIB environment variables are set. |
56 | # | |
57 | !ifndef INCLUDE | |
58 | !error The INCLUDE environment variable needs to be set. | |
59 | !endif | |
60 | !ifndef LIB | |
61 | !error The LIB environment variable needs to be set. | |
62 | !endif | |
63 | ||
64 | # Determine the architecture we're running on. | |
65 | # Define ARCH for our purposes; | |
66 | # Define CPU for use by ntwin32.mak; | |
67 | # Define CONFIG_H to the appropriate config.h for the system; | |
efdeeb2b | 68 | # |
43648015 GV |
69 | !ifdef PROCESSOR_ARCHITECTURE |
70 | # We're on Windows NT | |
71 | CPU = $(PROCESSOR_ARCHITECTURE) | |
72 | CONFIG_H = config.nt | |
27493233 | 73 | OS_TYPE = windowsnt |
43648015 GV |
74 | ! if "$(PROCESSOR_ARCHITECTURE)" == "x86" |
75 | ARCH = i386 | |
76 | CPU = i386 | |
77 | ! else | |
78 | ! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" | |
79 | ARCH = mips | |
80 | ! else | |
81 | ! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" | |
82 | ARCH = alpha | |
83 | ! else | |
84 | ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC" | |
85 | ARCH = ppc | |
86 | ! else | |
87 | !error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" | |
88 | ! endif | |
89 | ! endif | |
90 | ! endif | |
91 | ! endif | |
92 | !else | |
93 | # We're on Windows 95 | |
94 | ARCH = i386 | |
95 | CPU = i386 | |
ff4fcfcd | 96 | CONFIG_H = config.nt |
27493233 | 97 | OS_TYPE = windows95 |
43648015 GV |
98 | !endif |
99 | ||
100 | # Include ntwin32.mak. So far, this file seems to be supported by every | |
27493233 | 101 | # Microsoft compiler on NT and Windows 95 and properly defines the executable |
43648015 GV |
102 | # names and libraries necessary to build Emacs. I do not have access |
103 | # to any other vendor compilers, so I do not know if they supply this | |
104 | # file, too. For now I'll assume that they do. | |
105 | # | |
106 | !include <ntwin32.mak> | |
efdeeb2b | 107 | |
43648015 GV |
108 | # Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms. |
109 | CVTRES = cvtres.exe | |
110 | AR = $(implib) | |
111 | # The assignment $(CC) = $(cc) fails even though variables are case sensitive. | |
112 | LINK_TMP = $(link) | |
113 | LINK = $(LINK_TMP) | |
114 | CC_TMP = $(cc) | |
115 | CC = $(CC_TMP) | |
116 | ||
117 | # advapi32.lib is left off of $(baselibs) on NT 3.10 | |
118 | !if "$(baselibs)" == "kernel32.lib " | |
119 | ADVAPI32 = advapi32.lib | |
120 | !else | |
121 | ADVAPI32 = | |
122 | !endif | |
123 | ||
124 | # Older ntwin32.mak files do not define libc; do it for them. | |
125 | !ifndef libc | |
126 | libc = libc.lib | |
127 | !endif | |
128 | ||
129 | # The base libraries for compiling Emacs on NT. With MSVC, this should | |
130 | # include oldnames.lib. | |
d51bca10 RS |
131 | !if $(MSVCNT11) |
132 | BASE_LIBS = $(libc) $(baselibs) oldnames.lib | |
133 | !else | |
d7a4f4fe | 134 | BASE_LIBS = $(libc) $(baselibs) -nodefaultlib:oldnames.lib |
d51bca10 | 135 | !endif |
43648015 GV |
136 | |
137 | # We want any debugging info in the executable. | |
138 | !if "$(LINK)" == "link32" | |
139 | SYS_LDFLAGS = | |
140 | !else | |
d7a4f4fe | 141 | SYS_LDFLAGS = -release -incremental:no -version:3.10 |
43648015 GV |
142 | !endif |
143 | ||
ec465548 GV |
144 | # Tag the executables to run out of the swapfile when execute off CD or network shares |
145 | SYS_LDFLAGS = $(SYS_LDFLAGS) -swaprun:cd -swaprun:net | |
146 | ||
43648015 | 147 | INC = -I. |
d7a4f4fe | 148 | !if "$(BUILD_TYPE)" == "spd" |
5f0fcedb | 149 | CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb |
d7a4f4fe | 150 | !else |
5f0fcedb | 151 | CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -DEMACSDEBUG |
d7a4f4fe | 152 | !endif |
d51bca10 RS |
153 | !if $(MSVCNT11) |
154 | CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl | |
155 | !else | |
5f0fcedb | 156 | CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl |
d51bca10 | 157 | !endif |
efdeeb2b | 158 | |
b5e9eb93 GV |
159 | !ifdef BUILD_TYPE |
160 | OBJDIR = obj-$(BUILD_TYPE) | |
161 | !else | |
efdeeb2b | 162 | OBJDIR = obj |
b5e9eb93 | 163 | !endif |
43648015 | 164 | $(OBJDIR):; -mkdir $(OBJDIR) |
efdeeb2b GV |
165 | BLD = $(OBJDIR)\$(ARCH) |
166 | $(BLD): $(OBJDIR) | |
167 | -mkdir $(BLD) | |
168 | ||
169 | CP = copy | |
0fc02397 | 170 | CP_DIR = xcopy /f/r/i/e/d/k |
efdeeb2b | 171 | |
27493233 | 172 | !if "$(OS_TYPE)" == "windows95" |
b2bc29b1 GV |
173 | DEL = deltree /y |
174 | DEL_TREE = deltree /y | |
175 | !else | |
176 | DEL = del | |
ec465548 GV |
177 | # NT better way of killing a deltree |
178 | DEL_TREE = rd /s/q | |
b2bc29b1 | 179 | !endif |
efdeeb2b | 180 | |
01b96d5c GV |
181 | # The location of the icon file |
182 | EMACS_ICON_PATH = ..\nt\emacs.ico | |
183 | ||
184 | # Lets us add icons to the GNU Emacs folder | |
185 | ADDPM = ..\nt\$(BLD)\addpm.exe | |
186 | ||
43648015 | 187 | !if "$(ARCH)" == "i386" |
b5e9eb93 | 188 | !if "$(BUILD_TYPE)" == "spd" |
ec465548 | 189 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G6dF -Zi -Zp8 |
b5e9eb93 | 190 | !else |
ebf8a96d | 191 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zi -Zp8 |
b5e9eb93 | 192 | !endif |
43648015 | 193 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) |
efdeeb2b | 194 | |
43648015 GV |
195 | !else |
196 | !if "$(ARCH)" == "mips" | |
197 | ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0 | |
198 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) | |
efdeeb2b | 199 | |
43648015 GV |
200 | !else |
201 | !if "$(ARCH)" == "alpha" | |
d7a4f4fe GV |
202 | !if "$(BUILD_TYPE)" == "spd" |
203 | ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl= | |
204 | !else | |
205 | ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl= | |
206 | !endif | |
43648015 GV |
207 | ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS) |
208 | ||
209 | !else | |
210 | !if "$(ARCH)" == "ppc" | |
211 | # These flags are a guess...if they don't work, please send me mail. | |
212 | ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od | |
213 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) | |
214 | ||
215 | !else | |
216 | !ERROR Unknown architecture type "$(ARCH)". | |
217 | !endif | |
218 | !endif | |
219 | !endif | |
220 | !endif | |
967c164c GV |
221 | |
222 | # | |
223 | # If the compiler supports compiling multiple .c files to .o files at | |
224 | # one time, use this feature. | |
225 | # | |
226 | !IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") | |
227 | .c{$(BLD)}.obj: | |
228 | $(CC) $(CFLAGS) -Fo$(BLD)\ $< | |
229 | !ELSE | |
230 | .c{$(BLD)}.obj:: | |
231 | $(CC) $(CFLAGS) -Fo$(BLD)\ $< | |
232 | !ENDIF |