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