# Makefile for Microsoft NMAKE
# Copyright (C) 1995 Board of Trustees, University of Illinois.
-# Copyright (C) 1995, 1996 Ben Wing.
+# Copyright (C) 1995, 1996, 2000, 2005 Ben Wing.
# Copyright (C) 1995 Sun Microsystems, Inc.
# Copyright (C) 1998 Free Software Foundation, Inc.
#
# Synched up with: Not in FSF.
#
-XEMACS=..
+default: all
+
+# APA: Since there seems to be no way to determine the directory where
+# xemacs.mak is located (from within nmake) we just insist on the user
+# to invoke nmake in the directory where xemacs.mak is.
+!if !exist("$(MAKEDIR)\xemacs.mak")
+!error Please run nmake from the directory of this makefile (xemacs\nt).
+!endif
+
+XEMACS=$(MAKEDIR)\..
LISP=$(XEMACS)\lisp
+LIB_SRC=$(XEMACS)\lib-src
MODULES=$(XEMACS)\modules
NT=$(XEMACS)\nt
OUTDIR=$(NT)\obj
+SRC=$(XEMACS)\src
+LWLIB_SRCDIR=$(XEMACS)\lwlib
+MAKEDIRSTRING=$(MAKEDIR:\=\\)
+XEMACSDIRSTRING=$(MAKEDIRSTRING:\\nt=)
+
+# Program name and version
+
+!include "$(XEMACS)\version.sh"
+
+# Put these before including config.inc so they can be overridden there.
+# Note that some versions of some commands are deficient.
-# Define a variable for the 'del' command to use
+# Define a variable for the 'del' command to use.
+# WinME's DEL command can only handle one argument and only has the /P flag.
+# So only delete one glob at a time. Override flags in config.inc.
DEL=-del
-# Program name and version
+# Tell COPY, MOVE, and XCOPY to suppress confirmation for overwriting
+# files.
+COPYCMD=/y
+# Define the 'copy' command to use.
+COPY=xcopy /q
+COPYDIR=xcopy /q /e
-!include "..\version.sh"
+!include "config.inc"
!if !defined(INFODOCK)
INFODOCK=0
PROGRAM_DEFINES=-DINFODOCK \
-DPATH_VERSION=\"$(INFODOCK_VERSION_STRING)\" \
-DPATH_PROGNAME=\"infodock\" \
+ -DEMACS_PROGNAME=\"infodock\" \
+ -DEMACS_VERSION=\"$(INFODOCK_VERSION_STRING)\" \
-DINFODOCK_MAJOR_VERSION=$(infodock_major_version) \
-DINFODOCK_MINOR_VERSION=$(infodock_minor_version) \
-DINFODOCK_BUILD_VERSION=$(infodock_build_version)
!else
+XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version)
!if "$(emacs_beta_version)" != ""
-XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version)-b$(emacs_beta_version)
+!if "$(emacs_is_beta)" != ""
+XEMACS_VERSION_STRING=$(XEMACS_VERSION_STRING)-b$(emacs_beta_version)
!else
-XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version)
+XEMACS_VERSION_STRING=$(XEMACS_VERSION_STRING).$(emacs_beta_version)
+!endif
!endif
PROGRAM_DEFINES= \
-DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" \
- -DPATH_PROGNAME=\"xemacs\"
+ -DPATH_PROGNAME=\"xemacs\" \
+ -DEMACS_VERSION=\"$(XEMACS_VERSION_STRING)\" \
+ -DEMACS_PROGNAME=\"xemacs\"
!endif
#
!if !defined(HAVE_MULE)
HAVE_MULE=0
!endif
+
+# If PACKAGE_PATH was defined, use it. If PACKAGE_PATH was not defined,
+# but PACKAGE_PREFIX was, use PACKAGE_PREFIX to generate a package path.
+# If neither PACKAGE_PATH nor PACKAGE_PREFIX was defined,
+# do not define a package path.
!if !defined(PACKAGE_PATH)
-! if !defined(PACKAGE_PREFIX)
-PACKAGE_PREFIX=c:\Program Files\XEmacs
-! endif
-! if $(HAVE_MULE)
+! if defined(PACKAGE_PREFIX)
+! if $(HAVE_MULE)
PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages
-! else
+! else
PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages
+! endif
! endif
!endif
+!if defined(PACKAGE_PATH)
PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)"
-!if !defined(HAVE_MSW)
-HAVE_MSW=1
!endif
-!if !defined(HAVE_X)
-HAVE_X=0
+
+!if !defined(HAVE_MS_WINDOWS)
+HAVE_MS_WINDOWS=1
+!endif
+!if !defined(HAVE_X_WINDOWS)
+HAVE_X_WINDOWS=0
!endif
!if !defined(HAVE_XPM)
HAVE_XPM=0
!if !defined(HAVE_PNG)
HAVE_PNG=0
!endif
+!if !defined(HAVE_ZLIB)
+HAVE_ZLIB=$(HAVE_PNG)
+!endif
!if !defined(HAVE_TIFF)
HAVE_TIFF=0
!endif
!if !defined(HAVE_GIF)
HAVE_GIF=1
!endif
+!if !defined(HAVE_GTK)
+HAVE_GTK=0
+!endif
!if !defined(HAVE_TOOLBARS)
HAVE_TOOLBARS=$(HAVE_XPM)
!endif
!if !defined(DEBUG_XEMACS)
DEBUG_XEMACS=0
!endif
+!if !defined(QUICK_BUILD)
+QUICK_BUILD=0
+!endif
!if !defined(USE_UNION_TYPE)
USE_UNION_TYPE=0
!endif
!if !defined(USE_MINITAR)
-USE_MINITAR=1
-!endif
-!if !defined(USE_MINIMAL_TAGBITS)
-USE_MINIMAL_TAGBITS=0
-!endif
-!if !defined(USE_INDEXED_LRECORD_IMPLEMENTATION)
-USE_INDEXED_LRECORD_IMPLEMENTATION=0
+USE_MINITAR=$(HAVE_ZLIB)
!endif
!if !defined(USE_PORTABLE_DUMPER)
-USE_PORTABLE_DUMPER=0
-!endif
-!if !defined(GUNG_HO)
-GUNG_HO=0
+USE_PORTABLE_DUMPER=1
!endif
# A little bit of adhockery. Default to use system malloc and
# DLL version of the C runtime library when using portable
# dumping. These are the optimal settings.
+#
+# NOTE: The various graphics libraries are generally compiled to use
+# MSVCRT.DLL (the same that we use in USE_CRTDLL, more or less), so using
+# this is a good thing.
+
!if !defined(USE_SYSTEM_MALLOC)
USE_SYSTEM_MALLOC=$(USE_PORTABLE_DUMPER)
!endif
!else
! error Unknown processor architecture type $(PROCESSOR_ARCHITECTURE)
!endif
+STACK_TRACE_EYE_CATCHER=$(XEMACS_VERSION_STRING:.=_)
+STACK_TRACE_EYE_CATCHER=xemacs_$(STACK_TRACE_EYE_CATCHER:-=_)_$(EMACS_CONFIGURATION:-=_)
+PROGRAM_DEFINES=$(PROGRAM_DEFINES) -DSTACK_TRACE_EYE_CATCHER=$(STACK_TRACE_EYE_CATCHER)
#
# Conf error checks
!message [[[Developer note: If you want to fix it, read Q112297 first]]] ####
CONFIG_ERROR=1
!endif
-!if !$(HAVE_MSW) && !$(HAVE_X)
-!message Please specify at least one HAVE_MSW=1 and/or HAVE_X=1
+!if !$(HAVE_MS_WINDOWS) && !$(HAVE_X_WINDOWS)
+!message Please specify at least one HAVE_MS_WINDOWS=1 and/or HAVE_X_WINDOWS=1
CONFIG_ERROR=1
!endif
-!if $(HAVE_X) && !defined(X11_DIR)
+!if $(HAVE_X_WINDOWS) && !defined(X11_DIR)
!message Please specify root directory for your X11 installation: X11_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_X) && defined(X11_DIR) && !exist("$(X11_DIR)\LIB\X11.LIB")
+!if $(HAVE_X_WINDOWS) && defined(X11_DIR) && !exist("$(X11_DIR)\LIB\X11.LIB")
!message Specified X11 directory does not contain "$(X11_DIR)\LIB\X11.LIB"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_XPM) && !defined(XPM_DIR)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_GTK) && !defined(GTK_DIR)
+!message Please specify root directory for your GTK installation: GTK_DIR=path
+CONFIG_ERROR=1
+!endif
+!if $(HAVE_MS_WINDOWS) && $(HAVE_XPM) && !defined(XPM_DIR)
!message Please specify root directory for your XPM installation: XPM_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_XPM) && defined(XPM_DIR) && !exist("$(XPM_DIR)\lib\Xpm.lib")
+!if $(HAVE_MS_WINDOWS) && $(HAVE_XPM) && defined(XPM_DIR) && !exist("$(XPM_DIR)\lib\Xpm.lib")
!message Specified XPM directory does not contain "$(XPM_DIR)\lib\Xpm.lib"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_PNG) && !defined(PNG_DIR)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && !defined(PNG_DIR)
!message Please specify root directory for your PNG installation: PNG_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_PNG) && defined(PNG_DIR) && !exist("$(PNG_DIR)\libpng.lib")
+!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && defined(PNG_DIR) && !exist("$(PNG_DIR)\libpng.lib")
!message Specified PNG directory does not contain "$(PNG_DIR)\libpng.lib"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_PNG) && !defined(ZLIB_DIR)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && !defined(ZLIB_DIR)
!message Please specify root directory for your ZLIB installation: ZLIB_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_PNG) && defined(ZLIB_DIR) && !exist("$(ZLIB_DIR)\zlib.lib")
+!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && defined(ZLIB_DIR) && !exist("$(ZLIB_DIR)\zlib.lib")
!message Specified ZLIB directory does not contain "$(ZLIB_DIR)\zlib.lib"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_TIFF) && !defined(TIFF_DIR)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_TIFF) && !defined(TIFF_DIR)
!message Please specify root directory for your TIFF installation: TIFF_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_TIFF) && !exist("$(TIFF_DIR)\libtiff\libtiff.lib")
+!if $(HAVE_MS_WINDOWS) && $(HAVE_TIFF) && !exist("$(TIFF_DIR)\libtiff\libtiff.lib")
!message Specified TIFF directory does not contain "$(TIFF_DIR)\libtiff\libtiff.lib"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_JPEG) && !defined(JPEG_DIR)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_JPEG) && !defined(JPEG_DIR)
!message Please specify root directory for your JPEG installation: JPEG_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_JPEG) && !exist("$(JPEG_DIR)\libjpeg.lib")
+!if $(HAVE_MS_WINDOWS) && $(HAVE_JPEG) && !exist("$(JPEG_DIR)\libjpeg.lib")
!message Specified JPEG directory does not contain "$(JPEG_DIR)\libjpeg.lib"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_XFACE) && !defined(COMPFACE_DIR)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_XFACE) && !defined(COMPFACE_DIR)
!message Please specify root directory for your COMPFACE installation: COMPFACE_DIR=path
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_XFACE) && !exist("$(COMPFACE_DIR)\libcompface.lib")
+!if $(HAVE_MS_WINDOWS) && $(HAVE_XFACE) && !exist("$(COMPFACE_DIR)\libcompface.lib")
!message Specified COMPFACE directory does not contain "$(COMPFACE_DIR)\libcompface.lib"
CONFIG_ERROR=1
!endif
-!if $(HAVE_MSW) && $(HAVE_TOOLBARS) && !$(HAVE_XPM)
+!if $(HAVE_MS_WINDOWS) && $(HAVE_TOOLBARS) && !$(HAVE_XPM)
!message Toolbars require XPM support
CONFIG_ERROR=1
!endif
!endif
#
-# Handle GUNG_HO
+# Whether to use dependency information generated by make-src-depend
#
-!if defined(GUNG_HO)
-USE_MINIMAL_TAGBITS=$(GUNG_HO)
-USE_INDEXED_LRECORD_IMPLEMENTATION=$(GUNG_HO)
+!if !defined(DEPEND)
+DEPEND=0
+!endif
+!if $(DEPEND) && exist("$(SRC)\depend")
+! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"]
+! endif
+# generate an nmake-readable version of depend
+# #### here, it doesn't seem to matter if we double ^'s!
+# results are the same with all single ^ and all double ^^!
+# see comment below.
+# #### Yuuuuuuuuuuck!!! Cygwin is too smart for its own good. If we are
+# being run from within Cygwin, a Cygwin Perl seems to require twice as
+# much backslash quoting. This does not happen, of course, with a non-
+# Cygwin Perl, so in that circumstance, you'd be screwed and would have
+# to fix this Makefile to not have a special Cygwin case.
+! if defined(_) || [perl -e "exit 1 if $$^O == 'cygwin';"]==1
+! if [perl -p -e "s/^\\x23if defined(.+)/!if defined$$1/; s/^\\x23e/!e/;" \
+ -e "s/([\\s=^])([\\w\\d\\.\\-^]+\\.[ch^])/$$1$(SRC:\=\\\\)\\\\$$2/g;" \
+ -e "s/^(.+)\\.o:(.+)/$(OUTDIR:\=\\\\)\\\\$$1.obj:$$2/;" \
+ < $(SRC)\depend > $(OUTDIR)\depend.tmp]
+! endif
+! else
+! if [perl -p -e "s/^\x23if defined(.+)/!if defined$$1/; s/^\x23e/!e/;" \
+ -e "s/([\s=^])([\w\d\.\-^]+\.[ch^])/$$1$(SRC:\=\\)\\$$2/g;" \
+ -e "s/^(.+)\.o:(.+)/$(OUTDIR:\=\\)\\$$1.obj:$$2/;" \
+ < $(SRC)\depend > $(OUTDIR)\depend.tmp]
+! endif
+! endif
+! include "$(OUTDIR)\depend.tmp"
+!else
+! if [echo WARNING: Compiling without dependency information.]
+! endif
+!endif
+
+!if $(USE_INTEL_COMPILER)
+CC=icl
+# Use static library if possible
+INTEL_LIBS=libircmt.lib libmmt.lib
+# Debugging requires DLL version of libm
+!if $(DEBUG_XEMACS)
+INTEL_LIBS=libircmt.lib libmmd.lib
+!endif
!endif
#
LIBC_LIB=libc.lib
!endif
-CFLAGS=-nologo -W3 $(OPT) $(C_LIBFLAG)
+CFLAGS_NO_LIB=-nologo -W3 $(OPT)
+CFLAGS=$(CFLAGS_NO_LIB) $(C_LIBFLAG)
-!if $(HAVE_X)
+!if $(HAVE_X_WINDOWS)
X_DEFINES=-DHAVE_X_WINDOWS
X_INCLUDES=-I$(X11_DIR)\include
X_LIBS=-libpath:$(X11_DIR)\lib Xaw.lib Xmu.lib Xt.lib SM.lib ICE.lib Xext.lib X11.lib
!endif
-!if $(HAVE_MSW)
+!if $(HAVE_MS_WINDOWS)
MSW_DEFINES=-DHAVE_MS_WINDOWS -DHAVE_SCROLLBARS -DHAVE_MENUBARS
MSW_INCLUDES=
MSW_LIBS=
!if $(HAVE_MSW_C_DIRED)
MSW_DEFINES=$(MSW_DEFINES) -DHAVE_MSW_C_DIRED
-MSW_C_DIRED_SRC=$(XEMACS)\src\dired-msw.c
+MSW_C_DIRED_SRC=$(SRC)\dired-msw.c
MSW_C_DIRED_OBJ=$(OUTDIR)\dired-msw.obj
!endif
!if $(HAVE_XPM)
!endif
!if $(HAVE_GIF)
MSW_DEFINES=$(MSW_DEFINES) -DHAVE_GIF
-MSW_GIF_SRC=$(XEMACS)\src\dgif_lib.c $(XEMACS)\src\gif_io.c
+MSW_GIF_SRC=$(SRC)\dgif_lib.c $(SRC)\gif_io.c
MSW_GIF_OBJ=$(OUTDIR)\dgif_lib.obj $(OUTDIR)\gif_io.obj
!endif
!if $(HAVE_PNG)
!endif
!if $(HAVE_TOOLBARS)
MSW_DEFINES=$(MSW_DEFINES) -DHAVE_TOOLBARS
-MSW_TOOLBAR_SRC=$(XEMACS)\src\toolbar.c $(XEMACS)\src\toolbar-msw.c
+MSW_TOOLBAR_SRC=$(SRC)\toolbar.c $(SRC)\toolbar-msw.c
MSW_TOOLBAR_OBJ=$(OUTDIR)\toolbar.obj $(OUTDIR)\toolbar-msw.obj
-MSW_LIBS=$(MSW_LIBS) comctl32.lib
!endif
!if $(HAVE_DIALOGS)
MSW_DEFINES=$(MSW_DEFINES) -DHAVE_DIALOGS
-MSW_DIALOG_SRC=$(XEMACS)\src\dialog.c $(XEMACS)\src\dialog-msw.c
+MSW_DIALOG_SRC=$(SRC)\dialog.c $(SRC)\dialog-msw.c
MSW_DIALOG_OBJ=$(OUTDIR)\dialog.obj $(OUTDIR)\dialog-msw.obj
!endif
!if $(HAVE_WIDGETS)
MSW_DEFINES=$(MSW_DEFINES) -DHAVE_WIDGETS
!endif
+!if $(HAVE_TOOLBARS) || $(HAVE_WIDGETS)
+MSW_LIBS=$(MSW_LIBS) comctl32.lib
+!endif
!if $(HAVE_NATIVE_SOUND)
MSW_DEFINES=$(MSW_DEFINES) -DHAVE_NATIVE_SOUND
!endif
DEBUG_FLAGS=-debug:full
!endif
-!if $(USE_MINIMAL_TAGBITS)
-TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS
-!endif
-!if $(USE_INDEXED_LRECORD_IMPLEMENTATION)
-LRECORD_DEFINES=-DUSE_INDEXED_LRECORD_IMPLEMENTATION
+!if $(QUICK_BUILD)
+QUICK_DEFINES=-DQUICK_BUILD
!endif
+
!if $(USE_UNION_TYPE)
UNION_DEFINES=-DUSE_UNION_TYPE
!endif
# Generic variables
-INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib
+INCLUDES=$(X_INCLUDES) -I$(NT)\inc -I$(SRC) $(MSW_INCLUDES) -I$(LWLIB_SRCDIR)
-DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \
- $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \
- $(DUMPER_DEFINES) $(MALLOC_DEFINES) \
- -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \
+DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) $(UNION_DEFINES) \
+ $(DUMPER_DEFINES) $(MALLOC_DEFINES) $(QUICK_DEFINES) \
+ -DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \
-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
#------------------------------------------------------------------------------
-default: $(OUTDIR)\nul all
-
$(OUTDIR)\nul:
-@mkdir $(OUTDIR)
XEMACS_INCLUDES=\
- $(XEMACS)\src\config.h \
- $(XEMACS)\src\Emacs.ad.h \
- $(XEMACS)\src\paths.h
+ $(SRC)\config.h \
+ $(SRC)\Emacs.ad.h \
+ $(SRC)\paths.h
-$(XEMACS)\src\config.h: config.h
- copy config.h $(XEMACS)\src
+# #### Copying is cheap, we should just force these
+$(SRC)\config.h: config.h
+ set COPYCMD=$(COPYCMD)
+ copy config.h $(SRC)
-$(XEMACS)\src\Emacs.ad.h: Emacs.ad.h
- copy Emacs.ad.h $(XEMACS)\src
+$(SRC)\Emacs.ad.h: Emacs.ad.h
+ set COPYCMD=$(COPYCMD)
+ copy Emacs.ad.h $(SRC)
-$(XEMACS)\src\paths.h: paths.h
- copy paths.h $(XEMACS)\src
+$(SRC)\paths.h: paths.h
+ set COPYCMD=$(COPYCMD)
+ copy paths.h $(SRC)
#------------------------------------------------------------------------------
# lib-src programs
-LIB_SRC = $(XEMACS)\lib-src
-LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32 -DWINDOWSNT
+LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE
#
# Creating config.values to be used by config.el
!endif
!if [echo LISPDIR>>$(CONFIG_VALUES) && echo "$(MAKEDIR:\=\\)\\$(LISP:\=\\)">>$(CONFIG_VALUES)]
!endif
+!if defined(PATH_PACKAGEPATH)
# PATH_PACKAGEPATH is already a quoted string.
-!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+! if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+! endif
!endif
# Inferred rule
{$(LIB_SRC)}.c{$(LIB_SRC)}.exe :
cd $(LIB_SRC)
- $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no
+ $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no setargv.obj
cd $(NT)
# Individual dependencies
cd $(LIB_SRC)
$(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** wsock32.lib -link -incremental:no
cd $(NT)
-$(LIB_SRC)/minitar.exe : $(NT)/minitar.mak $(NT)/minitar.c
- nmake -nologo -f minitar.mak ZLIB="$(ZLIB_DIR)" NT="$(NT)" LIB_SRC="$(LIB_SRC)"
+
+$(LIB_SRC)/winclient.exe: $(LIB_SRC)/winclient.c
+ cd $(LIB_SRC)
+ $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** user32.lib -link -incremental:no
+ cd $(NT)
+
+$(LIB_SRC)/minitar.exe : $(NT)/minitar.c
+ $(CCV) $(CFLAGS_NO_LIB) -I"$(ZLIB_DIR)" $(LIB_SRC_DEFINES) -MD -Fe$@ $** $(ZLIB_DIR)\zlib.lib -link -incremental:no
LIB_SRC_TOOLS = \
- $(LIB_SRC)/make-docfile.exe \
+ $(LIB_SRC)/etags.exe \
$(LIB_SRC)/hexl.exe \
- $(LIB_SRC)/movemail.exe \
+ $(LIB_SRC)/i.exe \
+ $(LIB_SRC)/winclient.exe \
+ $(LIB_SRC)/make-docfile.exe \
$(LIB_SRC)/mmencode.exe \
+ $(LIB_SRC)/movemail.exe \
$(LIB_SRC)/sorted-doc.exe \
- $(LIB_SRC)/wakeup.exe \
- $(LIB_SRC)/etags.exe
+ $(LIB_SRC)/wakeup.exe
!if $(USE_MINITAR)
LIB_SRC_TOOLS = \
$(LIB_SRC_TOOLS) \
$(LIB_SRC)/minitar.exe
!endif
+!if $(USE_PORTABLE_DUMPER)
+LIB_SRC_TOOLS = \
+ $(XEMACS_INCLUDES) \
+ $(LIB_SRC)/make-dump-id.exe \
+ $(LIB_SRC_TOOLS)
+!endif
# Shorthand target
minitar: $(LIB_SRC)/minitar.exe
#------------------------------------------------------------------------------
-# runxemacs proglet
-
-RUNEMACS = $(XEMACS)\src\runxemacs.exe
+# dump-id.c file that contains the dump id
-$(RUNEMACS): $(LIB_SRC)\run.c $(LIB_SRC)\run.res
- $(CCV) -I$(LIB_SRC) $(CFLAGS) -Fe$@ -Fo$(LIB_SRC) -Fd$(LIB_SRC)\ $** kernel32.lib user32.lib -link -incremental:no
-
-$(LIB_SRC)\run.res: $(LIB_SRC)\run.rc
- rc -I$(LIB_SRC) -Fo$@ $**
+$(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe
+ cd $(SRC)
+ $(LIB_SRC)\make-dump-id.exe
+ cd $(NT)
#------------------------------------------------------------------------------
!if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER)
LASTFILE=$(OUTDIR)\lastfile.lib
-LASTFILE_SRC=$(XEMACS)\src
+LASTFILE_SRC=$(SRC)
LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c
LASTFILE_OBJS= \
$(OUTDIR)\lastfile.obj
#------------------------------------------------------------------------------
-!if $(HAVE_X)
+!if $(HAVE_X_WINDOWS)
# LWLIB Library
LWLIB=$(OUTDIR)\lwlib.lib
-LWLIB_SRC=$(XEMACS)\lwlib
LWLIB_FLAGS=$(CFLAGS) $(INCLUDES) $(DEFINES) \
-DNEED_ATHENA -DNEED_LUCID \
-D_WINDOWS -DMENUBARS_LUCID -DSCROLLBARS_LUCID -DDIALOGS_ATHENA \
$(LWLIB): $(LWLIB_OBJS)
link.exe -lib -nologo -out:$@ $(LWLIB_OBJS)
-$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRC)\lwlib-config.c
+$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRCDIR)\lwlib-config.c
$(CCV) $(LWLIB_FLAGS) $**
-$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRC)\lwlib-utils.c
+$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRCDIR)\lwlib-utils.c
$(CCV) $(LWLIB_FLAGS) $**
-$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRC)\lwlib-Xaw.c
+$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRCDIR)\lwlib-Xaw.c
$(CCV) $(LWLIB_FLAGS) $**
-$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRC)\lwlib-Xlw.c
+$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRCDIR)\lwlib-Xlw.c
$(CCV) $(LWLIB_FLAGS) $**
-$(OUTDIR)\lwlib.obj: $(LWLIB_SRC)\lwlib.c
+$(OUTDIR)\lwlib.obj: $(LWLIB_SRCDIR)\lwlib.c
$(CCV) $(LWLIB_FLAGS) $**
-$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRC)\xlwmenu.c
+$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRCDIR)\xlwmenu.c
$(CCV) $(LWLIB_FLAGS) $**
-$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRC)\xlwscrollbar.c
+$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRCDIR)\xlwscrollbar.c
$(CCV) $(LWLIB_FLAGS) $**
!endif
DOC=$(LIB_SRC)\DOC
DOC_SRC1=\
- $(XEMACS)\src\abbrev.c \
- $(XEMACS)\src\alloc.c \
- $(XEMACS)\src\alloca.c \
- $(XEMACS)\src\blocktype.c \
- $(XEMACS)\src\buffer.c \
- $(XEMACS)\src\bytecode.c \
- $(XEMACS)\src\callint.c \
- $(XEMACS)\src\callproc.c \
- $(XEMACS)\src\casefiddle.c \
- $(XEMACS)\src\casetab.c \
- $(XEMACS)\src\chartab.c \
- $(XEMACS)\src\cmdloop.c \
- $(XEMACS)\src\cmds.c \
- $(XEMACS)\src\console-stream.c \
- $(XEMACS)\src\console.c \
- $(XEMACS)\src\data.c \
- $(XEMACS)\src\device.c
+ $(SRC)\abbrev.c \
+ $(SRC)\alloc.c \
+ $(SRC)\blocktype.c \
+ $(SRC)\buffer.c \
+ $(SRC)\bytecode.c \
+ $(SRC)\callint.c \
+ $(SRC)\callproc.c \
+ $(SRC)\casefiddle.c \
+ $(SRC)\casetab.c \
+ $(SRC)\chartab.c \
+ $(SRC)\cmdloop.c \
+ $(SRC)\cmds.c \
+ $(SRC)\console-stream.c \
+ $(SRC)\console.c \
+ $(SRC)\data.c \
+ $(SRC)\device.c
DOC_SRC2=\
- $(XEMACS)\src\dired.c \
- $(XEMACS)\src\doc.c \
- $(XEMACS)\src\doprnt.c \
- $(XEMACS)\src\dragdrop.c \
- $(XEMACS)\src\dynarr.c \
- $(XEMACS)\src\editfns.c \
- $(XEMACS)\src\elhash.c \
- $(XEMACS)\src\emacs.c \
- $(XEMACS)\src\eval.c \
- $(XEMACS)\src\event-stream.c \
- $(XEMACS)\src\events.c \
- $(XEMACS)\src\extents.c \
- $(XEMACS)\src\faces.c \
- $(XEMACS)\src\file-coding.c \
- $(XEMACS)\src\fileio.c \
- $(XEMACS)\src\filemode.c \
- $(XEMACS)\src\floatfns.c \
- $(XEMACS)\src\fns.c
+ $(SRC)\dired.c \
+ $(SRC)\doc.c \
+ $(SRC)\doprnt.c \
+ $(SRC)\dragdrop.c \
+ $(SRC)\dynarr.c \
+ $(SRC)\editfns.c \
+ $(SRC)\elhash.c \
+ $(SRC)\emacs.c \
+ $(SRC)\eval.c \
+ $(SRC)\event-stream.c \
+ $(SRC)\events.c \
+ $(SRC)\extents.c \
+ $(SRC)\faces.c \
+ $(SRC)\file-coding.c \
+ $(SRC)\fileio.c \
+ $(SRC)\filemode.c \
+ $(SRC)\floatfns.c \
+ $(SRC)\fns.c
DOC_SRC3=\
- $(XEMACS)\src\font-lock.c \
- $(XEMACS)\src\frame.c \
- $(XEMACS)\src\general.c \
- $(XEMACS)\src\glyphs.c \
- $(XEMACS)\src\glyphs-eimage.c \
- $(XEMACS)\src\glyphs-widget.c \
- $(XEMACS)\src\gui.c \
- $(XEMACS)\src\gutter.c \
- $(XEMACS)\src\hash.c \
- $(XEMACS)\src\imgproc.c \
- $(XEMACS)\src\indent.c \
- $(XEMACS)\src\insdel.c \
- $(XEMACS)\src\intl.c \
- $(XEMACS)\src\keymap.c \
- $(XEMACS)\src\line-number.c \
- $(XEMACS)\src\lread.c \
- $(XEMACS)\src\lstream.c \
- $(XEMACS)\src\macros.c \
- $(XEMACS)\src\marker.c
+ $(SRC)\font-lock.c \
+ $(SRC)\frame.c \
+ $(SRC)\general.c \
+ $(SRC)\getloadavg.c \
+ $(SRC)\glyphs.c \
+ $(SRC)\glyphs-eimage.c \
+ $(SRC)\glyphs-widget.c \
+ $(SRC)\gui.c \
+ $(SRC)\gutter.c \
+ $(SRC)\hash.c \
+ $(SRC)\imgproc.c \
+ $(SRC)\indent.c \
+ $(SRC)\insdel.c \
+ $(SRC)\intl.c \
+ $(SRC)\keymap.c \
+ $(SRC)\line-number.c \
+ $(SRC)\lread.c \
+ $(SRC)\lstream.c \
+ $(SRC)\macros.c \
+ $(SRC)\marker.c
DOC_SRC4=\
- $(XEMACS)\src\md5.c \
- $(XEMACS)\src\menubar.c \
- $(XEMACS)\src\minibuf.c \
- $(XEMACS)\src\nt.c \
- $(XEMACS)\src\ntplay.c \
- $(XEMACS)\src\ntproc.c \
- $(XEMACS)\src\objects.c \
- $(XEMACS)\src\opaque.c \
- $(XEMACS)\src\print.c \
- $(XEMACS)\src\process.c \
- $(XEMACS)\src\process-nt.c \
- $(XEMACS)\src\profile.c \
- $(XEMACS)\src\rangetab.c \
- $(XEMACS)\src\realpath.c \
- $(XEMACS)\src\redisplay-output.c \
- $(XEMACS)\src\redisplay.c \
- $(XEMACS)\src\regex.c \
- $(XEMACS)\src\scrollbar.c \
- $(XEMACS)\src\search.c \
- $(XEMACS)\src\select.c \
- $(XEMACS)\src\signal.c \
- $(XEMACS)\src\sound.c
+ $(SRC)\md5.c \
+ $(SRC)\menubar.c \
+ $(SRC)\minibuf.c \
+ $(SRC)\nt.c \
+ $(SRC)\ntplay.c \
+ $(SRC)\ntproc.c \
+ $(SRC)\objects.c \
+ $(SRC)\opaque.c \
+ $(SRC)\print.c \
+ $(SRC)\process.c \
+ $(SRC)\process-nt.c \
+ $(SRC)\profile.c \
+ $(SRC)\rangetab.c \
+ $(SRC)\realpath.c \
+ $(SRC)\redisplay-output.c \
+ $(SRC)\redisplay.c \
+ $(SRC)\regex.c \
+ $(SRC)\scrollbar.c \
+ $(SRC)\search.c \
+ $(SRC)\select.c \
+ $(SRC)\signal.c \
+ $(SRC)\sound.c
DOC_SRC5=\
- $(XEMACS)\src\specifier.c \
- $(XEMACS)\src\strftime.c \
- $(XEMACS)\src\symbols.c \
- $(XEMACS)\src\syntax.c \
- $(XEMACS)\src\sysdep.c \
- $(XEMACS)\src\termcap.c \
- $(XEMACS)\src\tparam.c \
- $(XEMACS)\src\undo.c \
- $(XEMACS)\src\window.c \
- $(XEMACS)\src\widget.c
-
-!if $(HAVE_X)
+ $(SRC)\specifier.c \
+ $(SRC)\strftime.c \
+ $(SRC)\symbols.c \
+ $(SRC)\syntax.c \
+ $(SRC)\sysdep.c \
+ $(SRC)\termcap.c \
+ $(SRC)\tparam.c \
+ $(SRC)\undo.c \
+ $(SRC)\window.c \
+ $(SRC)\win32.c \
+ $(SRC)\widget.c
+
+!if $(HAVE_X_WINDOWS)
DOC_SRC6=\
- $(XEMACS)\src\balloon_help.c \
- $(XEMACS)\src\console-x.c \
- $(XEMACS)\src\device-x.c \
- $(XEMACS)\src\dialog-x.c \
- $(XEMACS)\src\EmacsFrame.c \
- $(XEMACS)\src\EmacsManager.c \
- $(XEMACS)\src\EmacsShell-sub.c\
- $(XEMACS)\src\EmacsShell.c \
- $(XEMACS)\src\event-Xt.c \
- $(XEMACS)\src\frame-x.c \
- $(XEMACS)\src\glyphs-x.c \
- $(XEMACS)\src\gui-x.c \
- $(XEMACS)\src\menubar.c \
- $(XEMACS)\src\menubar-x.c \
- $(XEMACS)\src\objects-x.c \
- $(XEMACS)\src\redisplay-x.c \
- $(XEMACS)\src\scrollbar-x.c \
- $(XEMACS)\src\balloon-x.c \
- $(XEMACS)\src\xgccache.c \
- $(XEMACS)\src\xmu.c \
- $(XEMACS)\src\select-x.c
-!endif
-
-!if $(HAVE_MSW)
+ $(SRC)\balloon_help.c \
+ $(SRC)\console-x.c \
+ $(SRC)\device-x.c \
+ $(SRC)\dialog-x.c \
+ $(SRC)\EmacsFrame.c \
+ $(SRC)\EmacsManager.c \
+ $(SRC)\EmacsShell-sub.c\
+ $(SRC)\EmacsShell.c \
+ $(SRC)\event-Xt.c \
+ $(SRC)\frame-x.c \
+ $(SRC)\glyphs-x.c \
+ $(SRC)\gui-x.c \
+ $(SRC)\menubar.c \
+ $(SRC)\menubar-x.c \
+ $(SRC)\objects-x.c \
+ $(SRC)\redisplay-x.c \
+ $(SRC)\scrollbar-x.c \
+ $(SRC)\balloon-x.c \
+ $(SRC)\xgccache.c \
+ $(SRC)\xmu.c \
+ $(SRC)\select-x.c
+!endif
+
+!if $(HAVE_MS_WINDOWS)
DOC_SRC7=\
- $(XEMACS)\src\console-msw.c \
- $(XEMACS)\src\device-msw.c \
- $(XEMACS)\src\event-msw.c \
- $(XEMACS)\src\frame-msw.c \
- $(XEMACS)\src\glyphs-msw.c \
- $(XEMACS)\src\gui-msw.c \
- $(XEMACS)\src\menubar-msw.c \
- $(XEMACS)\src\objects-msw.c \
- $(XEMACS)\src\redisplay-msw.c \
- $(XEMACS)\src\scrollbar-msw.c \
- $(XEMACS)\src\select-msw.c \
+ $(SRC)\console-msw.c \
+ $(SRC)\device-msw.c \
+ $(SRC)\event-msw.c \
+ $(SRC)\frame-msw.c \
+ $(SRC)\glyphs-msw.c \
+ $(SRC)\gui-msw.c \
+ $(SRC)\menubar-msw.c \
+ $(SRC)\objects-msw.c \
+ $(SRC)\redisplay-msw.c \
+ $(SRC)\scrollbar-msw.c \
+ $(SRC)\select-msw.c \
$(MSW_C_DIRED_SRC) \
$(MSW_TOOLBAR_SRC) \
$(MSW_DIALOG_SRC) \
!if $(HAVE_MULE)
DOC_SRC8=\
- $(XEMACS)\src\mule.c \
- $(XEMACS)\src\mule-charset.c \
- $(XEMACS)\src\mule-ccl.c
-! if $(HAVE_X)
- DOC_SRC8=$(DOC_SRC8) $(XEMACS)\src\input-method-xlib.c
+ $(SRC)\mule.c \
+ $(SRC)\mule-charset.c \
+ $(SRC)\mule-ccl.c
+! if $(HAVE_X_WINDOWS)
+ DOC_SRC8=$(DOC_SRC8) $(SRC)\input-method-xlib.c
! endif
!endif
!if $(DEBUG_XEMACS)
DOC_SRC9=\
- $(XEMACS)\src\debug.c \
- $(XEMACS)\src\tests.c
+ $(SRC)\debug.c \
+ $(SRC)\tests.c
!endif
!if !$(USE_SYSTEM_MALLOC)
DOC_SRC10=\
- $(XEMACS)\src\free-hook.c \
- $(XEMACS)\src\gmalloc.c \
- $(XEMACS)\src\ntheap.c \
- $(XEMACS)\src\vm-limit.c
+ $(SRC)\free-hook.c \
+ $(SRC)\gmalloc.c \
+ $(SRC)\ntheap.c \
+ $(SRC)\vm-limit.c
!endif
!if !$(USE_PORTABLE_DUMPER)
DOC_SRC11=\
- $(XEMACS)\src\unexnt.c
+ $(SRC)\unexnt.c
+!else
+DOC_SRC11=\
+ $(SRC)\dumper.c
!endif
#------------------------------------------------------------------------------
# This may not exist
!if "$(emacs_beta_version)" != ""
+!if "$(emacs_is_beta)" != ""
EMACS_BETA_VERSION=-DEMACS_BETA_VERSION=$(emacs_beta_version)
-!ENDIF
+!else
+EMACS_PATCH_LEVEL=-DEMACS_PATCH_LEVEL=$(emacs_beta_version)
+!endif
+!endif
!if !$(USE_PORTABLE_DUMPER)
-TEMACS_ENTRYPOINT=-entry:_start
+TEMACS_ENTRYPOINT=-entry:_start
+!else
+TEMACS_ENTRYPOINT=-entry:mainCRTStartup
!endif
-TEMACS_DIR=$(XEMACS)\src
+TEMACS_DIR=$(SRC)
TEMACS=$(TEMACS_DIR)\temacs.exe
TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc
-TEMACS_SRC=$(XEMACS)\src
+TEMACS_SRC=$(SRC)
TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \
- oldnames.lib kernel32.lib user32.lib gdi32.lib advapi32.lib \
- shell32.lib wsock32.lib winmm.lib winspool.lib $(LIBC_LIB)
+ oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib \
+ shell32.lib wsock32.lib winmm.lib winspool.lib ole32.lib uuid.lib \
+ $(INTEL_LIBS) $(LIBC_LIB)
TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\
- -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:console\
+ -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\
-pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \
- -heap:0x00100000 -out:$@ -nodefaultlib
+ -heap:0x00100000 -nodefaultlib -incremental:no setargv.obj
TEMACS_CPP_FLAGS=-c \
$(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \
-DEMACS_MAJOR_VERSION=$(emacs_major_version) \
-DEMACS_MINOR_VERSION=$(emacs_minor_version) \
$(EMACS_BETA_VERSION) \
- -DXEMACS_CODENAME=\"$(xemacs_codename)\" \
- -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \
- -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
+ $(EMACS_PATCH_LEVEL) \
+ -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \
+!if defined(PATH_PACKAGEPATH)
+ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" \
+!endif
+ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\"
-!if $(HAVE_X)
+!if $(HAVE_X_WINDOWS)
TEMACS_X_OBJS=\
$(OUTDIR)\balloon-x.obj \
$(OUTDIR)\balloon_help.obj \
$(OUTDIR)\select-x.obj
!endif
-!if $(HAVE_MSW)
+!if $(HAVE_MS_WINDOWS)
TEMACS_MSW_OBJS=\
$(OUTDIR)\console-msw.obj \
$(OUTDIR)\device-msw.obj \
$(OUTDIR)\mule.obj \
$(OUTDIR)\mule-charset.obj \
$(OUTDIR)\mule-ccl.obj
-! if $(HAVE_X)
+! if $(HAVE_X_WINDOWS)
TEMACS_MULE_OBJS=\
$(TEMACS_MULE_OBJS) $(OUTDIR)\input-method-xlib.obj
! endif
!if !$(USE_PORTABLE_DUMPER)
TEMACS_DUMP_OBJS=\
$(OUTDIR)\unexnt.obj
+!else
+TEMACS_DUMP_OBJS=\
+ $(OUTDIR)\dumper.obj
!endif
TEMACS_OBJS= \
$(TEMACS_DUMP_OBJS)\
$(OUTDIR)\abbrev.obj \
$(OUTDIR)\alloc.obj \
- $(OUTDIR)\alloca.obj \
$(OUTDIR)\blocktype.obj \
$(OUTDIR)\buffer.obj \
$(OUTDIR)\bytecode.obj \
$(OUTDIR)\font-lock.obj \
$(OUTDIR)\frame.obj \
$(OUTDIR)\general.obj \
+ $(OUTDIR)\getloadavg.obj \
$(OUTDIR)\glyphs.obj \
$(OUTDIR)\glyphs-eimage.obj \
$(OUTDIR)\glyphs-widget.obj \
$(OUTDIR)\undo.obj \
$(OUTDIR)\widget.obj \
$(OUTDIR)\window.obj \
- $(OUTDIR)\xemacs.res
+ $(OUTDIR)\win32.obj
# Rules
$(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@
!endif
+$(OUTDIR)\emacs.obj: $(XEMACS)\version.sh
+
$(OUTDIR)\TopLevelEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c
$(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $** -Fo$@
#$(TEMACS_SRC)\paths.h: $(TEMACS_SRC)\paths.h.in
# !"cd $(TEMACS_SRC); cp paths.h.in paths.h"
-$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS)
+$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) $(OUTDIR)\xemacs.res
!if $(DEBUG_XEMACS)
@dir /b/s $(OUTDIR)\*.sbr > bscmake.tmp
bscmake -nologo -o$(TEMACS_BROWSE) @bscmake.tmp
- @$(DEL) bscmake.tmp
+ $(DEL) bscmake.tmp
!endif
!if $(USE_PORTABLE_DUMPER)
- @if exist $(TEMACS_DIR)\xemacs.dmp del $(TEMACS_DIR)\xemacs.dmp
-!endif
+ @if exist $(SRC)\dump-id.c del $(SRC)\dump-id.c
+# make a new dump id file. There is probably a better way to do this, but this works
+ @if exist $(OUTDIR)\dump-id.obj del $(OUTDIR)\dump-id.obj
+ nmake -nologo -f xemacs.mak OUTDIR=$(OUTDIR) $(OUTDIR)\dump-id.obj
+ link.exe @<<
+ $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj
+<<
+!else
link.exe @<<
- $(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS)
+ $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS)
<<
+!endif
$(OUTDIR)\xemacs.res: xemacs.rc
rc -Fo$@ xemacs.rc
+
+PROGNAME=$(SRC)\xemacs.exe
+TEMACS_BATCH="$(LIB_SRC)\i" "$(TEMACS)" -batch
+XEMACS_BATCH="$(LIB_SRC)\i" "$(PROGNAME)" -vanilla -batch
+
# Section handling automated tests starts here
-SRCDIR=$(MAKEDIR)\..\src
-PROGNAME=$(SRCDIR)\xemacs.exe
blddir=$(MAKEDIR:\=\\)\\..
-temacs_loadup=$(TEMACS) -batch -l $(SRCDIR)/../lisp/loadup.el
+temacs_loadup=$(TEMACS_BATCH) -l $(LISP)/loadup.el
dump_temacs = $(temacs_loadup) dump
run_temacs = $(temacs_loadup) run-temacs
## We have automated tests!!
# .PHONY: check check-temacs
check:
- cd $(SRCDIR)
+ cd $(SRC)
$(PROGNAME) $(batch_test_emacs)
check-temacs:
- cd $(SRCDIR)
+ cd $(SRC)
set EMACSBOOTSTRAPLOADPATH=$(LISP)
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
$(run_temacs) $(batch_test_emacs)
# Section handling automated tests ends here
+# Section handling tags starts here
+
+tagslisp=lisp
+
+tags:
+ @echo If you don't have a copy of etags around, then do 'make lib-src' first.
+ @echo To make use of the tags file, put the following in your .emacs:
+ @echo (setq tag-table-alist
+ @echo '(("$(XEMACSDIRSTRING)\\" . "$(XEMACSDIRSTRING)\\")))
+ cd $(XEMACS)
+ $(DEL) TAGS
+ set PATH=lib-src;%PATH%
+# we need to double ^, but only before backslash! Doubling it elsewhere
+# causes problems. I don't understand this -- CMD.EXE uses ^ as a quoting
+# convention of sorts, but appears to leave it alone inside of double quotes,
+# even before \. Could this be nmake interference?
+ etags -a -r "/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*\"\([^^\"]+\)\"/\2/" src\*.c src\*.h lwlib\*.c lwlib\*.h lib-src\*.c lib-src\*.h
+ etags -a -l none -r "/^(def\(var\|un\|alias\|const\|macro\|subst\|struct\|face\|group\|custom\|ine-\(function\|compiler-macro\|[a-z-]+alias\)\)[ ]+'?\([^ ]+\)/\3/" $(tagslisp)\*.el
+
+# Section handling tags ends here
+
# Section handling info starts here
!if !defined(MAKEINFO)
-MAKEINFO=$(PROGNAME) -vanilla -batch -l texinfmt -f batch-texinfo-format
+MAKEINFO=$(XEMACS_BATCH) -l texinfmt -f batch-texinfo-format
!endif
MANDIR = $(XEMACS)\man
{$(MANDIR)}.texi{$(INFODIR)}.info:
cd $(MANDIR)
- $(MAKEINFO) $**
+ $(MAKEINFO) $(**F)
XEMACS_SRCS = \
$(MANDIR)\xemacs\abbrevs.texi \
@<<makeinfo_test.bat
@echo off
if exist "$(MAKEINFO)" goto test_done
-@"$(PROGNAME)" -batch -vanilla -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
+@$(XEMACS_BATCH) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
@if not errorlevel 1 goto suggest_makeinfo
-@echo XEmacs `info' cannot be built!
-@echo Install XEmacs package `texinfo' (see README.packages).
+@echo XEmacs 'info' cannot be built!
+@echo Install XEmacs package 'texinfo' (see README.packages).
:suggest_makeinfo
@echo Consider specifying path to makeinfo program: MAKEINFO=path
-@echo as this will build info docs faster than XEmacs using `texinfo'.
+@echo as this will build info docs faster than XEmacs using 'texinfo'.
@if errorlevel 1 exit 1
:test_done
<<NOKEEP
if exist $(DOC) del $(DOC)
docfile :: $(DOC)
-$(DOC): $(LIB_SRC)\make-docfile.exe
+$(DOC): $(LIB_SRC)\make-docfile.exe $(DOC_SRC1) $(DOC_SRC2) $(DOC_SRC3) $(DOC_SRC4) $(DOC_SRC5) $(DOC_SRC6) $(DOC_SRC7) $(DOC_SRC8) $(DOC_SRC9) $(DOC_SRC10) $(DOC_SRC11)
if exist $(DOC) del $(DOC)
+!if defined(PACKAGE_PATH)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+ set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
- $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
+ $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC1)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC2)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC3)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC11)
update-elc:
+!if defined(PACKAGE_PATH)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+ set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
- $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\update-elc.el
+ $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\update-elc.el
+
+# This file is touched by update-elc.el when redumping is necessary.
+$(TEMACS_DIR)\NEEDTODUMP :
+ @echo >$(TEMACS_DIR)\NEEDTODUMP
# This rule dumps xemacs and then possibly spawns sub-make if PURESPACE
# requirements have changed.
-dump-xemacs: temacs
+
+$(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
@echo >$(TEMACS_DIR)\SATISFIED
cd $(TEMACS_DIR)
+!if defined(PACKAGE_PATH)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+ set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
- -1 $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\loadup.el dump
+ $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump
!if $(USE_PORTABLE_DUMPER)
- copy temacs.exe xemacs.exe
+ rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc
+ link.exe @<<
+ $(TEMACS_LFLAGS) -out:xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj
+<<
+# Make the resource section read/write since almost all of it is the dump
+# data which needs to be writable. This avoids having to copy it.
+ editbin -nologo -stack:0x800000 -section:.rsrc,rw xemacs.exe
+ $(DEL) $(TEMACS_DIR)\xemacs.dmp
+!else
+ editbin -nologo -stack:0x800000 xemacs.exe
!endif
cd $(NT)
@if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@
#------------------------------------------------------------------------------
# use this rule to build the complete system
-all: $(XEMACS)\Installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \
- $(LIB_SRC_TOOLS) $(RUNEMACS) $(TEMACS) update-elc $(DOC) dump-xemacs \
- $(LISP)/auto-autoloads.el $(LISP)/custom-load.el info
+all: installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \
+ $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \
+ update-elc-2 update-auto-and-custom info
temacs: $(LASTFILE) $(TEMACS)
# use this rule to install the system
install: all
cd $(NT)
+ set COPYCMD=$(COPYCMD)
@echo Installing in $(INSTALL_DIR) ...
@echo PlaceHolder > PlaceHolder
@xcopy /q PROBLEMS "$(INSTALL_DIR)\"
@xcopy /q PlaceHolder "$(INSTALL_DIR)\lock\"
- @$(DEL) "$(INSTALL_DIR)\lock\PlaceHolder"
+ $(DEL) "$(INSTALL_DIR)\lock\PlaceHolder"
@xcopy /q $(LIB_SRC)\*.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)\"
@copy $(LIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
@copy $(CONFIG_VALUES) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
- @copy $(XEMACS)\src\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
-!if $(USE_PORTABLE_DUMPER)
- @copy $(XEMACS)\src\xemacs.dmp "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
-!endif
- @copy $(RUNEMACS) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
+ @copy $(SRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
@xcopy /e /q $(XEMACS)\etc "$(INSTALL_DIR)\etc\"
@xcopy /e /q $(XEMACS)\info "$(INSTALL_DIR)\info\"
@xcopy /e /q $(XEMACS)\lisp "$(INSTALL_DIR)\lisp\"
+!if defined(PACKAGE_PREFIX)
@echo Making skeleton package tree in $(PACKAGE_PREFIX) ...
@xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\site-packages\"
- @$(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder"
+ $(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder"
@xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\mule-packages\"
- @$(DEL) "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder"
+ $(DEL) "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder"
@xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\xemacs-packages\"
- @$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
- @$(DEL) PlaceHolder
-
-distclean:
- $(DEL) *.bak
- $(DEL) *.orig
- $(DEL) *.rej
- $(DEL) *.tmp
+ $(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
+!endif
+ $(DEL) PlaceHolder
+
+mostlyclean:
$(DEL) $(XEMACS)\Installation
- cd $(OUTDIR)
- $(DEL) *.lib
- $(DEL) *.obj
- $(DEL) *.pdb
- $(DEL) *.res
- $(DEL) *.sbr
- cd $(XEMACS)\$(TEMACS_DIR)
- $(DEL) config.h
- $(DEL) paths.h
- $(DEL) Emacs.ad.h
- $(DEL) *.bak
- $(DEL) *.orig
- $(DEL) *.rej
- $(DEL) *.exe
- $(DEL) *.map
- $(DEL) *.bsc
- $(DEL) *.pdb
- cd $(LIB_SRC)
- $(DEL) DOC
- $(DEL) *.bak
- $(DEL) *.orig
- $(DEL) *.rej
- $(DEL) *.exe
- $(DEL) *.obj
- $(DEL) *.pdb
- $(DEL) *.res
+ $(DEL) $(OUTDIR)\*.lib
+ $(DEL) $(OUTDIR)\*.obj
+ $(DEL) $(OUTDIR)\*.pdb
+ $(DEL) $(OUTDIR)\*.res
+ $(DEL) $(OUTDIR)\*.sbr
+ $(DEL) $(SRC)\*.exe
+ $(DEL) $(SRC)\*.map
+ $(DEL) $(SRC)\*.bsc
+ $(DEL) $(SRC)\*.pdb
+ $(DEL) $(LIB_SRC)\*.exe
+ $(DEL) $(LIB_SRC)\*.obj
+ $(DEL) $(LIB_SRC)\*.pdb
+ $(DEL) $(LIB_SRC)\*.res
+
+clean: mostlyclean versionclean
+ $(DEL) $(XEMACS)\TAGS
+
+nicenclean: clean
+ $(DEL) $(NT)\*.bak
+ $(DEL) $(NT)\*.orig
+ $(DEL) $(NT)\*.rej
+ $(DEL) $(NT)\*.tmp
+ $(DEL) $(LIB_SRC)\*.bak
+ $(DEL) $(LIB_SRC)\*.orig
+ $(DEL) $(LIB_SRC)\*.rej
+ $(DEL) $(LIB_SRC)\*.tmp
+ $(DEL) $(SRC)\*.bak
+ $(DEL) $(SRC)\*.orig
+ $(DEL) $(SRC)\*.rej
+ $(DEL) $(SRC)\*.tmp
+ $(DEL) $(LISP)\*.bak
+ $(DEL) $(LISP)\*.orig
+ $(DEL) $(LISP)\*.rej
+ $(DEL) $(LISP)\*.tmp
+
+## This is used in making a distribution.
+## Do not use it on development directories!
+distclean: nicenclean
+ $(DEL) $(SRC)\config.h
+ $(DEL) $(SRC)\paths.h
+ $(DEL) $(SRC)\Emacs.ad.h
$(DEL) $(CONFIG_VALUES)
- cd $(LISP)
- $(DEL) /s /q *.bak *.elc *.orig *.rej
- cd $(INFODIR)
- $(DEL) *.info*
+ $(DEL) $(INFODIR)\*.info*
+ $(DEL) $(LISP)\*.elc
+
+realclean: distclean
+
+versionclean:
+ $(DEL) $(SRC)\xemacs.exe
+ $(DEL) $(LIB_SRC)\DOC
+
+#not sure about those wildcards. DOS wildcards are stupid compared to Unix,
+#and could end up deleting *everything* instead of just backup files or
+#whatever.
+#extraclean: realclean
+# $(DEL) *~ *.*~ #* m\*~ m\#* s\*~ s\#*
depend:
- cd $(SRCDIR)
+ cd $(SRC)
perl ./make-src-depend > depend.tmp
perl -MFile::Compare -e "compare('depend.tmp', 'depend') && rename('depend.tmp', 'depend') or unlink('depend.tmp')"
-installation::
- @if exist $(XEMACS)\Installation del $(XEMACS)\Installation
+$(XEMACS)\Installation:: installation
-installation:: $(XEMACS)\Installation
-
-$(XEMACS)\Installation:
- @type > $(XEMACS)\Installation <<
+installation::
+ @echo OS version:>$(XEMACS)\Installation
+ @ver >> $(XEMACS)\Installation
+ @type >> $(XEMACS)\Installation <<
!if defined(OS)
OS: $(OS)
!endif
-XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for `$(EMACS_CONFIGURATION)'.
+XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename) configured for `$(EMACS_CONFIGURATION)'.
- Building XEmacs in \"$(MAKEDIR:\=\\)\".
+ Building XEmacs in "$(MAKEDIR:\=\\)".
!if defined(CCV)
- Using compiler \"$(CC) $(CFLAGS)\".
+ Using compiler "$(CC) $(CFLAGS)".
+!endif
+ Installing XEmacs in "$(INSTALL_DIR:\=\\)".
+!if defined(PATH_PACKAGEPATH)
+ Package path is $(PATH_PACKAGEPATH).
!endif
- Installing XEmacs in \"$(INSTALL_DIR:\=\\)\".
- Package path is $(PATH_PACKAGEPATH:"=\").
!if $(INFODOCK)
Building InfoDock.
!endif
-!if $(HAVE_MSW)
+!if $(HAVE_MS_WINDOWS)
Compiling in support for Microsoft Windows native GUI.
!endif
-!if $(HAVE_X)
+!if $(HAVE_X_WINDOWS)
Compiling in support for X-Windows.
!endif
!if $(HAVE_MULE)
Compiling in MULE.
!endif
+!if $(HAVE_GTK)
+ --------------------------------------------------------------------
+ WARNING: You specified HAVE_GTK=1, but we are compiling WITHOUT GTK support.
+ WARNING: gtk-xemacs is not currently supported on MSWindows (mingw or msvc).
+ WARNING: Yes, we know that gtk has been ported to native MSWindows, but
+ WARNING: XEmacs is not yet ready to use that port.
+ --------------------------------------------------------------------
+!endif
!if $(HAVE_XPM)
Compiling in support for XPM images.
!else
WARNING: expense of an additional ~4KB of code.
--------------------------------------------------------------------
!endif
-!if $(USE_MINIMAL_TAGBITS)
- Using minimal tagbits.
-!endif
-!if $(USE_INDEXED_LRECORD_IMPLEMENTATION)
- Using indexed lrecord implementation.
-!endif
!if $(USE_UNION_TYPE)
Using union type for Lisp object storage.
!endif
!if $(DEBUG_XEMACS)
Compiling in extra debug checks. XEmacs will be slow!
!endif
+!if $(QUICK_BUILD)
+ Disabling non-essential build actions. Use with care!
+!endif
<<NOKEEP
@echo --------------------------------------------------------------------
@type $(XEMACS)\Installation
@echo --------------------------------------------------------------------
-# Update auto-autoloads.el and custom-load.el similar to what
-# XEmacs.rules does for xemacs-packages.
-VANILLA=-vanilla
-FORCE:
-$(LISP)\auto-autoloads.el: FORCE
- @$(DEL) $(LISP)\auto-autoloads.el
- $(PROGNAME) $(VANILLA) -batch \
- -l autoload -f batch-update-directory $(LISP)
- $(PROGNAME) $(VANILLA) -batch \
- -f batch-byte-compile $@
- @$(DEL) $(LISP)\auto-autoloads.el~
-
-$(LISP)\custom-load.el: FORCE
- $(PROGNAME) $(VANILLA) -batch -l cus-dep \
- -f Custom-make-dependencies $(LISP)
+# Update out-of-date .elcs, other than needed for dumping.
+update-elc-2:
+ $(XEMACS_BATCH) -l update-elc-2.el -f batch-update-elc-2 $(LISP)
+
+# Update auto-autoloads.el and custom-load.el, similar to what
+# XEmacs.rules does for xemacs-packages. This used to delete
+# auto-autoloads.el first, but that's a bad idea, because it forces
+# rebuilding from scratch, which is time-consuming; and the autoload
+# code is specifically written to do in-place updating. However, if
+# your auto-autoload file is messed up and you want it rebuilt from
+# scratch, delete it from the command line and then nmake with this
+# target.
+update-auto-and-custom:
+# Combine into one invocation to avoid repeated startup penalty.
+ $(XEMACS_BATCH) -l autoload -f batch-update-one-directory $(LISP) -f batch-byte-compile-one-file $(LISP)\auto-autoloads.el -l cus-dep -f Custom-make-one-dependency $(LISP) -f batch-byte-compile-one-file $(LISP)\custom-load.el
+ $(DEL) $(LISP)\auto-autoloads.el~
+ $(DEL) $(LISP)\custom-load.el~
# DO NOT DELETE THIS LINE -- make depend depends on it.