X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/6da21b33f531d8e40ff3f8d57e41395a9cddb907..dd3eac7627ec2a623e10463087648e62f98a4307:/nt/gmake.defs diff --git a/nt/gmake.defs b/nt/gmake.defs index 96dd1f88eb..c3f20fbeab 100644 --- a/nt/gmake.defs +++ b/nt/gmake.defs @@ -1,26 +1,27 @@ +# -*- Makefile -*- definition file for building GNU Emacs on Windows NT. +# Copyright (c) 2000, 2001, 2002, 2003, 2004, +# 2005 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, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # Ensure 'all' is the default target 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 @@ -30,7 +31,7 @@ all: # 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 @@ -45,14 +46,14 @@ all: # 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 @@ -73,15 +74,27 @@ else USING_SH = 1 THE_SHELL = $(SHELL) SHELLTYPE=SH -SETLOADPATH=EMACSLOADPATH=$(CURDIR)/../lisp endif 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 @@ -101,8 +114,10 @@ ifndef INSTALL_DIR 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; # @@ -147,8 +162,8 @@ RC = windres -O coff RC_OUT = -o$(SPACE) RC_INCLUDE = --include-dir$(SPACE) -libc = -baselibs = +libc = +baselibs = O = o A = a @@ -161,13 +176,15 @@ MPR = -lmpr 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 @@ -222,9 +239,11 @@ DQUOTE = \" endif ifdef NODEBUG -DEBUG_FLAG = +DEBUG_FLAG = +DEBUG_LINK = else DEBUG_FLAG = -g +DEBUG_LINK = -g endif ifdef NOCYGWIN @@ -235,7 +254,7 @@ ifeq "$(ARCH)" "i386" ifdef NOOPT ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN) else -ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN) -mcpu=i686 -O2 \ +ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN) $(MCPU_FLAG) -O2 \ # -fbuiltin \ # -finline-functions \ # -fomit-frame-pointer @@ -245,9 +264,11 @@ else 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