# Makefile for Microsoft NMAKE
# Copyright (C) 1995 Board of Trustees, University of Illinois.
-# Copyright (C) 1995, 1996 Ben Wing.
+# Copyright (C) 1995, 1996, 2000 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 "..\version.sh"
+!include "$(XEMACS)\version.sh"
!include "config.inc"
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)
!endif
PROGRAM_DEFINES= \
-DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" \
- -DPATH_PROGNAME=\"xemacs\"
+ -DPATH_PROGNAME=\"xemacs\" \
+ -DEMACS_VERSION=\"$(XEMACS_VERSION_STRING)\" \
+ -DEMACS_PROGNAME=\"xemacs\"
!endif
#
! endif
!endif
PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)"
-!if !defined(HAVE_MSW)
-HAVE_MSW=1
+!if !defined(HAVE_MS_WINDOWS)
+HAVE_MS_WINDOWS=1
!endif
-!if !defined(HAVE_X)
-HAVE_X=0
+!if !defined(HAVE_X_WINDOWS)
+HAVE_X_WINDOWS=0
!endif
!if !defined(HAVE_XPM)
HAVE_XPM=0
!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
!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_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
#
+# Whether to use dependency information generated by make-src-depend
+#
+!if !defined(DEPEND)
+DEPEND=0
+!endif
+!if $(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.
+! 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 $(NT:\=\\)\\config.inc/;" \
+ < $(SRC)\depend > $(OUTDIR)\depend.tmp]
+! endif
+! include "$(OUTDIR)\depend.tmp"
+!else
+! if [echo WARNING: Compiling without dependency information.]
+! endif
+!endif
+
+#
# Compiler command echo control. Define VERBOSECC=1 to get verbose compilation.
#
!if !defined(VERBOSECC)
CFLAGS=-nologo -W3 $(OPT) $(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=
DEBUG_FLAGS=-debug:full
!endif
+!if $(QUICK_BUILD)
+QUICK_DEFINES=-DQUICK_BUILD
+!endif
+
!if $(USE_MINIMAL_TAGBITS)
TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS
!endif
# Generic variables
-INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(XEMACS)\lwlib
+INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -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 \
+ $(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)
# lib-src programs
-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
nmake -nologo -f minitar.mak ZLIB="$(ZLIB_DIR)" NT="$(NT)" LIB_SRC="$(LIB_SRC)"
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)/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) \
!if $(USE_PORTABLE_DUMPER)
LIB_SRC_TOOLS = \
$(XEMACS_INCLUDES) \
+ $(LIB_SRC)/make-dump-id.exe \
$(LIB_SRC_TOOLS)
!endif
#------------------------------------------------------------------------------
-# runxemacs proglet
+# dump-id.c file that contains the dump id
-RUNEMACS = $(SRC)\runxemacs.exe
-
-$(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 $(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_SRC1=\
$(SRC)\abbrev.c \
$(SRC)\alloc.c \
- $(SRC)\alloca.c \
$(SRC)\blocktype.c \
$(SRC)\buffer.c \
$(SRC)\bytecode.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)\tparam.c \
$(SRC)\undo.c \
$(SRC)\window.c \
+ $(SRC)\win32.c \
$(SRC)\widget.c
-!if $(HAVE_X)
+!if $(HAVE_X_WINDOWS)
DOC_SRC6=\
$(SRC)\balloon_help.c \
$(SRC)\console-x.c \
$(SRC)\select-x.c
!endif
-!if $(HAVE_MSW)
+!if $(HAVE_MS_WINDOWS)
DOC_SRC7=\
$(SRC)\console-msw.c \
$(SRC)\device-msw.c \
$(SRC)\mule.c \
$(SRC)\mule-charset.c \
$(SRC)\mule-ccl.c
-! if $(HAVE_X)
+! if $(HAVE_X_WINDOWS)
DOC_SRC8=$(DOC_SRC8) $(SRC)\input-method-xlib.c
! endif
!endif
!if !$(USE_PORTABLE_DUMPER)
DOC_SRC11=\
$(SRC)\unexnt.c
+!else
+DOC_SRC11=\
+ $(SRC)\dumper.c
!endif
#------------------------------------------------------------------------------
TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc
TEMACS_SRC=$(SRC)
TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \
- oldnames.lib kernel32.lib user32.lib gdi32.lib advapi32.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 $(LIBC_LIB)
TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\
-stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\
-pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \
- -heap:0x00100000 -nodefaultlib -incremental:no
+ -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)\" \
+ -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \
-DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \
-DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
-!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)\tparam.obj \
$(OUTDIR)\undo.obj \
$(OUTDIR)\widget.obj \
- $(OUTDIR)\window.obj
+ $(OUTDIR)\window.obj \
+ $(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$@
@$(DEL) bscmake.tmp
!endif
!if $(USE_PORTABLE_DUMPER)
- @if exist $(TEMACS_DIR)\xemacs.dmp del $(TEMACS_DIR)\xemacs.dmp
+ @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)
+ $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj
<<
!else
link.exe @<<
$(OUTDIR)\xemacs.res: xemacs.rc
rc -Fo$@ xemacs.rc
-# Section handling automated tests starts here
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
+
blddir=$(MAKEDIR:\=\\)\\..
-temacs_loadup=$(TEMACS) -batch -l $(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!!
cd $(XEMACS)
$(DEL) TAGS
set PATH=lib-src;%PATH%
-# argh!!! we need two ^^'s to get one ^, but only before a backslash.
-# i have no idea why. probably some obscure nmake quoting convention.
+# 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 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
@<<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)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
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)
update-elc:
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
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)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
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)
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)
+ $(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.
# use this rule to build the complete system
all: installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \
- $(LIB_SRC_TOOLS) $(RUNEMACS) $(TEMACS) update-elc $(DOC) dump-xemacs \
- $(LISP)/auto-autoloads.el $(LISP)/custom-load.el info
+ $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \
+ update-elc-2 update-auto-and-custom info
temacs: $(LASTFILE) $(TEMACS)
@copy $(LIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
@copy $(CONFIG_VALUES) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
@copy $(SRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)"
- @copy $(RUNEMACS) "$(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\"
@$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
@$(DEL) PlaceHolder
-distclean:
- $(DEL) *.bak
- $(DEL) *.orig
- $(DEL) *.rej
- $(DEL) *.tmp
+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) $(CONFIG_VALUES)
- cd $(LISP)
- $(DEL) /s /q *.bak *.elc *.orig *.rej
- cd $(INFODIR)
- $(DEL) *.info*
+ $(DEL) $(OUTDIR)\*.lib $(OUTDIR)\*.obj $(OUTDIR)\*.pdb
+ $(DEL) $(OUTDIR)\*.res $(OUTDIR)\*.sbr
+ $(DEL) $(SRC)\*.exe $(SRC)\*.map $(SRC)\*.bsc $(SRC)\*.pdb
+ $(DEL) $(LIB_SRC)\*.exe $(LIB_SRC)\*.obj $(LIB_SRC)\*.pdb
+ $(DEL) $(LIB_SRC)\*.res
+
+clean: mostlyclean versionclean
+ $(DEL) $(XEMACS)\TAGS
+
+nicenclean: clean
+ $(DEL) $(NT)\*.bak $(NT)\*.orig $(NT)\*.rej $(NT)\*.tmp
+ $(DEL) $(LIB_SRC)\*.bak $(LIB_SRC)\*.orig $(LIB_SRC)\*.rej
+ $(DEL) $(LIB_SRC)\*.tmp
+ $(DEL) $(SRC)\*.bak $(SRC)\*.orig $(SRC)\*.rej $(SRC)\*.tmp
+ $(DEL) /s $(LISP)\*.bak $(LISP)\*.orig $(LISP)\*.rej $(LISP)\*.tmp
+
+## This is used in making a distribution.
+## Do not use it on development directories!
+distclean: nicenclean
+ $(DEL) $(SRC)\config.h $(SRC)\paths.h $(SRC)\Emacs.ad.h
+ $(DEL) $(LIB_SRC)\$(CONFIG_VALUES)
+ $(DEL) $(INFODIR)\*.info*
+ $(DEL) /s /q $(LISP)\*.elc
+
+realclean: distclean
+
+versionclean:
+ $(DEL) $(SRC)\xemacs.exe $(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')"
!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)
!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 $@
+# 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~
-
-$(LISP)\custom-load.el: FORCE
- $(PROGNAME) $(VANILLA) -batch -l cus-dep \
- -f Custom-make-dependencies $(LISP)
+ @$(DEL) $(LISP)\custom-load.el~
# DO NOT DELETE THIS LINE -- make depend depends on it.