]> code.delx.au - gnu-emacs/blob - nt/makefile.def
[MAIL_USE_POP]: Add the "-r" flag to reverse the
[gnu-emacs] / nt / makefile.def
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
16 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
18 #
19 # Geoff Voelker (voelker@cs.washington.edu) 9-6-94
20
21 #
22 # BEGIN CONFIGURATION
23 #
24
25 # Define the following to build the GUI version
26 #
27 NTGUI=1
28
29 # Set INSTALL_DIR to be the directory into which you want emacs installed.
30 #
31 !ifndef INSTALL_DIR
32 INSTALL_DIR = C:\emacs
33 !endif
34
35 # Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment.
36 # MSVCNT11 = 1
37 !ifndef MSVCNT11
38 MSVCNT11 = 0
39 !endif
40
41 #
42 # END CONFIGURATION
43 #
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;
58 #
59 !ifdef PROCESSOR_ARCHITECTURE
60 # We're on Windows NT
61 CPU = $(PROCESSOR_ARCHITECTURE)
62 CONFIG_H = config.nt
63 OS_TYPE = windowsnt
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
86 CONFIG_H = config.nt
87 OS_TYPE = windows95
88 !endif
89
90 # Include ntwin32.mak. So far, this file seems to be supported by every
91 # Microsoft compiler on NT and Windows 95 and properly defines the executable
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>
97
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.
121 !if $(MSVCNT11)
122 BASE_LIBS = $(libc) $(baselibs) oldnames.lib
123 !else
124 BASE_LIBS = $(libc) $(baselibs) -nodefaultlib:oldnames.lib
125 !endif
126
127 # We want any debugging info in the executable.
128 !if "$(LINK)" == "link32"
129 SYS_LDFLAGS =
130 !else
131 SYS_LDFLAGS = -release -incremental:no -version:3.10
132 !endif
133
134 INC = -I.
135 !if "$(BUILD_TYPE)" == "spd"
136 CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb
137 !else
138 CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -DEMACSDEBUG
139 !endif
140 !if $(MSVCNT11)
141 CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
142 !else
143 CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
144 !endif
145
146 !ifdef BUILD_TYPE
147 OBJDIR = obj-$(BUILD_TYPE)
148 !else
149 OBJDIR = obj
150 !endif
151 $(OBJDIR):; -mkdir $(OBJDIR)
152 BLD = $(OBJDIR)\$(ARCH)
153 $(BLD): $(OBJDIR)
154 -mkdir $(BLD)
155
156 CP = copy
157 CP_DIR = xcopy /f/r/i/e/d/k
158
159 !if "$(OS_TYPE)" == "windows95"
160 DEL = deltree /y
161 DEL_TREE = deltree /y
162 !else
163 DEL = del
164 # This is completely braindamaged, but it's the only routine known to be there
165 DEL_TREE = echo y | rmdir /s
166 !endif
167
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
174 !if "$(ARCH)" == "i386"
175 !if "$(BUILD_TYPE)" == "spd"
176 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G5dF -Zi
177 !else
178 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od
179 !endif
180 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
181
182 !else
183 !if "$(ARCH)" == "mips"
184 ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
185 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
186
187 !else
188 !if "$(ARCH)" == "alpha"
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
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