(get_display_line): Don't abort if there's text
[bpt/emacs.git] / nt / makefile.def
CommitLineData
efdeeb2b
GV
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
17#
18# Geoff Voelker (voelker@cs.washington.edu) 9-6-94
19
20#
21# BEGIN CONFIGURATION
22#
23
43648015 24# Set INSTALL_DIR to be the directory into which you want emacs installed.
efdeeb2b 25#
43648015
GV
26!ifndef INSTALL_DIR
27INSTALL_DIR = C:\emacs
28!endif
efdeeb2b 29
d51bca10
RS
30# Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment.
31# MSVCNT11 = 1
32MSVCNT11 = 0
33
efdeeb2b
GV
34#
35# END CONFIGURATION
36#
43648015
GV
37
38# Check that the INCLUDE and LIB environment variables are set.
39#
40!ifndef INCLUDE
41!error The INCLUDE environment variable needs to be set.
42!endif
43!ifndef LIB
44!error The LIB environment variable needs to be set.
45!endif
46
47# Determine the architecture we're running on.
48# Define ARCH for our purposes;
49# Define CPU for use by ntwin32.mak;
50# Define CONFIG_H to the appropriate config.h for the system;
efdeeb2b 51#
43648015
GV
52!ifdef PROCESSOR_ARCHITECTURE
53# We're on Windows NT
54CPU = $(PROCESSOR_ARCHITECTURE)
55CONFIG_H = config.nt
56OS_TYPE = winnt
57! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
58ARCH = i386
59CPU = i386
60! else
61! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
62ARCH = mips
63! else
64! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
65ARCH = alpha
66! else
67! if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
68ARCH = ppc
69! else
70!error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)"
71! endif
72! endif
73! endif
74! endif
75!else
76# We're on Windows 95
77ARCH = i386
78CPU = i386
79CONFIG_H = config.w95
80OS_TYPE = win95
81!endif
82
83# Include ntwin32.mak. So far, this file seems to be supported by every
84# Microsoft compiler on NT and Win95 and properly defines the executable
85# names and libraries necessary to build Emacs. I do not have access
86# to any other vendor compilers, so I do not know if they supply this
87# file, too. For now I'll assume that they do.
88#
89!include <ntwin32.mak>
efdeeb2b 90
43648015
GV
91# Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms.
92CVTRES = cvtres.exe
93AR = $(implib)
94# The assignment $(CC) = $(cc) fails even though variables are case sensitive.
95LINK_TMP = $(link)
96LINK = $(LINK_TMP)
97CC_TMP = $(cc)
98CC = $(CC_TMP)
99
100# advapi32.lib is left off of $(baselibs) on NT 3.10
101!if "$(baselibs)" == "kernel32.lib "
102ADVAPI32 = advapi32.lib
103!else
104ADVAPI32 =
105!endif
106
107# Older ntwin32.mak files do not define libc; do it for them.
108!ifndef libc
109libc = libc.lib
110!endif
111
112# The base libraries for compiling Emacs on NT. With MSVC, this should
113# include oldnames.lib.
d51bca10
RS
114!if $(MSVCNT11)
115BASE_LIBS = $(libc) $(baselibs) oldnames.lib
116!else
43648015 117BASE_LIBS = $(libc) $(baselibs)
d51bca10 118!endif
43648015
GV
119
120# We want any debugging info in the executable.
121!if "$(LINK)" == "link32"
122SYS_LDFLAGS =
123!else
124SYS_LDFLAGS = -pdb:none -release -incremental:no
125!endif
126
127INC = -I.
d51bca10
RS
128CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH)
129!if $(MSVCNT11)
130CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
131!else
132CFLAGS = $(CFLAGS_COMMON)
133!endif
efdeeb2b
GV
134
135OBJDIR = obj
43648015 136$(OBJDIR):; -mkdir $(OBJDIR)
efdeeb2b
GV
137BLD = $(OBJDIR)\$(ARCH)
138$(BLD): $(OBJDIR)
139 -mkdir $(BLD)
140
141CP = copy
142CP_DIR = xcopy /fried
143
144# This is completely braindamaged, but it's the only routine known to be there
145DEL_TREE = echo y | rmdir /s
146
01b96d5c
GV
147# The location of the icon file
148EMACS_ICON_PATH = ..\nt\emacs.ico
149
150# Lets us add icons to the GNU Emacs folder
151ADDPM = ..\nt\$(BLD)\addpm.exe
152
43648015 153!if "$(ARCH)" == "i386"
efdeeb2b 154ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od
43648015 155ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
efdeeb2b 156
43648015
GV
157!else
158!if "$(ARCH)" == "mips"
159ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
160ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
efdeeb2b 161
43648015
GV
162!else
163!if "$(ARCH)" == "alpha"
efdeeb2b 164ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -D__stdcall= -D__cdecl=
43648015
GV
165ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS)
166
167!else
168!if "$(ARCH)" == "ppc"
169# These flags are a guess...if they don't work, please send me mail.
170ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od
171ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
172
173!else
174!ERROR Unknown architecture type "$(ARCH)".
175!endif
176!endif
177!endif
178!endif