| 1 |
# |
|---|
| 2 |
# Makefile definition file for building GNU Emacs on Windows NT |
|---|
| 3 |
# Copyright (c) 1994-2001 Free Software Foundation, Inc. |
|---|
| 4 |
# |
|---|
| 5 |
# GNU Emacs is free software; you can redistribute it and/or modify |
|---|
| 6 |
# it under the terms of the GNU General Public License as published by |
|---|
| 7 |
# the Free Software Foundation; either version 2, or (at your option) |
|---|
| 8 |
# any later version. |
|---|
| 9 |
# |
|---|
| 10 |
# GNU Emacs is distributed in the hope that it will be useful, |
|---|
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 |
# GNU General Public License for more details. |
|---|
| 14 |
# |
|---|
| 15 |
# You should have received a copy of the GNU General Public License |
|---|
| 16 |
# along with GNU Emacs; see the file COPYING. If not, write to |
|---|
| 17 |
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|---|
| 18 |
# Boston, MA 02111-1307, USA. |
|---|
| 19 |
# |
|---|
| 20 |
# Geoff Voelker (voelker@cs.washington.edu) 9-6-94 |
|---|
| 21 |
|
|---|
| 22 |
# |
|---|
| 23 |
# BEGIN CONFIGURATION |
|---|
| 24 |
# |
|---|
| 25 |
|
|---|
| 26 |
# Define the following to build the GUI version |
|---|
| 27 |
# |
|---|
| 28 |
NTGUI=1 |
|---|
| 29 |
|
|---|
| 30 |
# Set INSTALL_DIR to be the directory into which you want emacs installed. |
|---|
| 31 |
# |
|---|
| 32 |
!ifndef INSTALL_DIR |
|---|
| 33 |
INSTALL_DIR = c:\Meadow |
|---|
| 34 |
!endif |
|---|
| 35 |
|
|---|
| 36 |
# Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment. |
|---|
| 37 |
# MSVCNT11 = 1 |
|---|
| 38 |
!ifndef MSVCNT11 |
|---|
| 39 |
MSVCNT11 = 0 |
|---|
| 40 |
!endif |
|---|
| 41 |
|
|---|
| 42 |
# Define DEBUG_MODE to be nonzero if you want to debug this program. |
|---|
| 43 |
!if "$(DEBUG_MODE)" == "" |
|---|
| 44 |
DEBUG_MODE = 1 |
|---|
| 45 |
!endif |
|---|
| 46 |
|
|---|
| 47 |
## child nmake should inherit DEBUG_MODE and BUILD_TYPE. |
|---|
| 48 |
!ifdef BUILD_TYPE |
|---|
| 49 |
MFLAGS=$(MFLAG) DEBUG_MODE=$(DEBUG_MODE) BUILD_TYPE=$(BUILD_TYPE) |
|---|
| 50 |
!else |
|---|
| 51 |
MFLAGS=$(MFLAG) DEBUG_MODE=$(DEBUG_MODE) |
|---|
| 52 |
!endif |
|---|
| 53 |
|
|---|
| 54 |
# Define BOOTSTRAP if building emacs for BOOTSTRAP. |
|---|
| 55 |
BOOTSTRAP = 0 |
|---|
| 56 |
|
|---|
| 57 |
# |
|---|
| 58 |
PROFILE_MODE = 0 |
|---|
| 59 |
|
|---|
| 60 |
!include <../nt/meadow.defs> |
|---|
| 61 |
|
|---|
| 62 |
# |
|---|
| 63 |
# For release |
|---|
| 64 |
# |
|---|
| 65 |
|
|---|
| 66 |
!if "$(PROCESSOR_ARCHITECTURE)" == "x86" |
|---|
| 67 |
RELEASE_PROCESSOR_SUFFIX = i386 |
|---|
| 68 |
!else |
|---|
| 69 |
!if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" |
|---|
| 70 |
RELEASE_PROCESSOR_SUFFIX = alpha |
|---|
| 71 |
!endif |
|---|
| 72 |
!endif |
|---|
| 73 |
|
|---|
| 74 |
!ifndef SRC_RELEASE_DRIVE |
|---|
| 75 |
SRC_RELEASE_DRIVE = g: |
|---|
| 76 |
!endif |
|---|
| 77 |
!ifndef SRC_RELEASE_DIRECTORY |
|---|
| 78 |
SRC_RELEASE_DIRECTORY = $(SRC_RELEASE_DRIVE)\release\source |
|---|
| 79 |
!endif |
|---|
| 80 |
!ifndef BIN_RELEASE_DRIVE |
|---|
| 81 |
BIN_RELEASE_DRIVE = g: |
|---|
| 82 |
!endif |
|---|
| 83 |
!ifndef BIN_RELEASE_DIRECTORY |
|---|
| 84 |
BIN_RELEASE_DIRECTORY = $(BIN_RELEASE_DRIVE)\release\$(RELEASE_PROCESSOR_SUFFIX) |
|---|
| 85 |
!endif |
|---|
| 86 |
|
|---|
| 87 |
SRC_TARBALL_GZIP_FILENAME = Meadow-$(MEADOW_VERSION)-src.tar.gz |
|---|
| 88 |
BIN_TARBALL_GZIP_FILENAME = Meadow-$(MEADOW_VERSION)-$(RELEASE_PROCESSOR_SUFFIX).tar.gz |
|---|
| 89 |
|
|---|
| 90 |
!if $(MEADOW_TEST_VERSION) |
|---|
| 91 |
BIN_RELEASE_ADDONS = lisp/ChangeLog.Meadow src/ChangeLog.Meadow |
|---|
| 92 |
!else |
|---|
| 93 |
BIN_RELEASE_ADDONS = |
|---|
| 94 |
!endif |
|---|
| 95 |
SVN_RELEASE_URL = $(MEADOW_SVN_URL)/releases/$(MEADOW_RELEASE_TAG) |
|---|
| 96 |
RELEASE_NAME = Meadow-$(MEADOW_VERSION) |
|---|
| 97 |
NO_RELEASE_FILE_LIST = src/win32memchk.c src/*.dll src/*.lib |
|---|
| 98 |
|
|---|
| 99 |
SRC_RELEASE_TARGET_DIRECTORY = $(SRC_RELEASE_DIRECTORY)\$(RELEASE_NAME) |
|---|
| 100 |
SRC_TARBALL_GZIP_TARGET = $(SRC_RELEASE_DIRECTORY)\$(SRC_TARBALL_GZIP_FILENAME) |
|---|
| 101 |
BIN_RELEASE_TARGET_DIRECTORY = $(BIN_RELEASE_DIRECTORY)\Meadow |
|---|
| 102 |
BIN_TARBALL_GZIP_TARGET = $(BIN_RELEASE_DIRECTORY)\$(BIN_TARBALL_GZIP_FILENAME) |
|---|
| 103 |
|
|---|
| 104 |
# END CONFIGURATION |
|---|
| 105 |
# |
|---|
| 106 |
|
|---|
| 107 |
# |
|---|
| 108 |
# Allow detection of builds with MSVC 5 or later |
|---|
| 109 |
# |
|---|
| 110 |
_NMAKE_VER_5=162 |
|---|
| 111 |
_NMAKE_VER_4=0 |
|---|
| 112 |
|
|---|
| 113 |
!IFNDEF _NMAKE_VER |
|---|
| 114 |
_NMAKE_VER=$(_NMAKE_VER_4) |
|---|
| 115 |
!ENDIF |
|---|
| 116 |
|
|---|
| 117 |
# Check that the INCLUDE and LIB environment variables are set. |
|---|
| 118 |
# |
|---|
| 119 |
!ifndef INCLUDE |
|---|
| 120 |
!error The INCLUDE environment variable needs to be set. |
|---|
| 121 |
!endif |
|---|
| 122 |
!ifndef LIB |
|---|
| 123 |
!error The LIB environment variable needs to be set. |
|---|
| 124 |
!endif |
|---|
| 125 |
|
|---|
| 126 |
# Determine the architecture we're running on. |
|---|
| 127 |
# Define ARCH for our purposes; |
|---|
| 128 |
# Define CPU for use by ntwin32.mak; |
|---|
| 129 |
# Define CONFIG_H to the appropriate config.h for the system; |
|---|
| 130 |
# |
|---|
| 131 |
!ifdef PROCESSOR_ARCHITECTURE |
|---|
| 132 |
# We're on Windows NT |
|---|
| 133 |
CPU = $(PROCESSOR_ARCHITECTURE) |
|---|
| 134 |
CONFIG_H = config.nt |
|---|
| 135 |
OS_TYPE = windowsnt |
|---|
| 136 |
! if "$(PROCESSOR_ARCHITECTURE)" == "x86" |
|---|
| 137 |
ARCH = i386 |
|---|
| 138 |
CPU = i386 |
|---|
| 139 |
! else |
|---|
| 140 |
! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" |
|---|
| 141 |
ARCH = mips |
|---|
| 142 |
! else |
|---|
| 143 |
! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" |
|---|
| 144 |
ARCH = alpha |
|---|
| 145 |
! else |
|---|
| 146 |
! if "$(PROCESSOR_ARCHITECTURE)" == "PPC" |
|---|
| 147 |
ARCH = ppc |
|---|
| 148 |
! else |
|---|
| 149 |
!error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" |
|---|
| 150 |
! endif |
|---|
| 151 |
! endif |
|---|
| 152 |
! endif |
|---|
| 153 |
! endif |
|---|
| 154 |
!else |
|---|
| 155 |
# We're on Windows 95 |
|---|
| 156 |
ARCH = i386 |
|---|
| 157 |
CPU = i386 |
|---|
| 158 |
CONFIG_H = config.nt |
|---|
| 159 |
OS_TYPE = windows95 |
|---|
| 160 |
!endif |
|---|
| 161 |
|
|---|
| 162 |
# Include ntwin32.mak. So far, this file seems to be supported by every |
|---|
| 163 |
# Microsoft compiler on NT and Windows 95 and properly defines the executable |
|---|
| 164 |
# names and libraries necessary to build Emacs. I do not have access |
|---|
| 165 |
# to any other vendor compilers, so I do not know if they supply this |
|---|
| 166 |
# file, too. For now I'll assume that they do. |
|---|
| 167 |
# |
|---|
| 168 |
!include <ntwin32.mak> |
|---|
| 169 |
|
|---|
| 170 |
# Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms. |
|---|
| 171 |
CVTRES = cvtres.exe |
|---|
| 172 |
AR = $(implib) |
|---|
| 173 |
# The assignment $(CC) = $(cc) fails even though variables are case sensitive. |
|---|
| 174 |
LINK_TMP = $(link) |
|---|
| 175 |
LINK = $(LINK_TMP) |
|---|
| 176 |
CC_TMP = $(cc) |
|---|
| 177 |
CC = $(CC_TMP) |
|---|
| 178 |
|
|---|
| 179 |
# advapi32.lib is left off of $(baselibs) on NT 3.10 |
|---|
| 180 |
!if "$(baselibs)" == "kernel32.lib " |
|---|
| 181 |
ADVAPI32 = advapi32.lib |
|---|
| 182 |
!else |
|---|
| 183 |
ADVAPI32 = |
|---|
| 184 |
!endif |
|---|
| 185 |
|
|---|
| 186 |
# Older ntwin32.mak files do not define libc; do it for them. |
|---|
| 187 |
!ifndef libc |
|---|
| 188 |
libc = libc.lib |
|---|
| 189 |
!endif |
|---|
| 190 |
|
|---|
| 191 |
# The base libraries for compiling Emacs on NT. With MSVC, this should |
|---|
| 192 |
# include oldnames.lib. |
|---|
| 193 |
!if $(MSVCNT11) |
|---|
| 194 |
BASE_LIBS = $(libc) $(baselibs) oldnames.lib |
|---|
| 195 |
!else |
|---|
| 196 |
BASE_LIBS = $(libc) $(baselibs) -nodefaultlib:oldnames.lib |
|---|
| 197 |
!endif |
|---|
| 198 |
|
|---|
| 199 |
# We want any debugging info in the executable. |
|---|
| 200 |
!if "$(LINK)" == "link32" |
|---|
| 201 |
SYS_LDFLAGS = |
|---|
| 202 |
!else |
|---|
| 203 |
!if $(W32_VER4) |
|---|
| 204 |
SYS_LDFLAGS = -nologo -release -incremental:no -version:4.00 |
|---|
| 205 |
!else |
|---|
| 206 |
SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 |
|---|
| 207 |
!endif |
|---|
| 208 |
!endif |
|---|
| 209 |
|
|---|
| 210 |
# Tag the executables to run out of the swapfile when execute off CD or network shares |
|---|
| 211 |
SYS_LDFLAGS = $(SYS_LDFLAGS) -swaprun:cd -swaprun:net |
|---|
| 212 |
|
|---|
| 213 |
!if $(DEBUG_MODE) |
|---|
| 214 |
SYS_LDFLAGS = $(SYS_LDFLAGS) -debug:full -debugtype:cv |
|---|
| 215 |
!endif |
|---|
| 216 |
|
|---|
| 217 |
INC = -I. |
|---|
| 218 |
|
|---|
| 219 |
!if "$(BUILD_TYPE)" == "spd" |
|---|
| 220 |
CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb |
|---|
| 221 |
!else |
|---|
| 222 |
CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -YX -Fp$(BLD)\emacs.pch -DEMACSDEBUG -DGLYPH_DEBUG |
|---|
| 223 |
!endif |
|---|
| 224 |
|
|---|
| 225 |
!if $(MSVCNT11) |
|---|
| 226 |
CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl |
|---|
| 227 |
!else |
|---|
| 228 |
CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl |
|---|
| 229 |
!endif |
|---|
| 230 |
|
|---|
| 231 |
!if $(BOOTSTRAP) |
|---|
| 232 |
#CFLAGS = $(CFLAGS) -DPURESIZE=5000000 |
|---|
| 233 |
CFLAGS = $(CFLAGS) -DPDUMP_HASH_SIZE=4000037 -DPDUMP_OBJECT_ARRAY_SIZE=245000 |
|---|
| 234 |
!endif |
|---|
| 235 |
!if $(PROFILE_MODE) |
|---|
| 236 |
CFLAGS = $(CFLAGS) -DPROFILE |
|---|
| 237 |
!endif |
|---|
| 238 |
!if $(W32_VER4) |
|---|
| 239 |
CFLAGS = $(CFLAGS) -DW32_VER4 |
|---|
| 240 |
!endif |
|---|
| 241 |
!if $(SPECIAL_EXEC) |
|---|
| 242 |
CFLAGS = $(CFLAGS) -DSPECIAL_EXEC -DCANNOT_DUMP |
|---|
| 243 |
!endif |
|---|
| 244 |
|
|---|
| 245 |
!if $(MEADOW) |
|---|
| 246 |
COPY_LISP_SOURCE = 1 |
|---|
| 247 |
CFLAGS = $(CFLAGS) -DMEADOW="\"$(MEADOW_VERSION)\"" -DMEADOW_VERSION_STRING=$(MEADOW_VERSION_STRING) |
|---|
| 248 |
!endif |
|---|
| 249 |
|
|---|
| 250 |
!ifdef BUILD_TYPE |
|---|
| 251 |
OBJDIR = obj-$(BUILD_TYPE) |
|---|
| 252 |
!else |
|---|
| 253 |
OBJDIR = obj |
|---|
| 254 |
!endif |
|---|
| 255 |
$(OBJDIR):; -mkdir $(OBJDIR) |
|---|
| 256 |
BLD = $(OBJDIR)\$(ARCH) |
|---|
| 257 |
$(BLD): $(OBJDIR) |
|---|
| 258 |
-mkdir $(BLD) |
|---|
| 259 |
|
|---|
| 260 |
CP = copy |
|---|
| 261 |
!if "$(OS_TYPE)" == "windows95" |
|---|
| 262 |
CP_DIR = xcopy /f/r/i/e/d/k/y |
|---|
| 263 |
!else |
|---|
| 264 |
CP_DIR = xcopy /f/r/i/e/d/k/y /EXCLUDE:..\nt\excludes.Meadow |
|---|
| 265 |
|
|---|
| 266 |
!endif |
|---|
| 267 |
|
|---|
| 268 |
!if "$(OS_TYPE)" == "windows95" |
|---|
| 269 |
DEL = deltree /y |
|---|
| 270 |
DEL_TREE = deltree /y |
|---|
| 271 |
!else |
|---|
| 272 |
DEL = del |
|---|
| 273 |
# NT better way of killing a deltree |
|---|
| 274 |
DEL_TREE = rd /s/q |
|---|
| 275 |
!endif |
|---|
| 276 |
|
|---|
| 277 |
# Lets us add icons to the GNU Emacs folder |
|---|
| 278 |
ADDPM = ..\nt\$(BLD)\addpm.exe |
|---|
| 279 |
|
|---|
| 280 |
!if "$(ARCH)" == "i386" |
|---|
| 281 |
!if "$(BUILD_TYPE)" == "spd" |
|---|
| 282 |
#ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G6dF -Zi -Zp8 |
|---|
| 283 |
ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -O2 -Ob2 -GBdF -Zi -Zp8 |
|---|
| 284 |
!else |
|---|
| 285 |
ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zi -Zp8 |
|---|
| 286 |
!endif |
|---|
| 287 |
ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) |
|---|
| 288 |
|
|---|
| 289 |
!else |
|---|
| 290 |
!if "$(ARCH)" == "mips" |
|---|
| 291 |
ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0 |
|---|
| 292 |
ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) |
|---|
| 293 |
|
|---|
| 294 |
!else |
|---|
| 295 |
!if "$(ARCH)" == "alpha" |
|---|
| 296 |
!if "$(BUILD_TYPE)" == "spd" |
|---|
| 297 |
ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl= |
|---|
| 298 |
!else |
|---|
| 299 |
ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl= |
|---|
| 300 |
!endif |
|---|
| 301 |
ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS) |
|---|
| 302 |
|
|---|
| 303 |
!else |
|---|
| 304 |
!if "$(ARCH)" == "ppc" |
|---|
| 305 |
# These flags are a guess...if they don't work, please send me mail. |
|---|
| 306 |
ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od |
|---|
| 307 |
ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) |
|---|
| 308 |
|
|---|
| 309 |
!else |
|---|
| 310 |
!ERROR Unknown architecture type "$(ARCH)". |
|---|
| 311 |
!endif |
|---|
| 312 |
!endif |
|---|
| 313 |
!endif |
|---|
| 314 |
!endif |
|---|
| 315 |
|
|---|
| 316 |
# |
|---|
| 317 |
# If the compiler supports compiling multiple .c files to .o files at |
|---|
| 318 |
# one time, use this feature. |
|---|
| 319 |
# |
|---|
| 320 |
!IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") |
|---|
| 321 |
.c{$(BLD)}.obj: |
|---|
| 322 |
$(CC) $(CFLAGS) -Fo$(BLD)\ $< |
|---|
| 323 |
!ELSE |
|---|
| 324 |
.c{$(BLD)}.obj:: |
|---|
| 325 |
$(CC) $(CFLAGS) -Fo$(BLD)\ $< |
|---|
| 326 |
!ENDIF |
|---|