(message-signature-file): Fix doc, :type.
[emacs.git] / nt / nmake.defs
bloba60ce3e919c8c3070f9e60b872853b26884def1f
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.
19 # Ensure 'all' is the default target
20 all:
22 THE_SHELL = $(COMSPEC)
23 SHELLTYPE=CMD
25 MAKETYPE=nmake
27 CURDIR          = $(MAKEDIR:\=/)
28 THISDIR         = $(MAKEDIR)
30 ALL_DEPS        = $**
32 SUBSYSTEM_WINDOWS=-subsystem:windows
33 SUBSYSTEM_CONSOLE=-subsystem:console
35 # INSTALL_DIR is the directory into which emacs will be installed.
37 !ifndef INSTALL_DIR
38 INSTALL_DIR     = $(CURDIR)/..
39 !endif
41 # Allow detection of builds with MSVC 5 or later, so we can
42 # speed up compiles (see rule at end).
44 _NMAKE_VER_5=162
45 _NMAKE_VER_4=0
47 !IFNDEF _NMAKE_VER
48 _NMAKE_VER=$(_NMAKE_VER_4)
49 !ENDIF
51 # Check that the INCLUDE and LIB environment variables are set.
53 !ifndef INCLUDE
54 !error The INCLUDE environment variable needs to be set.
55 !endif
56 !ifndef LIB
57 !error The LIB environment variable needs to be set.
58 !endif
60 # Determine the architecture we're running on.
61 # Define ARCH for our purposes; 
62 # Define CPU for use by ntwin32.mak;
63 # Define CONFIG_H to the appropriate config.h for the system;
65 !ifdef PROCESSOR_ARCHITECTURE
66 # We're on Windows NT
67 CPU             = $(PROCESSOR_ARCHITECTURE)
68 CONFIG_H        = config.nt
69 OS_TYPE         = windowsnt
70 ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
71 ARCH            = i386
72 CPU             = i386
73 ! else
74 !  if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
75 ARCH            = mips
76 !  else
77 !   if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
78 ARCH            = alpha
79 !   else
80 !    if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
81 ARCH            = ppc
82 !    else
83 !     error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)"
84 !    endif
85 !   endif
86 !  endif
87 ! endif
88 !else
89 # We're on Windows 95
90 ARCH            = i386
91 CPU             = i386
92 CONFIG_H        = config.nt
93 OS_TYPE         = windows95
94 !endif
96 AR              = lib
97 AR_OUT          = -out:
98 CC              = cl
99 CC_OUT          = -Fo
100 LINK            = link
101 LINK_OUT        = -out:
102 RC              = rc
103 RC_OUT          = -Fo
104 RC_INCLUDE      = -i
106 libc            = libc.lib
107 baselibs        = 
108 O               = obj
109 A               = lib
111 BASE_LIBS       = $(libc) $(baselibs) oldnames.lib
113 ADVAPI32        = advapi32.lib
114 COMDLG32        = comdlg32.lib
115 GDI32           = gdi32.lib
116 MPR             = mpr.lib
117 SHELL32         = shell32.lib
118 USER32          = user32.lib
119 WSOCK32         = wsock32.lib
121 !ifdef NOOPT
122 DEBUG_CFLAGS    = -DEMACSDEBUG
123 !else
124 DEBUG_CFLAGS    = 
125 !endif
126 CFLAGS          = -I. -DWIN32_LEAN_AND_MEAN $(ARCH_CFLAGS) -D$(ARCH) \
127                   -D_CRTAPI1=_cdecl $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
128 EMACS_EXTRA_C_FLAGS =
130 SYS_LDFLAGS     = -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net
132 # see comments in allocate_heap in w32heap.c before changing any of the
133 # -stack, -heap, or -base settings.
134 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)
136 !ifdef NOOPT
137 OBJDIR          = obj
138 !else
139 OBJDIR          = obj-spd
140 !endif
141 $(OBJDIR):;     -mkdir $(OBJDIR)
142 BLD             = $(OBJDIR)/$(ARCH)
143 $(BLD):         $(OBJDIR)
144                 -mkdir "$(BLD)"
146 COMPILER_TEMP_FILES = *.pdb
148 CP              = cp -f
149 CP_DIR          = cp -rf
150 IFNOTSAMEDIR    = if not exist ..\same-dir.tst
151 ENDIF           =
152 FOREACH         = for %%f in (
153 FORVAR          = %%f
154 FORDO           = ) do
155 ENDFOR          =
156 ARGQUOTE        = "
157 DQUOTE          = \"
158 DEL             = rm
159 DEL_TREE        = rm -r
161 !ifdef NODEBUG
162 DEBUG_FLAG = 
163 !else
164 DEBUG_FLAG = -Zi
165 !endif
167 !if "$(ARCH)" == "i386"
168 !ifdef NOOPT
169 ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG)
170 !else
171 ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 $(DEBUG_FLAG)
172 !endif
173 ARCH_LDFLAGS    = $(SYS_LDFLAGS)
175 !else
176 !if "$(ARCH)" == "mips"
177 ARCH_CFLAGS     = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
178 ARCH_LDFLAGS    = $(SYS_LDFLAGS)
180 !else
181 !if "$(ARCH)" == "alpha"
182 !if "$(BUILD_TYPE)" == "spd"
183 ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl=
184 !else
185 ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl=
186 !endif
187 ARCH_LDFLAGS    = $(SYS_LDFLAGS)
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    = $(SYS_LDFLAGS)
195 !else
196 !ERROR Unknown architecture type "$(ARCH)".
197 !endif
198 !endif
199 !endif
200 !endif
202 LINK_FLAGS      = $(ARCH_LDFLAGS) $(USER_LDFLAGS)
204 # From MSVC 5.0 onwards, it seem base relocation information is not included,
205 # at least in release builds.  We need to ensure the reloc info is included
206 # in order to use the MSVC profiler.
207 !IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")
208 EXTRA_LINK      =
209 !ELSE
210 EXTRA_LINK      = -profile
211 !ENDIF
214 # If the compiler supports compiling multiple .c files to .o files at
215 # one time, use this feature.
217 !IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")
218 .c{$(BLD)}.obj:
219                 $(CC) $(CFLAGS) -Fo$(BLD)\ $<
220 !ELSE
221 .c{$(BLD)}.obj::
222                 $(CC) $(CFLAGS) -Fo$(BLD)\ $<
223 !ENDIF