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 GV |
44 | |
45 | # Check that the INCLUDE and LIB environment variables are set. | |
46 | # | |
47 | !ifndef INCLUDE | |
48 | !error The INCLUDE environment variable needs to be set. | |
49 | !endif | |
50 | !ifndef LIB | |
51 | !error The LIB environment variable needs to be set. | |
52 | !endif | |
53 | ||
54 | # Determine the architecture we're running on. | |
55 | # Define ARCH for our purposes; | |
56 | # Define CPU for use by ntwin32.mak; | |
57 | # Define CONFIG_H to the appropriate config.h for the system; | |
efdeeb2b | 58 | # |
43648015 GV |
59 | !ifdef PROCESSOR_ARCHITECTURE |
60 | # We're on Windows NT | |
61 | CPU = $(PROCESSOR_ARCHITECTURE) | |
62 | CONFIG_H = config.nt | |
27493233 | 63 | OS_TYPE = windowsnt |
43648015 GV |
64 | ! if "$(PROCESSOR_ARCHITECTURE)" == "x86" |
65 | ARCH = i386 | |
66 | CPU = i386 | |
67 | ! else | |
68 | ! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" | |
69 | ARCH = mips | |
70 | ! else | |
71 | ! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" | |
72 | ARCH = alpha | |
73 | ! else | |
74 | ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC" | |
75 | ARCH = ppc | |
76 | ! else | |
77 | !error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" | |
78 | ! endif | |
79 | ! endif | |
80 | ! endif | |
81 | ! endif | |
82 | !else | |
83 | # We're on Windows 95 | |
84 | ARCH = i386 | |
85 | CPU = i386 | |
ff4fcfcd | 86 | CONFIG_H = config.nt |
27493233 | 87 | OS_TYPE = windows95 |
43648015 GV |
88 | !endif |
89 | ||
90 | # Include ntwin32.mak. So far, this file seems to be supported by every | |
27493233 | 91 | # Microsoft compiler on NT and Windows 95 and properly defines the executable |
43648015 GV |
92 | # names and libraries necessary to build Emacs. I do not have access |
93 | # to any other vendor compilers, so I do not know if they supply this | |
94 | # file, too. For now I'll assume that they do. | |
95 | # | |
96 | !include <ntwin32.mak> | |
efdeeb2b | 97 | |
43648015 GV |
98 | # Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms. |
99 | CVTRES = cvtres.exe | |
100 | AR = $(implib) | |
101 | # The assignment $(CC) = $(cc) fails even though variables are case sensitive. | |
102 | LINK_TMP = $(link) | |
103 | LINK = $(LINK_TMP) | |
104 | CC_TMP = $(cc) | |
105 | CC = $(CC_TMP) | |
106 | ||
107 | # advapi32.lib is left off of $(baselibs) on NT 3.10 | |
108 | !if "$(baselibs)" == "kernel32.lib " | |
109 | ADVAPI32 = advapi32.lib | |
110 | !else | |
111 | ADVAPI32 = | |
112 | !endif | |
113 | ||
114 | # Older ntwin32.mak files do not define libc; do it for them. | |
115 | !ifndef libc | |
116 | libc = libc.lib | |
117 | !endif | |
118 | ||
119 | # The base libraries for compiling Emacs on NT. With MSVC, this should | |
120 | # include oldnames.lib. | |
d51bca10 RS |
121 | !if $(MSVCNT11) |
122 | BASE_LIBS = $(libc) $(baselibs) oldnames.lib | |
123 | !else | |
d7a4f4fe | 124 | BASE_LIBS = $(libc) $(baselibs) -nodefaultlib:oldnames.lib |
d51bca10 | 125 | !endif |
43648015 GV |
126 | |
127 | # We want any debugging info in the executable. | |
128 | !if "$(LINK)" == "link32" | |
129 | SYS_LDFLAGS = | |
130 | !else | |
d7a4f4fe | 131 | SYS_LDFLAGS = -release -incremental:no -version:3.10 |
43648015 GV |
132 | !endif |
133 | ||
134 | INC = -I. | |
d7a4f4fe | 135 | !if "$(BUILD_TYPE)" == "spd" |
5f0fcedb | 136 | CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb |
d7a4f4fe | 137 | !else |
5f0fcedb | 138 | CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -DEMACSDEBUG |
d7a4f4fe | 139 | !endif |
d51bca10 RS |
140 | !if $(MSVCNT11) |
141 | CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl | |
142 | !else | |
5f0fcedb | 143 | CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl |
d51bca10 | 144 | !endif |
efdeeb2b | 145 | |
b5e9eb93 GV |
146 | !ifdef BUILD_TYPE |
147 | OBJDIR = obj-$(BUILD_TYPE) | |
148 | !else | |
efdeeb2b | 149 | OBJDIR = obj |
b5e9eb93 | 150 | !endif |
43648015 | 151 | $(OBJDIR):; -mkdir $(OBJDIR) |
efdeeb2b GV |
152 | BLD = $(OBJDIR)\$(ARCH) |
153 | $(BLD): $(OBJDIR) | |
154 | -mkdir $(BLD) | |
155 | ||
156 | CP = copy | |
0fc02397 | 157 | CP_DIR = xcopy /f/r/i/e/d/k |
efdeeb2b | 158 | |
27493233 | 159 | !if "$(OS_TYPE)" == "windows95" |
b2bc29b1 GV |
160 | DEL = deltree /y |
161 | DEL_TREE = deltree /y | |
162 | !else | |
163 | DEL = del | |
efdeeb2b GV |
164 | # This is completely braindamaged, but it's the only routine known to be there |
165 | DEL_TREE = echo y | rmdir /s | |
b2bc29b1 | 166 | !endif |
efdeeb2b | 167 | |
01b96d5c GV |
168 | # The location of the icon file |
169 | EMACS_ICON_PATH = ..\nt\emacs.ico | |
170 | ||
171 | # Lets us add icons to the GNU Emacs folder | |
172 | ADDPM = ..\nt\$(BLD)\addpm.exe | |
173 | ||
43648015 | 174 | !if "$(ARCH)" == "i386" |
b5e9eb93 | 175 | !if "$(BUILD_TYPE)" == "spd" |
d7a4f4fe | 176 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G5dF -Zi |
b5e9eb93 | 177 | !else |
efdeeb2b | 178 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od |
b5e9eb93 | 179 | !endif |
43648015 | 180 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) |
efdeeb2b | 181 | |
43648015 GV |
182 | !else |
183 | !if "$(ARCH)" == "mips" | |
184 | ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0 | |
185 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) | |
efdeeb2b | 186 | |
43648015 GV |
187 | !else |
188 | !if "$(ARCH)" == "alpha" | |
d7a4f4fe GV |
189 | !if "$(BUILD_TYPE)" == "spd" |
190 | ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl= | |
191 | !else | |
192 | ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl= | |
193 | !endif | |
43648015 GV |
194 | ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS) |
195 | ||
196 | !else | |
197 | !if "$(ARCH)" == "ppc" | |
198 | # These flags are a guess...if they don't work, please send me mail. | |
199 | ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od | |
200 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) | |
201 | ||
202 | !else | |
203 | !ERROR Unknown architecture type "$(ARCH)". | |
204 | !endif | |
205 | !endif | |
206 | !endif | |
207 | !endif |