XEmacs 21.4.3 "Academic Rigor".
[chise/xemacs-chise.git.1] / nt / xemacs.mak
index ca54812..745e063 100644 (file)
@@ -1,6 +1,6 @@
 #   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.
 #
 
 default: all
 
-XEMACS=..
+# 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
@@ -62,10 +69,13 @@ PROGRAM_DEFINES=-DINFODOCK                                  \
        -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)\"             \
@@ -122,6 +132,9 @@ HAVE_XFACE=0
 !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
@@ -223,6 +236,10 @@ CONFIG_ERROR=1
 !message Specified X11 directory does not contain "$(X11_DIR)\LIB\X11.LIB"
 CONFIG_ERROR=1
 !endif
+!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
@@ -297,10 +314,26 @@ DEPEND=0
 ! if [if not exist $(OUTDIR)\nul mkdir "$(OUTDIR)"]
 ! endif
 # generate an nmake-readable version of depend
-! if [perl -p -e "s/^\x23ifdef (.+)/!if defined($$1)/; s/^\x23e/!e/;" \
+# #### 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(_)
+!  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 $(NT:\=\\)\\config.inc/;" \
+       -e "s/^(.+)\.o:(.+)/$(OUTDIR:\=\\)\\$$1.obj:$$2/;" \
        < $(SRC)\depend > $(OUTDIR)\depend.tmp]
+!  endif
 ! endif
 ! include "$(OUTDIR)\depend.tmp"
 !else
@@ -455,7 +488,7 @@ 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) $(QUICK_DEFINES) \
-       -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \
+       -DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \
        -DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
 
 #------------------------------------------------------------------------------
@@ -481,7 +514,7 @@ $(SRC)\paths.h:     paths.h
 
 # 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
@@ -520,8 +553,9 @@ $(LIB_SRC)/movemail.exe: $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS)
        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)/minitar.exe : $(NT)/minitar.c
+       $(CCV) $(CFLAGS) -I$(ZLIB_DIR) -Fe$@ $** $(ZLIB_DIR)\zlib.lib -link -incremental:no
 
 LIB_SRC_TOOLS = \
        $(LIB_SRC)/etags.exe            \
@@ -549,18 +583,6 @@ minitar: $(LIB_SRC)/minitar.exe
 
 #------------------------------------------------------------------------------
 
-# runxemacs proglet
-
-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$@ $**
-
-#------------------------------------------------------------------------------
-
 # dump-id.c file that contains the dump id
 
 $(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe 
@@ -639,7 +661,6 @@ DOC=$(LIB_SRC)\DOC
 DOC_SRC1=\
  $(SRC)\abbrev.c \
  $(SRC)\alloc.c \
- $(SRC)\alloca.c \
  $(SRC)\blocktype.c \
  $(SRC)\buffer.c \
  $(SRC)\bytecode.c \
@@ -677,6 +698,7 @@ DOC_SRC3=\
  $(SRC)\font-lock.c \
  $(SRC)\frame.c \
  $(SRC)\general.c \
+ $(SRC)\getloadavg.c \
  $(SRC)\glyphs.c \
  $(SRC)\glyphs-eimage.c \
  $(SRC)\glyphs-widget.c \
@@ -726,6 +748,7 @@ DOC_SRC5=\
  $(SRC)\tparam.c \
  $(SRC)\undo.c \
  $(SRC)\window.c \
+ $(SRC)\win32.c \
  $(SRC)\widget.c
 
 !if $(HAVE_X_WINDOWS)
@@ -810,8 +833,12 @@ DOC_SRC11=\
 
 # 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
@@ -824,17 +851,18 @@ TEMACS=$(TEMACS_DIR)\temacs.exe
 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) \
+ $(EMACS_PATCH_LEVEL) \
  -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \
  -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \
  -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
@@ -926,7 +954,6 @@ TEMACS_OBJS= \
        $(TEMACS_DUMP_OBJS)\
        $(OUTDIR)\abbrev.obj \
        $(OUTDIR)\alloc.obj \
-       $(OUTDIR)\alloca.obj \
        $(OUTDIR)\blocktype.obj \
        $(OUTDIR)\buffer.obj \
        $(OUTDIR)\bytecode.obj \
@@ -962,6 +989,7 @@ TEMACS_OBJS= \
        $(OUTDIR)\font-lock.obj \
        $(OUTDIR)\frame.obj \
        $(OUTDIR)\general.obj \
+       $(OUTDIR)\getloadavg.obj \
        $(OUTDIR)\glyphs.obj \
        $(OUTDIR)\glyphs-eimage.obj \
        $(OUTDIR)\glyphs-widget.obj \
@@ -1008,7 +1036,8 @@ TEMACS_OBJS= \
        $(OUTDIR)\tparam.obj \
        $(OUTDIR)\undo.obj \
        $(OUTDIR)\widget.obj \
-       $(OUTDIR)\window.obj
+       $(OUTDIR)\window.obj \
+       $(OUTDIR)\win32.obj
 
 # Rules
 
@@ -1044,7 +1073,7 @@ $(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 $(SRC)\dump-id.c del $(SRC)\dump-id.c
@@ -1104,8 +1133,10 @@ tags:
        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
 
@@ -1297,11 +1328,11 @@ makeinfo-test:
 if exist "$(MAKEINFO)" goto test_done
 @$(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
@@ -1353,7 +1384,7 @@ $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
        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 @<<
@@ -1362,7 +1393,7 @@ $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
 # 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 -section:.rsrc,rw xemacs.exe
-       del $(TEMACS_DIR)\xemacs.dmp
+       $(DEL) $(TEMACS_DIR)\xemacs.dmp
 !endif
        cd $(NT)
        @if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@
@@ -1370,8 +1401,8 @@ $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
 
 # use this rule to build the complete system
 all:   installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \
-       $(LIB_SRC_TOOLS) $(RUNEMACS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \
-       update-auto-and-custom info
+       $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \
+       update-elc-2 update-auto-and-custom info
 
 temacs: $(LASTFILE) $(TEMACS)
 
@@ -1382,61 +1413,59 @@ install:        all
        @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 $(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\"
        @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"
+       $(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) $(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 $(SRC)
@@ -1471,6 +1500,14 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for `$(EMACS_
 !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
@@ -1553,16 +1590,23 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for `$(EMACS_
        @type $(XEMACS)\Installation
        @echo --------------------------------------------------------------------
 
-# Update auto-autoloads.el and custom-load.el similar to what
-# XEmacs.rules does for xemacs-packages.
+# 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:
-#       Don't delete this, because it forces rebuilding from scratch,
-#       which is time-consuming; and the autoload code is specifically
-#       written to do in-place updating.
-#      @$(DEL) $(LISP)\auto-autoloads.el
 #       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-dependencies $(LISP)
-       @$(DEL) $(LISP)\auto-autoloads.el~
+       $(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.