diff --git a/.gitignore b/.gitignore index bd5a8e79471..98b8222180b 100644 --- a/.gitignore +++ b/.gitignore @@ -185,7 +185,6 @@ src/bootstrap-emacs src/emacs src/emacs-[0-9]* src/temacs -src/temacs.in src/fingerprint.c src/*.pdmp diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c index 4bfeaa0742c..35bb8b98a00 100644 --- a/lib-src/make-fingerprint.c +++ b/lib-src/make-fingerprint.c @@ -99,9 +99,9 @@ main (int argc, char **argv) } else { - puts ("#include \n" - "#include \"fingerprint.h\"\n" - "unsigned char const fingerprint[] = {"); + puts ("#include \"fingerprint.h\"\n" + "unsigned char const fingerprint[] =\n" + "{"); for (int i = 0; i < 32; ++i) printf ("\t0x%02X,\n", digest[i]); puts ("};"); diff --git a/src/Makefile.in b/src/Makefile.in index 0613a0dbed4..f8a2ffadc27 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -533,7 +533,7 @@ ${lispintdir}/cp51932.el ${lispintdir}/eucjp-ms.el: FORCE charsets = ${top_srcdir}/admin/charsets/charsets.stamp ${charsets}: FORCE - ${MAKE} -C ../admin/charsets all + $(MAKE) -C $(dir $@) all charscript = ${lispintdir}/charscript.el ${charscript}: FORCE @@ -584,8 +584,9 @@ $(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp) $(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \ $(shortlisp) -$(libsrc)/make-docfile$(EXEEXT): $(lib)/libgnu.a - $(MAKE) -C $(libsrc) make-docfile$(EXEEXT) +$(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \ + $(lib)/libgnu.a + $(MAKE) -C $(dir $@) $(notdir $@) buildobj.h: Makefile $(AM_V_GEN)for i in $(ALLOBJS); do \ @@ -613,32 +614,21 @@ $(ALLOBJS): globals.h LIBEGNU_ARCHIVE = $(lib)/lib$(if $(HYBRID_MALLOC),e)gnu.a $(LIBEGNU_ARCHIVE): $(config_h) - $(MAKE) -C $(lib) all + $(MAKE) -C $(dir $@) all -EMACS_DEPS_PRE=$(LIBXMENU) $(ALLOBJS) -EMACS_DEPS_POST=$(LIBEGNU_ARCHIVE) $(EMACSRES) ${charsets} ${charscript} -BUILD_EMACS_PRE=$(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ - -o $@ $(ALLOBJS) -BUILD_EMACS_POST=$(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) - -## We hash this file to generate the build fingerprint -temacs.in$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint-dummy.o $(EMACS_DEPS_POST) - $(BUILD_EMACS_PRE) fingerprint-dummy.o $(BUILD_EMACS_POST) - -$(libsrc)/make-fingerprint$(EXEEXT): $(libsrc)/make-fingerprint.c $(lib)/libgnu.a - $(MAKE) -C $(libsrc) make-fingerprint$(EXEEXT) - -fingerprint.c: temacs.in$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT) - $(AM_V_GEN)$(libsrc)/make-fingerprint$(EXEEXT) temacs.in$(EXEEXT) \ - >$@.tmp +FINGERPRINTED = $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) +fingerprint.c: $(FINGERPRINTED) $(libsrc)/make-fingerprint$(EXEEXT) + $(AM_V_GEN)$(libsrc)/make-fingerprint$(EXEEXT) $(FINGERPRINTED) >$@.tmp $(AM_V_at)mv $@.tmp $@ ## We have to create $(etc) here because init_cmdargs tests its ## existence when setting Vinstallation_directory (FIXME?). ## This goes on to affect various things, and the emacs binary fails ## to start if Vinstallation_directory has the wrong value. -temacs$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint.o $(EMACS_DEPS_POST) - $(BUILD_EMACS_PRE) fingerprint.o $(BUILD_EMACS_POST) +temacs$(EXEEXT): fingerprint.o $(charsets) $(charscript) + $(AM_V_CCLD)$(CC) -o $@ $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ + $(ALLOBJS) fingerprint.o \ + $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) $(MKDIR_P) $(etc) ifeq ($(DUMPING),unexec) ifneq ($(PAXCTL_notdumped),) @@ -649,15 +639,15 @@ endif ## The following oldxmenu-related rules are only (possibly) used if ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them. $(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE - $(MAKE) -C $(lwlibdir) liblw.a + $(MAKE) -C $(dir $@) $(notdir $@) $(oldXMenudir)/libXMenu11.a: FORCE - $(MAKE) -C $(oldXMenudir) libXMenu11.a + $(MAKE) -C $(dir $@) $(notdir $@) FORCE: .PHONY: FORCE .PRECIOUS: ../config.status Makefile ../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4 - $(MAKE) -C .. $(notdir $@) + $(MAKE) -C $(dir $@) $(notdir $@) Makefile: ../config.status $(srcdir)/Makefile.in $(MAKE) -C .. src/$@ @@ -675,7 +665,7 @@ ns-app: emacs$(EXEEXT) $(pdmp) mostlyclean: rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o - rm -f temacs.in$(EXEEXT) fingerprint.c + rm -f fingerprint.c rm -f emacs.pdmp rm -f ../etc/DOC rm -f bootstrap-emacs$(EXEEXT) $(bootstrap_pdmp) @@ -713,7 +703,7 @@ extraclean: distclean ETAGS = ../lib-src/etags${EXEEXT} ${ETAGS}: FORCE - ${MAKE} -C ../lib-src $(notdir $@) + $(MAKE) -C $(dir $@) $(notdir $@) # Remove macuvs.h and fingerprint.c since they'd cause `src/emacs` # to be built before we can get TAGS. @@ -738,11 +728,8 @@ TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2) ## Arrange to make tags tables for ../lisp and ../lwlib, ## which the above TAGS file for the C files includes by reference. -../lisp/TAGS: FORCE - $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)" - -$(lwlibdir)/TAGS: FORCE - $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)" +../lisp/TAGS $(lwlibdir)/TAGS: FORCE + $(MAKE) -C $(dir $@) $(notdir $@) ETAGS="$(ETAGS)" tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS .PHONY: tags @@ -778,7 +765,7 @@ VCSWITNESS = $(lispsource)/loaddefs.el: $(VCSWITNESS) | \ bootstrap-emacs$(EXEEXT) $(bootstrap_pdmp) - $(MAKE) -C ../lisp autoloads EMACS="$(bootstrap_exe)" + $(MAKE) -C $(dir $@) autoloads EMACS="$(bootstrap_exe)" ## Dump an Emacs executable named bootstrap-emacs containing the ## files from loadup.el in source form. diff --git a/src/fingerprint-dummy.c b/src/fingerprint-dummy.c deleted file mode 100644 index 04938bd1d08..00000000000 --- a/src/fingerprint-dummy.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Dummy fingerprint - -Copyright (C) 2016, 2018-2019 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - -#include - -#include "fingerprint.h" - -/* Dummy fingerprint to use as hash input. */ -unsigned char const fingerprint[32] = { 0 };