]> code.delx.au - gnu-emacs/blobdiff - src/Makefile.in
Merge branch 'master' into cairo
[gnu-emacs] / src / Makefile.in
index 9e7a8a799150dbb2ce4e1f316a5bdcf9a7ccb720..d0df3260356096abf4ec84d1bb56ffe37a9f12c8 100644 (file)
@@ -327,10 +327,15 @@ am__v_at_0 = @
 am__v_at_1 =
 
 DEPDIR=deps
-## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
-DEPFLAGS=@DEPFLAGS@
-## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
-MKDEPDIR=@MKDEPDIR@
+AUTO_DEPEND = @AUTO_DEPEND@
+
+ifeq ($(AUTO_DEPEND),yes)
+DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP
+MKDEPDIR = ${MKDIR_P} ${DEPDIR}
+else
+DEPFLAGS =
+MKDEPDIR = :
+endif
 
 ## DO NOT use -R.  There is a special hack described in lastfile.c
 ## which is used instead.  Some initialized data areas are modified
@@ -417,9 +422,37 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
 FIRSTFILE_OBJ=@FIRSTFILE_OBJ@
 ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
 
-## Configure inserts the file lisp.mk at this point, defining $lisp.
-@lisp_frag@
-
+## This is the list of all Lisp files that might be loaded into the
+## dumped Emacs.  Some of them are not loaded on all platforms, but
+## the DOC file on every platform uses them (because the DOC file is
+## supposed to be platform-independent).
+## Note that this list should not include lisp files which might not
+## be present, like site-load.el and site-init.el; this makefile
+## expects them all to be either present or buildable.
+##
+## To generate this list from loadup.el, we can either:
+## 1) Extract everything matching (load "..."), in which case
+## we need to add charprop.el by hand; or
+## 2) Extract everything matching (load "...", in which case
+## we need to remove leim-list, site-init, and site-load by hand.
+## There's not much to choose between these two approaches,
+## but the second one seems like it could be more future-proof.
+shortlisp =
+lisp.mk: $(lispsource)/loadup.el
+       @rm -f $@
+       ${AM_V_GEN}( echo "shortlisp = \\"; \
+       sed -n 's/^[ \t]*(load "\([^"]*\)".*/\1/p' $< | \
+         sed -e 's/$$/.elc \\/' -e 's/\.el\.elc/.el/'; \
+       echo "" ) > $@
+
+-include lisp.mk
+shortlisp_filter = leim/leim-list.el site-load.elc site-init.elc
+shortlisp := $(filter-out ${shortlisp_filter},${shortlisp})
+## Place loaddefs.el first, so it gets generated first, since it is on
+## the critical path (relevant in parallel compilations).
+## We don't really need to sort, but may as well use it to remove duplicates.
+shortlisp := loaddefs.el loadup.el $(sort ${shortlisp})
+lisp = $(addprefix ${lispsource}/,${shortlisp})
 
 ## Construct full set of libraries to be linked.
 LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
@@ -453,7 +486,7 @@ $(srcdir)/macuvs.h $(lispsource)/international/charprop.el: \
 ## since not all pieces are used on all platforms.  But DOC depends
 ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
 emacs$(EXEEXT): temacs$(EXEEXT) \
-                $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \
+                lisp.mk $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \
                 $(lispsource)/international/charprop.el
 ifeq ($(CANNOT_DUMP),yes)
        ln -f temacs$(EXEEXT) $@
@@ -464,12 +497,9 @@ else
 endif
 
 ## We run make-docfile twice because the command line may get too long
-## on some systems.  The sed command operating on lisp.mk also reduces
-## the length of the command line.  Unfortunately, no-one has any idea
+## on some systems.  Unfortunately, no-one has any idea
 ## exactly how long the maximum safe command line length is on all the
-## various systems that Emacs supports.  Obviously, the length depends
-## on what your value of $srcdir is.  If the length restriction goes
-## away, lisp.mk can be merged back into this file.
+## various systems that Emacs supports.
 ##
 ## $(SOME_MACHINE_OBJECTS) comes before $(obj) because some files may
 ## or may not be included in $(obj), but they are always included in
@@ -477,14 +507,13 @@ endif
 ## for the first time, this prevents any variation between configurations
 ## in the contents of the DOC file.
 ##
-$(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
+$(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
        $(AM_V_GEN)$(MKDIR_P) $(etc)
        -$(AM_V_at)rm -f $(etc)/DOC
        $(AM_V_at)$(libsrc)/make-docfile -d $(srcdir) \
          $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC
        $(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \
-         `sed -n -e 's| \\\\||' -e 's|^[       ]*$$(lispsource)/||p' \
-            $(srcdir)/lisp.mk`
+         $(shortlisp)
 
 $(libsrc)/make-docfile$(EXEEXT):
        $(MAKE) -C $(libsrc) make-docfile$(EXEEXT)
@@ -584,7 +613,7 @@ bootstrap-clean: clean
        fi
 
 distclean: bootstrap-clean
-       rm -f Makefile
+       rm -f Makefile lisp.mk
 
 maintainer-clean: distclean
        rm -f TAGS
@@ -607,9 +636,11 @@ ctagsfiles3 = [a-zA-Z]*.m
 ## rather than the file contents.
 TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(srcdir)/$(ctagsfiles3)
        "$(ETAGS)" --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
-         --regex='{c}/[        ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/' \
+         --regex='{c}/[        ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/\1/' \
+         --regex='{c}/[        ]*DEFVAR_[A-Z_  (]+"[^"]+",[    ]\([A-Za-z0-9_]+\)/\1/' \
          $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) \
-         --regex='{objc}/[     ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/' \
+         --regex='{objc}/[     ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/\1/' \
+         --regex='{objc}/[     ]*DEFVAR_[A-Z_  (]+"[^"]+",[    ]\([A-Za-z0-9_]+\)/\1/' \
          $(srcdir)/$(ctagsfiles3)
 
 ## Arrange to make tags tables for ../lisp and ../lwlib,
@@ -669,8 +700,10 @@ endif
        @: Compile some files earlier to speed up further compilation.
        $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)"
 
-## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
-@deps_frag@
-
+ifeq ($(AUTO_DEPEND),yes)
+-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
+else
+include $(srcdir)/deps.mk
+endif
 
 ### Makefile.in ends here