Remove files related to old msvc only windows build.
[bpt/emacs.git] / nt / nmake.defs
1 # -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
2 # Copyright (c) 2000-2001 Free Software Foundation, Inc.
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 # Ensure 'all' is the default target
20 all:
21
22 THE_SHELL = $(COMSPEC)
23 SHELLTYPE=CMD
24
25 MAKETYPE=nmake
26
27 CURDIR = $(MAKEDIR:\=/)
28 THISDIR = $(MAKEDIR)
29
30 ALL_DEPS = $**
31
32 SUBSYSTEM_WINDOWS=-subsystem:windows
33 SUBSYSTEM_CONSOLE=-subsystem:console
34
35 # INSTALL_DIR is the directory into which emacs will be installed.
36 #
37 !ifndef INSTALL_DIR
38 INSTALL_DIR = $(CURDIR)/..
39 !endif
40
41 # Ensure EMACSLOADPATH is defined in the environment.
42 #
43 !if [set EMACSLOADPATH=foo]
44 !endif
45
46 # Allow detection of builds with MSVC 5 or later, so we can
47 # speed up compiles (see rule at end).
48 #
49 _NMAKE_VER_5=162
50 _NMAKE_VER_4=0
51
52 !IFNDEF _NMAKE_VER
53 _NMAKE_VER=$(_NMAKE_VER_4)
54 !ENDIF
55
56 # Check that the INCLUDE and LIB environment variables are set.
57 #
58 !ifndef INCLUDE
59 !error The INCLUDE environment variable needs to be set.
60 !endif
61 !ifndef LIB
62 !error The LIB environment variable needs to be set.
63 !endif
64
65 # Determine the architecture we're running on.
66 # Define ARCH for our purposes;
67 # Define CPU for use by ntwin32.mak;
68 # Define CONFIG_H to the appropriate config.h for the system;
69 #
70 !ifdef PROCESSOR_ARCHITECTURE
71 # We're on Windows NT
72 CPU = $(PROCESSOR_ARCHITECTURE)
73 CONFIG_H = config.nt
74 OS_TYPE = windowsnt
75 ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
76 ARCH = i386
77 CPU = i386
78 ! else
79 ! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
80 ARCH = mips
81 ! else
82 ! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
83 ARCH = alpha
84 ! else
85 ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
86 ARCH = ppc
87 ! else
88 ! error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)"
89 ! endif
90 ! endif
91 ! endif
92 ! endif
93 !else
94 # We're on Windows 95
95 ARCH = i386
96 CPU = i386
97 CONFIG_H = config.nt
98 OS_TYPE = windows95
99 !endif
100
101 AR = lib
102 AR_OUT = -out:
103 CC = cl
104 CC_OUT = -Fo
105 LINK = link
106 LINK_OUT = -out:
107 RC = rc
108 RC_OUT = -Fo
109 RC_INCLUDE = -i
110
111 libc = libc.lib
112 baselibs =
113 O = obj
114 A = lib
115
116 BASE_LIBS = $(libc) $(baselibs) oldnames.lib
117
118 ADVAPI32 = advapi32.lib
119 COMDLG32 = comdlg32.lib
120 GDI32 = gdi32.lib
121 MPR = mpr.lib
122 SHELL32 = shell32.lib
123 USER32 = user32.lib
124 WSOCK32 = wsock32.lib
125 WINMM = winmm.lib
126 WINSPOOL = winspool.lib
127
128 !ifdef NOOPT
129 DEBUG_CFLAGS = -DEMACSDEBUG
130 !else
131 DEBUG_CFLAGS =
132 !endif
133 CFLAGS = -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 $(ARCH_CFLAGS) -D$(ARCH) \
134 -D_CRTAPI1=_cdecl $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
135 EMACS_EXTRA_C_FLAGS =
136
137 SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj
138
139 # see comments in allocate_heap in w32heap.c before changing any of the
140 # -stack, -heap, or -base settings.
141 TEMACS_EXTRA_LINK = -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -debug:full -debugtype:both -pdb:$(BLD)\temacs.pdb -machine:$(ARCH) $(SUBSYSTEM_CONSOLE) -entry:_start -map:$(BLD)\temacs.map $(EXTRA_LINK)
142
143 !ifdef NOOPT
144 OBJDIR = obj
145 !else
146 OBJDIR = obj-spd
147 !endif
148 $(OBJDIR):; -mkdir $(OBJDIR)
149 BLD = $(OBJDIR)/$(ARCH)
150 $(BLD): $(OBJDIR)
151 -mkdir "$(BLD)"
152
153 COMPILER_TEMP_FILES = *.pdb
154
155 CP = cp -f
156 CP_DIR = cp -rf
157 IFNOTSAMEDIR = if not exist ..\same-dir.tst
158 ENDIF =
159 FOREACH = for %%f in (
160 FORVAR = %%f
161 FORDO = ) do
162 ENDFOR =
163 ARGQUOTE = "
164 DQUOTE = \"
165 DEL = rm
166 DEL_TREE = rm -r
167
168 !ifdef NODEBUG
169 DEBUG_FLAG =
170 DEBUG_LINK =
171 !else
172 DEBUG_FLAG = -Zi
173 DEBUG_LINK = -debug:full -debugtype:both
174 !endif
175
176 !if "$(ARCH)" == "i386"
177 !ifdef NOOPT
178 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG)
179 !else
180 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 $(DEBUG_FLAG)
181 !endif
182 ARCH_LDFLAGS = $(SYS_LDFLAGS)
183
184 !else
185 !if "$(ARCH)" == "mips"
186 ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
187 ARCH_LDFLAGS = $(SYS_LDFLAGS)
188
189 !else
190 !if "$(ARCH)" == "alpha"
191 !if "$(BUILD_TYPE)" == "spd"
192 ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl=
193 !else
194 ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl=
195 !endif
196 ARCH_LDFLAGS = $(SYS_LDFLAGS)
197
198 !else
199 !if "$(ARCH)" == "ppc"
200 # These flags are a guess...if they don't work, please send me mail.
201 ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od
202 ARCH_LDFLAGS = $(SYS_LDFLAGS)
203
204 !else
205 !ERROR Unknown architecture type "$(ARCH)".
206 !endif
207 !endif
208 !endif
209 !endif
210
211 LINK_FLAGS = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(USER_LDFLAGS)
212
213 # From MSVC 5.0 onwards, it seem base relocation information is not included,
214 # at least in release builds. We need to ensure the reloc info is included
215 # in order to use the MSVC profiler.
216 !IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")
217 EXTRA_LINK =
218 !ELSE
219 EXTRA_LINK = -profile
220 !ENDIF
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
233
234 # arch-tag: fefa49b0-c23c-46c7-9094-cab2a405058e