Commit 2f893509 authored by Paul Eggert's avatar Paul Eggert
Browse files

Fixups for GNU Make switchover

This fixes some minor problems introduced in the recent switch to GNU
Make, discovered by further testing.  Without some of these changes
'make -j' would sometimes have race conditions caused by missing
dependencies.  (Bug#26100)
* .gitignore: Remove src/, src/stamp-h1.
* ($(MAKEFILE_NAME)): Depend on configure, not
src/, since the former's timestamp now represents
the latter's.
($(srcdir)/configure): Use plain ./, for consistency
with other invocations.
Remove rule, as this file is no longer created.
* (top_distclean):
* src/ (bootstrap-clean):
No need to remove stamp-h1, as that was an Automake byproduct
and Automake is no longer in use.
* lib/, src/
(AUTOCONF_INPUTS, $(top_srcdir)/configure): Remove.
(../config.status, Makefile): Simplify by limiting dependencies
to files we care about and files in the repository, and by
using just one file to represent the timestamps on multiple
targets updated by the same rule.
* Do not create or use src/
Instead, have 'find' test the two output files directly.
parent 65faa7bc
......@@ -121,8 +121,6 @@ deps/
# Object files and debugging.
......@@ -419,8 +419,10 @@ blessmail: Makefile src
$(MAKE) -C lib-src maybe-blessmail
# We used to have one rule per */, but that leads to race
# conditions with parallel makes, so let's assume that the time stamp on
# ./Makefile is representative of the time stamp on all the other Makefiles.
# conditions with parallel makes, so assume that the timestamp on
# ./Makefile represents the timestamp on all the other Makefiles.
# Similarly, assume the timestamp on ./configure represents the
# timestamp on src/
# config.status overrides MAKEFILE_NAME with a bogus name when creating
# src/epaths.h, so that 'make epaths-force' does not recursively invoke
......@@ -430,7 +432,7 @@ blessmail: Makefile src
# then attempts to build that file. This forces 'Makefile', 'lib/Makefile',
# etc. to be built without running into similar recursion problems.
$(MAKEFILE_NAME): config.status $(srcdir)/src/ \
$(MAKEFILE_NAME): config.status $(srcdir)/configure \
$(srcdir)/lib/ \
MAKE='$(MAKE)' ./config.status
......@@ -445,16 +447,8 @@ config.status: ${srcdir}/configure
$(CFG) $(srcdir)/configure $(CONFIGURE_FLAGS); \
$(srcdir)/configure $(srcdir)/src/ \
$(srcdir)/ $(srcdir)/m4/*.m4
cd $(srcdir) && ./ autoconf
$(srcdir)/src/ $(srcdir)/src/
@ # Usually, there's no need to rebuild src/ just
@ # because has changed (since building
@ # refreshes as well), but if is missing
@ # then we really need to do something more.
$(if $(wildcard $@),,cd $(srcdir) && ./ autoconf)
$(srcdir)/configure: $(srcdir)/ $(srcdir)/m4/*.m4
cd $(srcdir) && ./
# ==================== Installation ====================
......@@ -864,7 +858,7 @@ top_bootclean=\
${top_bootclean}; \
rm -f config.status config.log~ \
Makefile lib/ stamp-h1 ${SUBDIR_MAKEFILES}
Makefile lib/ ${SUBDIR_MAKEFILES}
distclean_dirs = $(clean_dirs) leim lisp
......@@ -242,10 +242,6 @@ Please report any problems with this script to .'
## Let autoreconf figure out what, if anything, needs doing.
## Use autoreconf's -f option in case autoreconf itself has changed.
autoreconf -fi -I m4 || exit
## Create a timestamp, so that './; make' doesn't
## cause 'make' to needlessly run 'autoheader'.
echo timestamp > src/ || exit
......@@ -360,7 +356,7 @@ if test ! -f configure; then
elif test -e .git && test $git_was_ok = false && test $do_git = false; then
echo "You can now run '$0 git'."
elif test ! -f config.status ||
test -n "`find src/ -newer config.status`"; then
test -n "`find configure src/ -newer config.status`"; then
echo "You can now run './configure'."
......@@ -76,14 +76,10 @@ else
AUTOCONF_INPUTS = $(top_srcdir)/ $(top_srcdir)/m4/*.m4
$(top_srcdir)/configure: $(AUTOCONF_INPUTS)
.PRECIOUS: ../config.status Makefile
../config.status: $(top_srcdir)/configure $(top_srcdir)/lisp/version.el
Makefile: ../config.status $(srcdir)/
$(top_srcdir)/configure ../config.status:
../config.status: $(top_srcdir)/ $(top_srcdir)/m4/*.m4
$(MAKE) -C .. $(notdir $@)
Makefile: ../config.status $(srcdir)/
$(MAKE) -C .. src/$@
libgnu_a_OBJECTS = $(gl_LIBOBJS) \
......@@ -16,7 +16,7 @@
# along with this file. If not, see <>.
# Gnulib odules to be omitted from Emacs.
# Gnulib modules to be omitted from Emacs.
# Omit them because they either conflict with MinGW headers or
# headers in nt/inc, or because those modules won't compile with
......@@ -624,14 +624,10 @@ $(oldXMenudir)/libXMenu11.a: FORCE
AUTOCONF_INPUTS = $(top_srcdir)/ $(top_srcdir)/m4/*.m4
$(top_srcdir)/configure $(AUTOCONF_INPUTS)
.PRECIOUS: ../config.status Makefile
../config.status: $(top_srcdir)/configure $(top_srcdir)/lisp/version.el
Makefile: ../config.status $(srcdir)/
$(top_srcdir)/configure ../config.status:
../config.status: $(top_srcdir)/ $(top_srcdir)/m4/*.m4
$(MAKE) -C .. $(notdir $@) Makefile:
Makefile: ../config.status $(srcdir)/
$(MAKE) -C .. src/$@
doc.o: buildobj.h
......@@ -661,7 +657,7 @@ clean: mostlyclean
## It should remove all files generated during a compilation/bootstrap,
## but not things like config.status or TAGS.
bootstrap-clean: clean
rm -f epaths.h config.h config.stamp stamp-h1
rm -f epaths.h config.h config.stamp
if test -f ./.gdbinit; then \
mv ./.gdbinit ./; \
if test -f "$(srcdir)/.gdbinit"; then rm -f ./; \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment