* src/Makefile.in (emacs${EXEEXT}): Depend on the machine-specific files.
[bpt/emacs.git] / lisp / Makefile.in
index 848492f..9b354b9 100644 (file)
@@ -89,7 +89,7 @@ setwins=subdirs=`(cd $$wd; find . -type d -print)`; \
           esac; \
         done
 
-# Find all subdirectories except `obsolete'.
+# Find all subdirectories except `obsolete' and `term'.
 
 setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
        for file in $$subdirs; do \
@@ -98,20 +98,31 @@ setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
           esac; \
         done
 
+# `compile-main' tends to be slower than `recompile' but can be parallelized
+# with "make -j" and results in more deterministic compilation warnings.
+all: compile-main
+
 doit:
 
-$(lisp)/cus-load.el:
-       touch $@
-# Note that custom-deps and finder-data depend on autoloads rather
-# than on loaddefs.el, so that autoloads does not run in parallel with
-# them under "make -j", because that could delete loaddefs.el from
-# under their feet.
-custom-deps: $(emacs-deps) autoloads $(lisp)/cus-load.el doit
+# custom-deps and finder-data both used to scan _all_ the *.el files.
+# Now they avoid auto-generated files, which should avoid this
+# historical problem:
+# In parallel builds, they should not run at the same time as anything
+# else that might modify any .el files, eg autoloads (or each other).
+# One solution was to add autoloads as a prerequisite:
+# http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00469.html
+# http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-12/msg00171.html
+# However, this means that running these targets modifies loaddefs.el,
+# every time (due to time-stamping).  Calling these rules from
+# bootstrap-after would modify loaddefs after src/emacs, resulting
+# in make install remaking src/emacs for no real reason:
+# http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00311.html
+custom-deps: $(emacs-deps) doit
        wd=$(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
        $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
 
-finder-data: $(emacs-deps) autoloads doit
+finder-data: $(emacs-deps) doit
        wd=$(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
        $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
@@ -151,27 +162,26 @@ TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
 
 .PHONY: update-elclist
 
-## Construct a sed command file that operates on lines between
-## ^ELCFILES and the next blank line.  Convert spaces between members
-## of COMPILE_FIRST to "\|", and escape directory "/".  List the .elc
-## files, exclude the members of COMPILE_FIRST, convert ^$(lisp) to a
-## literal " $(lisp)", add trailing " \\\" to the end of every line
-## (the last \ continues the line in sed, the other \\ result in a
-## single \ at the end of the replacement text).  For the last line,
-## just use a single "\", for sed.  Finally, run sed using the command
-## so constructed and update Makefile.in.  chmod +w is for CVSREAD=1.
-## Errors in final sed are non-fatal, since they have no effect on
-## building Emacs.
+## Post-bootstrap, find the list of .elc files, exclude the members
+## of COMPILE_FIRST, and use sed to update ELCFILES in Makefile.in.
+## Errors in the final sed are non-fatal, since they have no effect on
+## building Emacs.  chmod +w is for CVSREAD=1.
+## "echo" is non-portable with regards to backslashes, eg between zsh
+## and bash.  Hence the use of sed on line 2 below (line 1 seems to be OK).
+## http://lists.gnu.org/archive/html/emacs-devel/2008-05/msg01535.html
 update-elclist:
        echo "/^ELCFILES/,/^$$/c\\" > temp.sed
-       echo "ELCFILES = \\\\\\" >> temp.sed
+       echo "ELCFILES =" | sed -e 's/$$/ \\\\\\/' >> temp.sed
        exclude=`echo $(COMPILE_FIRST) | sed -e 's, ,\\\\|,g' -e 's,\/,\\\\/,g'`; \
-       ls $(lisp)/*.elc $(lisp)/*/*.elc | sed -e "/$$exclude/d" -e "s|^$(lisp)|        \$$(lisp)|" -e 's/$$/ \\\\\\/' -e '$$ s/ \\\\//' >> temp.sed
+       LC_COLLATE=C ls $(lisp)/*.elc $(lisp)/*/*.elc | sed -e "/$$exclude/d" -e "s|^$(lisp)|   \$$(lisp)|" -e 's/$$/ \\\\\\/' -e '$$ s/ \\\\//' >> temp.sed
        echo "" >> temp.sed
        -sed -f temp.sed $(lisp)/Makefile.in > temp-elcfiles || rm temp-elcfiles
        rm temp.sed
-       chmod +w $(lisp)/Makefile.in
-       mv -f temp-elcfiles $(lisp)/Makefile.in || echo "Maintainer warning: failed to update Makefile.in"
+       @test -f temp-elcfiles || echo "Maintainer warning: failed to update Makefile.in.  You can ignore this if you are not an Emacs developer."
+       if test -f temp-elcfiles; then \
+         chmod +w $(lisp)/Makefile.in; \
+         mv -f temp-elcfiles $(lisp)/Makefile.in; \
+       fi
 
 ## Explicitly list the .elc files, for the sake of parallel builds.
 ## http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-05/msg00016.html
@@ -481,6 +491,7 @@ ELCFILES = \
        $(lisp)/eshell/eshell.elc \
        $(lisp)/expand.elc \
        $(lisp)/ezimage.elc \
+       $(lisp)/face-remap.elc \
        $(lisp)/facemenu.elc \
        $(lisp)/faces.elc \
        $(lisp)/ffap.elc \
@@ -593,6 +604,7 @@ ELCFILES = \
        $(lisp)/gnus/nngateway.elc \
        $(lisp)/gnus/nnheader.elc \
        $(lisp)/gnus/nnimap.elc \
+       $(lisp)/gnus/nnir.elc \
        $(lisp)/gnus/nnkiboze.elc \
        $(lisp)/gnus/nnlistserv.elc \
        $(lisp)/gnus/nnmail.elc \
@@ -704,6 +716,7 @@ ELCFILES = \
        $(lisp)/language/ethio-util.elc \
        $(lisp)/language/ethiopic.elc \
        $(lisp)/language/european.elc \
+       $(lisp)/language/hanja-util.elc \
        $(lisp)/language/ind-util.elc \
        $(lisp)/language/indian.elc \
        $(lisp)/language/japan-util.elc \
@@ -818,6 +831,11 @@ ELCFILES = \
        $(lisp)/net/ldap.elc \
        $(lisp)/net/net-utils.elc \
        $(lisp)/net/netrc.elc \
+       $(lisp)/net/newst-backend.elc \
+       $(lisp)/net/newst-plainview.elc \
+       $(lisp)/net/newst-reader.elc \
+       $(lisp)/net/newst-ticker.elc \
+       $(lisp)/net/newst-treeview.elc \
        $(lisp)/net/newsticker.elc \
        $(lisp)/net/ntlm.elc \
        $(lisp)/net/quickurl.elc \
@@ -870,30 +888,19 @@ ELCFILES = \
        $(lisp)/nxml/rng-xsd.elc \
        $(lisp)/nxml/xmltok.elc \
        $(lisp)/nxml/xsd-regexp.elc \
-       $(lisp)/obsolete/auto-show.elc \
        $(lisp)/obsolete/awk-mode.elc \
-       $(lisp)/obsolete/bg-mouse.elc \
        $(lisp)/obsolete/fast-lock.elc \
-       $(lisp)/obsolete/float.elc \
-       $(lisp)/obsolete/hilit19.elc \
-       $(lisp)/obsolete/hscroll.elc \
        $(lisp)/obsolete/iso-acc.elc \
        $(lisp)/obsolete/iso-insert.elc \
        $(lisp)/obsolete/iso-swed.elc \
        $(lisp)/obsolete/lazy-lock.elc \
-       $(lisp)/obsolete/lselect.elc \
-       $(lisp)/obsolete/mlsupport.elc \
        $(lisp)/obsolete/old-whitespace.elc \
-       $(lisp)/obsolete/ooutline.elc \
        $(lisp)/obsolete/options.elc \
-       $(lisp)/obsolete/profile.elc \
        $(lisp)/obsolete/rnews.elc \
        $(lisp)/obsolete/rnewspost.elc \
-       $(lisp)/obsolete/rsz-mini.elc \
        $(lisp)/obsolete/sc.elc \
        $(lisp)/obsolete/scribe.elc \
        $(lisp)/obsolete/swedish.elc \
-       $(lisp)/obsolete/uncompress.elc \
        $(lisp)/obsolete/x-menu.elc \
        $(lisp)/org/org-agenda.elc \
        $(lisp)/org/org-archive.elc \
@@ -906,6 +913,7 @@ ELCFILES = \
        $(lisp)/org/org-export-latex.elc \
        $(lisp)/org/org-faces.elc \
        $(lisp)/org/org-gnus.elc \
+       $(lisp)/org/org-id.elc \
        $(lisp)/org/org-info.elc \
        $(lisp)/org/org-irc.elc \
        $(lisp)/org/org-jsinfo.elc \
@@ -1258,31 +1266,34 @@ compile-main: $(ELCFILES)
 # date.  Some .el files don't get compiled because they set the
 # local variable no-byte-compile.
 # Calling make recursively because suffix rule cannot have prerequisites.
+# Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those
+# sub-makes that run rules that use it, for the sake of some non-GNU makes.
 compile: $(emacs-deps) $(LOADDEFS) autoloads compile-first
-       $(MAKE) $(MFLAGS) compile-main
-       $(MAKE) $(MFLAGS) compile-last
+       $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS)
+       $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS)
+
+## Doing this causes make install to dump another emacs.
+#      $(MAKE) $(MFLAGS) update-elclist
 
 # Compile all Lisp files.  This is like `compile' but compiles files
 # unconditionally.  Some files don't actually get compiled because they
 # set the local variable no-byte-compile.
 compile-always: doit
        cd $(lisp); rm -f *.elc */*.elc
-       $(MAKE) $(MFLAGS) compile
+       $(MAKE) $(MFLAGS) compile EMACS=$(EMACS)
 
 ## In case any files are missing from ELCFILES.
 compile-last:
        @wd=$(lisp); $(setwins); \
-       els=`echo $$wins | tr ' \011' '\012\012' | \
-               sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
+       els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
        for el in $(COMPILE_FIRST) $$els; do \
-         elc=$${el}c; \
-         if test -f $$el && ! test -f $$elc && \
-           ! grep 'no-byte-compile: t' $$el > /dev/null; then \
-             sel=`echo $el | sed "s|^$$lisp|\$$(lisp)|"`; \
-             echo "Maintainer warning: $$sel missing from \$$ELCFILES?"; \
-             echo "Compiling $$el"; \
-             $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
-         fi \
+         test -f $$el || continue; \
+         test -f $${el}c && continue; \
+         grep 'no-byte-compile: t' $$el > /dev/null && continue; \
+         sel=`echo $$el | sed "s|^$(lisp)|\\$$(lisp)|"`; \
+         echo "Maintainer warning: $$sel missing from \$$ELCFILES?"; \
+         echo "Compiling $$el"; \
+         $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
        done
 
 compile-calc:
@@ -1317,7 +1328,7 @@ $(lisp)/progmodes/cc-mode.elc: \
        $(lisp)/progmodes/cc-mode.el \
        $(lisp)/progmodes/cc-langs.el \
        $(lisp)/progmodes/cc-defs.el
-       $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $@
+       $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
 
 # Update MH-E internal autoloads. These are not to be confused with
 # the autoloads for the MH-E entry points, which are already in loaddefs.el.
@@ -1394,18 +1405,12 @@ $(CAL_DIR)/hol-loaddefs.el: $(emacs-deps) $(CAL_SRC)
 # local changes.  (Because loaddefs.el is an automatically generated
 # file, we don't want to store it in the source repository).
 
-bootstrap-prepare:
-       if test -x $(EMACS); then                               \
-         $(MAKE) $(MFLAGS) autoloads;                          \
-       fi
+autogen-clean:
+       cd $(lisp); rm -f $(AUTOGENEL)
 
 maintainer-clean: distclean bootstrap-clean
-       cd $(lisp); rm -f $(AUTOGENEL)
 
-## NB note that this rules assume only one level of subdirs below lisp/.
-## If nested subdirs are added, it's probably time to switch to:
-## find $(lisp) -name "*.elc" -exec rm -f '{}' ';'
-bootstrap-clean:
+bootstrap-clean: autogen-clean
        cd $(lisp); rm -f *.elc */*.elc
 
 # Generate/update files for the bootstrap process.
@@ -1415,7 +1420,7 @@ bootstrap: update-subdirs autoloads compile
 # Generate/update files after the bootstrap process.
 # custom-deps needs `preloaded-file-list'.
 
-bootstrap-after: finder-data custom-deps update-elclist
+bootstrap-after: finder-data custom-deps
 
 distclean:
        -rm -f ./Makefile