+# -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
+# Copyright (c) 2000-2001 Free Software Foundation, Inc.
#
-# Makefile definition file for building GNU Emacs on Windows NT
-#
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
-#
+#
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
all:
# NOTES
-#
+#
# I tried to force gmake to use the native shell for simplicity, by
# setting SHELL as below, but this didn't work reliably because of
# various case sensitivity niggles. Specifically, COMSPEC (which is in
# thinks it doesn't exist (unless compiled with a switch to ignore
# case), and so doesn't change which shell it will invoke to execute
# commands.
-#
+#
# It would be possible, though very tedious using just gmake facilities,
# to convert the COMSPEC value to uppercase to solve this problem, but
# it isn't worth it. That is partly because, even when using the native
# mandate that rm and cp be available, so we can use Unix-format file
# names everywhere. (Fortunately both MS and GNU make, and the
# respective compilers, are happy with Unix-format names.)
-#
+#
# Since we cannot easily force the choice of a particular shell, we must
# make the effort to cope with whichever shell is being used.
# Fortunately, the only command we need to use that is shell specific is
# the testing of a file's existence for the purpose of working out when
# we are copying files to their original location. That particular
# requirement is abstracted easily enough.
-#
+#
# The only other problem area was the change of directory when running
# temacs to dump emacs.exe (where gmake doesn't support cd foo in any
# useful way), but that has been resolved by modifying the Windows
USING_SH = 1
THE_SHELL = $(SHELL)
SHELLTYPE=SH
-SETLOADPATH=EMACSLOADPATH=../lisp
endif
-MAKEDIR = $(CURDIR)
+MAKETYPE=gmake
+
+# The following "ifeq" does not appear to DTRT, and therefore breaks
+# the build on mingw32. Also the -m option does not exist in many
+# (reasonably recent even) versions of Cygwin. These issues need to be
+# remedied before putting this cygpath kludge back in.
+
+# Convert CURDIR to native file name, if in Cygwin format
+#ifeq "$(shell cygpath $(CURDIR))" "$(CURDIR)"
+#CURDIR := $(shell cygpath -m $(CURDIR))
+#endif
+
+THISDIR = .
+
+# Cygwin has changed quoting rules somewhat since b20, in a way that
+# affects makefiles using sh as the command processor, so we need to
+# detect which rules to use.
+ifdef USING_SH
+sh_output := $(shell echo [Please ignore a syntax error on the next line - it is intentional] 1>&2)
+sh_output := $(shell echo foo")
+ifeq "$(sh_output)" ""
+NEW_CYGWIN = 1
+endif
+endif
+
ALL_DEPS = $^
EMPTY =
SPACE = $(EMPTY) $(EMPTY)
# INSTALL_DIR is the directory into which emacs will be installed.
#
ifndef INSTALL_DIR
-INSTALL_DIR = $(MAKEDIR)/..
+INSTALL_DIR = $(CURDIR)/..
endif
+export EMACSLOADPATH
+
# Determine the architecture we're running on.
-# Define ARCH for our purposes;
+# Define ARCH for our purposes;
# Define CPU for use by ntwin32.mak;
# Define CONFIG_H to the appropriate config.h for the system;
#
RC_OUT = -o$(SPACE)
RC_INCLUDE = --include-dir$(SPACE)
-libc =
-baselibs =
+libc =
+baselibs =
O = o
A = a
SHELL32 = -lshell32
USER32 = -luser32
WSOCK32 = -lwsock32
+WINMM = -lwinmm
+WINSPOOL = -lwinspool
ifdef NOOPT
DEBUG_CFLAGS = -DEMACSDEBUG
else
-DEBUG_CFLAGS =
+DEBUG_CFLAGS =
endif
-CFLAGS = -I. -DWIN32_LEAN_AND_MEAN $(ARCH_CFLAGS) -D$(ARCH) \
+CFLAGS = -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 $(ARCH_CFLAGS) -D$(ARCH) \
-D_CRTAPI1=_cdecl \
$(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1
$(BLD): $(OBJDIR)
-mkdir "$(BLD)"
+COMPILER_TEMP_FILES =
+
CP = cp -f
CP_DIR = cp -rf
DEL = rm
DEL_TREE = rm -r
+
ifdef USING_SH
+
IFNOTSAMEDIR = if [ ! -s ../same-dir.tst ] ; then
FOREACH = for f in
FORVAR = $${f}
ENDFOR = ; done
ENDIF = ; fi
ARGQUOTE = '
+ifdef NEW_CYGWIN
+DQUOTE = "
+else
DQUOTE = ""
+endif
+
else
+
IFNOTSAMEDIR = if not exist ../same-dir.tst
FOREACH = for %%f in (
FORVAR = %%f
ENDIF =
ARGQUOTE = "
DQUOTE = \"
-endif
-# The location of the icon file
-EMACS_ICON_PATH = ../nt/emacs.ico
+endif
ifdef NODEBUG
-DEBUG_FLAG =
+DEBUG_FLAG =
+DEBUG_LINK =
else
DEBUG_FLAG = -g
+DEBUG_LINK = -g
endif
ifdef NOCYGWIN
ERROR Unknown architecture type "$(ARCH)".
endif
-LINK_FLAGS = $(ARCH_LDFLAGS) $(NOCYGWIN) $(USER_LDFLAGS)
+LINK_FLAGS = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(NOCYGWIN) $(USER_LDFLAGS)
.DEFAULT:
$(BLD)/%.o: %.c
$(CC) $(CFLAGS) $(CC_OUT)$@ $<
+
+# arch-tag: 35eb9662-8534-4bcf-b891-0730a09d657f