2 # Makefile definition file for building GNU Emacs on Windows NT
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)
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.
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 # Geoff Voelker (voelker@cs.washington.edu) 9-6-94
25 # Define the following to build the GUI version
29 # Set INSTALL_DIR to be the directory into which you want emacs installed.
32 INSTALL_DIR = C:\emacs
35 # Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment.
45 # Check that the INCLUDE and LIB environment variables are set.
48 !error The INCLUDE environment variable needs to be set.
51 !error The LIB environment variable needs to be set.
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;
59 !ifdef PROCESSOR_ARCHITECTURE
61 CPU = $(PROCESSOR_ARCHITECTURE)
64 ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
68 ! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
71 ! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
74 ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
77 !error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)"
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.
96 !include <ntwin32.mak>
98 # Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms.
101 # The assignment $(CC) = $(cc) fails even though variables are case sensitive.
107 # advapi32.lib is left off of $(baselibs) on NT 3.10
108 !if "$(baselibs)" == "kernel32.lib "
109 ADVAPI32 = advapi32.lib
114 # Older ntwin32.mak files do not define libc; do it for them.
119 # The base libraries for compiling Emacs on NT. With MSVC, this should
120 # include oldnames.lib.
122 BASE_LIBS = $(libc) $(baselibs) oldnames.lib
124 BASE_LIBS = $(libc) $(baselibs) -nodefaultlib:oldnames.lib
127 # We want any debugging info in the executable.
128 !if "$(LINK)" == "link32"
131 SYS_LDFLAGS = -release -incremental:no -version:3.10
135 !if "$(BUILD_TYPE)" == "spd"
136 CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb
138 CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -DEMACSDEBUG
141 CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
143 CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
147 OBJDIR = obj-$(BUILD_TYPE)
151 $(OBJDIR):; -mkdir $(OBJDIR)
152 BLD = $(OBJDIR)\$(ARCH)
157 CP_DIR = xcopy /f/r/i/e/d/k
159 !if "$(OS_TYPE)" == "windows95"
161 DEL_TREE = deltree /y
164 # This is completely braindamaged, but it's the only routine known to be there
165 DEL_TREE = echo y | rmdir /s
168 # The location of the icon file
169 EMACS_ICON_PATH = ..\nt\emacs.ico
171 # Lets us add icons to the GNU Emacs folder
172 ADDPM = ..\nt\$(BLD)\addpm.exe
174 !if "$(ARCH)" == "i386"
175 !if "$(BUILD_TYPE)" == "spd"
176 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G5dF -Zi
178 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od
180 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
183 !if "$(ARCH)" == "mips"
184 ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
185 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
188 !if "$(ARCH)" == "alpha"
189 !if "$(BUILD_TYPE)" == "spd"
190 ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl=
192 ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl=
194 ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS)
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)
203 !ERROR Unknown architecture type "$(ARCH)".